Apache Lucene open-source search software
[hunspell] perform a bit fewer checks after 2 suffixes have been removed
Peter Gromov419ffd3974e4
diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Stemmer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Stemmer.javaindex 0e11d457c3c..3b2fe4370f0 100644--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Stemmer.java+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Stemmer.java@@ -614,6 +614,8 @@ final class Stemmer {return false;}+ if (innerSuffix >= 0) return true;+int recursionDepth =(outerSuffix >= 0 ? 1 : 0) + (innerPrefix >= 0 ? 2 : outerPrefix >= 0 ? 1 : 0) - 1;if (dictionary.isCrossProduct(affix) && recursionDepth <= 1) {