Exclude words ending in -ion from Swedish minimal and light stemmers.

This commit is contained in:
acsbendi 2023-04-27 16:56:13 +02:00
parent 1fa2be90ea
commit bfd822dde3
4 changed files with 10 additions and 1 deletions

View File

@ -87,6 +87,9 @@ class SwedishLightStemmer {
|| endsWith(s, len, "te")
|| endsWith(s, len, "et"))) return len - 2;
if (len > 5 && endsWith(s, len, "ion"))
return len;
if (len > 3)
switch (s[len - 1]) {
case 't':

View File

@ -82,6 +82,9 @@ class SwedishMinimalStemmer {
|| endsWith(s, len, "or")
|| endsWith(s, len, "en"))) return len - 2;
if (len > 5 && endsWith(s, len, "ion"))
return len;
if (len > 3)
switch (s[len - 1]) {
case 'a':

View File

@ -81,3 +81,6 @@ tomter tomt
tomtar tomt
änderna änd
ändar änd
reaktion reaktion
kommunikation kommunikation
inflation inflation