[zanata/zanata-server] c70fe5: Fall back on stop-words comparison for similarity ...

GitHub noreply at github.com
Mon Jun 8 22:59:25 UTC 2015


  Branch: refs/heads/similarity-comparison-fix
  Home:   https://github.com/zanata/zanata-server
  Commit: c70fe523816a2c190a27c4fb054083974e1ece99
      https://github.com/zanata/zanata-server/commit/c70fe523816a2c190a27c4fb054083974e1ece99
  Author: David Mason <drdmason at gmail.com>
  Date:   2015-06-09 (Tue, 09 Jun 2015)

  Changed paths:
    M zanata-war/src/main/java/org/zanata/search/LevenshteinTokenUtil.java
    M zanata-war/src/test/java/org/zanata/search/LevenshteinTokenUtilTest.java

  Log Message:
  -----------
  Fall back on stop-words comparison for similarity when nothing else is available.

A divide-by-zero condition was generating a NaN value for similarity for strings
that contain only stop-words. When that condition would be met, this will instead
repeat the comparison without ignoring stop-words, then finally just return 0.0
if there are still no tokens to compare.




More information about the zanata-commits mailing list