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, "te")
|| endsWith(s, len, "et"))) return len - 2; || endsWith(s, len, "et"))) return len - 2;
if (len > 5 && endsWith(s, len, "ion"))
return len;
if (len > 3) if (len > 3)
switch (s[len - 1]) { switch (s[len - 1]) {
case 't': case 't':

View File

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

View File

@ -80,4 +80,7 @@ timmar timm
tomter tomt tomter tomt
tomtar tomt tomtar tomt
änderna änd änderna änd
ändar änd ändar änd
reaktion reaktion
kommunikation kommunikation
inflation inflation