mirror of https://github.com/apache/lucene.git
don't lookup empty stems after stripping the whole word
This commit is contained in:
parent
469cfc67d4
commit
e69390b268
|
@ -488,6 +488,8 @@ final class Stemmer {
|
|||
int stripEnd = dictionary.stripOffsets[stripOrd + 1];
|
||||
int stripLen = stripEnd - stripStart;
|
||||
|
||||
if (stripLen + deAffixedLen == 0) return null;
|
||||
|
||||
char[] stripData = dictionary.stripData;
|
||||
int condition = dictionary.getAffixCondition(affix);
|
||||
if (condition != 0) {
|
||||
|
|
|
@ -26,5 +26,7 @@ public class TestFullStrip extends StemmerTestBase {
|
|||
|
||||
public void testStemming() {
|
||||
assertStemsTo("tasty", "beer");
|
||||
assertStemsTo("as", "a");
|
||||
assertStemsTo("s");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,3 +4,6 @@ FULLSTRIP
|
|||
|
||||
SFX A Y 1
|
||||
SFX A beer tasty .
|
||||
|
||||
SFX S Y 1
|
||||
SFX S 0 s .
|
|
@ -1,2 +1,3 @@
|
|||
1
|
||||
2
|
||||
beer/A
|
||||
a/S
|
Loading…
Reference in New Issue