You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/02/05 08:44:25 UTC

[GitHub] [lucene-solr] dweiss commented on a change in pull request #2301: LUCENE-9732: Hunspell: support dictionary entries starting with slash

dweiss commented on a change in pull request #2301:
URL: https://github.com/apache/lucene-solr/pull/2301#discussion_r570805734



##########
File path: lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/WordCase.java
##########
@@ -53,14 +54,19 @@ static WordCase caseOf(CharSequence word, int length) {
       if (seenUpper && seenLower) break;
     }
 
-    return get(startsWithLower, seenUpper, seenLower);
+    return get(startCase, seenUpper, seenLower);
   }
 
-  private static WordCase get(boolean startsWithLower, boolean seenUpper, boolean seenLower) {
-    if (!startsWithLower) {
-      return !seenLower ? UPPER : !seenUpper ? TITLE : MIXED;
+  private static WordCase get(CharCase startCase, boolean seenUpper, boolean seenLower) {

Review comment:
       Darn this method is case-crazy. :)
   Can you add a javadoc here and just show an example of what each of these WordCases are (or attach such an example to WordCase's enum values)?
   
   I'd also remove the negation and swap arguments in case UPPER - one thing less to reason about.




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



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