don't lookup empty stems after stripping the whole word

This commit is contained in:
Peter Gromov 2021-03-08 08:56:10 +01:00
parent 469cfc67d4
commit e69390b268
4 changed files with 9 additions and 1 deletions

View File

@ -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) {

View File

@ -26,5 +26,7 @@ public class TestFullStrip extends StemmerTestBase {
public void testStemming() {
assertStemsTo("tasty", "beer");
assertStemsTo("as", "a");
assertStemsTo("s");
}
}

View File

@ -4,3 +4,6 @@ FULLSTRIP
SFX A Y 1
SFX A beer tasty .
SFX S Y 1
SFX S 0 s .