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



##########
File path: 
lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/GeneratingSuggester.java
##########
@@ -75,25 +84,29 @@
             return;
           }
 
-          String root = rootChars.toString();
-          filterSuitableEntries(root, forms, entries);
-          if (entries.isEmpty()) return;
+          int suitable = filter.findSuitableFormIndex(forms, 0);
+          if (suitable < 0) return;
 
-          if (ignoreTitleCaseRoots && WordCase.caseOf(rootChars) == 
WordCase.TITLE) {
+          if (ignoreTitleCaseRoots
+              && Character.isUpperCase(rootChars.charAt(0))
+              && WordCase.caseOf(rootChars) == WordCase.TITLE) {

Review comment:
       `caseOf` walks the entire array, but we don't always need that, e.g. if 
the first letter is lowercase (the majority of entries)




----------------------------------------------------------------
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to