yimonchan / ws4j

Automatically exported from code.google.com/p/ws4j
0 stars 0 forks source link

Measures with range [0,1] return Double.MAX_VALUE for pairs of identical words. #6

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Calculating the Lin, Wu-Palmer and Path similarity measures using 
calcRelatednessOfWords(String u, String v) where u.equals(v) is true.

What is the expected output? What do you see instead?
The expected output for each similarity measure is 1.0, but I get 
1.7976931348623157E308 instead.

What version of the product are you using? On what operating system?
I am using 1.0.1 on a Mac (OS X version 10.8.3)

Please provide any additional information below.
If u.equals(v) is false, then the similarity scores seem to be as expected.

Original issue reported on code.google.com by ritwik.b...@gmail.com on 19 Jul 2013 at 4:16

Attachments:

GoogleCodeExporter commented 8 years ago
Hi. I have exactly the same problem with ws4j1.0.1. Should the result for the 
desktop version be different from what we obtain with the demo site web ? Could 
somebody help ? Thanks.

Original comment by v.er...@gmail.com on 29 Jul 2013 at 3:10

GoogleCodeExporter commented 8 years ago
This looks like it is due to attempting to override a protected static field 
(this can't be done in Java). The attached patch fixes the issue by moving the 
definition of min and max the fields to non-static final members in 
RelatednessCalculator and adding getters. Implementations then provide their 
min/max values through super constructor calls.

Patch can be applied with patch -p1 < 
0001-Cannot-override-static-members-replacing-fields-with.patch

Original comment by mai...@jamesfry.com on 11 Aug 2014 at 10:59

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for the info, but

I'm unable to apply the patch using your instructions.

Hunk #1 FAILED at 26.
Hunk #2 FAILED at 42.
Hunk #3 FAILED at 76.

etc...

For each file.

I'm using Ubuntu 12.04 and the readonly source from 
http://ws4j.googlecode.com/svn/trunk

Original comment by doyouund...@gmail.com on 2 Nov 2014 at 4:46

GoogleCodeExporter commented 8 years ago
Rev 48.  It appears we have different versions of the source.  Maybe there's 
another repo somewhere that I should be accessing?

I'll apply manually and report back...thanks again.

Original comment by doyouund...@gmail.com on 2 Nov 2014 at 4:59