donnerpeter commented on code in PR #11893:
URL: https://github.com/apache/lucene/pull/11893#discussion_r1009428049


##########
lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/GeneratingSuggester.java:
##########
@@ -60,7 +64,11 @@ private List<Weighted<Root<String>>> 
findSimilarDictionaryEntries(
       String word, WordCase originalCase) {
     Comparator<Weighted<Root<String>>> natural = Comparator.naturalOrder();
     PriorityQueue<Weighted<Root<String>>> roots = new 
PriorityQueue<>(natural.reversed());
-    EntryFilter filter = new EntryFilter(dictionary);
+
+    char[] excludeFlags = dictionary.allNonSuggestibleFlags();
+    FlagEnumerator.Lookup flagLookup = dictionary.flagLookup;
+    IntPredicate isSuggestible = formId -> !flagLookup.hasAnyFlag(formId, 
excludeFlags);

Review Comment:
   This is basically the inlined EntryFilter class with one for loop removed



-- 
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.

To unsubscribe, e-mail: [email protected]

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