Skip to content

Commit

Permalink
[swedish] Improve handling of -öst
Browse files Browse the repository at this point in the history
Change -öst to -ös when preceded by any of 'iklnprtuv' rather than
just 'l'.

The new rule only requires the -öst to be in R1 whereas previously
we required all of -löst to be.  This second tweak doesn't seem to
affect any words ending -löst but it conflates a few extra cases
when combined with the expanded list of preceding letters, and seems
more logical linguistically (since -ös is akin to -ous in English).

Fixes #152, reported by znakeeye.
  • Loading branch information
ojwb committed Oct 4, 2023
1 parent 9fdf5b0 commit 6bfccb8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions algorithms/swedish.sbl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ externals ( stem )

integers ( p1 x )

groupings ( v s_ending )
groupings ( v s_ending ost_ending )

stringescapes {}

Expand All @@ -23,6 +23,8 @@ define v 'aeiouy{a"}{ao}{o"}'

define s_ending 'bcdfghjklmnoprtvy'

define ost_ending 'iklnprtuv'

define mark_regions as (

$p1 = limit
Expand Down Expand Up @@ -52,10 +54,11 @@ backwardmode (
and ([next] delete)
)

define other_suffix as setlimit tomark p1 for (
[substring] among(
define other_suffix as (
setlimit tomark p1 for ([substring])
among(
'lig' 'ig' 'els' (delete)
'l{o"}st' (<-'l{o"}s')
'{o"}st' (ost_ending <-'{o"}s')
'fullt' (<-'full')
)
)
Expand Down

0 comments on commit 6bfccb8

Please sign in to comment.