rmuir commented on code in PR #12044:
URL: https://github.com/apache/lucene/pull/12044#discussion_r1058327418


##########
lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/JapaneseBaseFormFilter.java:
##########
@@ -44,16 +44,18 @@ public JapaneseBaseFormFilter(TokenStream input) {
 
   @Override
   public boolean incrementToken() throws IOException {
-    if (input.incrementToken()) {
-      if (!keywordAtt.isKeyword()) {
-        String baseForm = basicFormAtt.getBaseForm();
-        if (baseForm != null) {
-          termAtt.setEmpty().append(baseForm);
-        }
-      }
-      return true;
-    } else {
+    if (input.incrementToken() == false) {
       return false;
     }
+
+    if (keywordAtt.isKeyword()) {
+      return true;
+    }
+
+    String baseForm = basicFormAtt.getBaseForm();
+    if (baseForm != null) {
+      termAtt.setEmpty().append(baseForm);
+    }
+    return true;

Review Comment:
   i don't understand the improvement here. it is clearer to be able to see the 
"decision tree" than to do multiple returns like this.



-- 
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: issues-unsubscr...@lucene.apache.org

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