commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [commons-text] aherbert commented on a change in pull request #112: Text 158
Date Mon, 11 Mar 2019 12:55:14 GMT
aherbert commented on a change in pull request #112: Text 158
URL: https://github.com/apache/commons-text/pull/112#discussion_r264217321
 
 

 ##########
 File path: src/test/java/org/apache/commons/text/similarity/JaccardDistanceTest.java
 ##########
 @@ -37,7 +37,7 @@ public static void setUp() {
     @Test
     public void testGettingJaccardDistance() {
         // Expected Jaccard distance = 1.0 - (intersect / union)
-        assertEquals(1.0, classBeingTested.apply("", ""));
+        assertEquals(0.0, classBeingTested.apply("", ""));
 
 Review comment:
   Sorry, you are right. It was my mistake carried over from fixing another similarity class
to use `StringUtils.equals`.
   
   However you should consider using `StringUtils.equals` before splitting all the sequences
into a set to provide a fast exit in the case of equal input. This is done in `JaroWinklerSimilarity`.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message