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 2022/12/28 13:07:11 UTC

[GitHub] [lucene] twosom commented on a diff in pull request #12044: some cleanup and refactoring codes of analysis-nori & analysis-kuromoji

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


##########
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:
   thanks.
   I'll change back this code.
   🫠



-- 
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-unsubscribe@lucene.apache.org

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