
ws4j - issue #6
Measures with range [0,1] return Double.MAX_VALUE for pairs of identical words.
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.
- Test.java 860
Comment #1
Posted on Jul 29, 2013 by Massive KangarooHi. 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.
Comment #2
Posted on Aug 11, 2014 by Swift GiraffeThis 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
Comment #3
Posted on Nov 2, 2014 by Quick RhinoThanks 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
Comment #4
Posted on Nov 2, 2014 by Quick RhinoRev 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.
Status: New
Labels:
Type-Defect
Priority-Medium