jimczi commented on a change in pull request #1577:
URL: https://github.com/apache/lucene-solr/pull/1577#discussion_r440654020



##########
File path: 
lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/JapaneseTokenizer.java
##########
@@ -1917,4 +1917,15 @@ private static boolean isPunctuation(char ch) {
         return false;
     }
   }
+
+  private static boolean isAllCharPunctuation(char[] ch, int offset, int 
length) {
+    boolean flag = true;
+    for (int i = offset; i < offset + length; i++) {
+      if (!isPunctuation(ch[i])) {
+        flag = false;
+        break;
+      }
+    }
+    return flag;

Review comment:
       return `true` ?

##########
File path: 
lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/JapaneseTokenizer.java
##########
@@ -1917,4 +1917,15 @@ private static boolean isPunctuation(char ch) {
         return false;
     }
   }
+
+  private static boolean isAllCharPunctuation(char[] ch, int offset, int 
length) {
+    boolean flag = true;
+    for (int i = offset; i < offset + length; i++) {
+      if (!isPunctuation(ch[i])) {
+        flag = false;

Review comment:
       nit: you can return `false` directly ?




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