donnerpeter commented on a change in pull request #19:
URL: https://github.com/apache/lucene/pull/19#discussion_r594078030



##########
File path: 
lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/GeneratingSuggester.java
##########
@@ -94,10 +94,12 @@ char transformChar(char c) {
             return;
           }
 
-          int sc =
-              automaton.ngramScore(rootChars)
-                  - longerWorsePenalty(word.length(), rootChars.length)
-                  + commonPrefix(word, rootChars);
+          int sc = automaton.ngramScore(rootChars);
+          if (sc == 0) {
+            return; // no common characters at all, don't suggest this root

Review comment:
       It turns out that adding/removing same-zero-cost items to this PQ is 
quite noticeable




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to