2 // Snowball's "Norwegian" stemmer works for both nb and nn
3 // according to AlexB on #xapian.
16 groupings ( v s_ending )
20 /* special characters (in ISO Latin I) */
26 define v 'aeiouy{ae}{ao}{o/}'
28 define s_ending 'bcdfghjlmnoprtvyz'
30 define mark_regions as (
34 test ( hop 3 setmark x )
35 goto v gopast non-v setmark p1
36 try ( $p1 < x $p1 = x )
41 define main_suffix as (
42 setlimit tomark p1 for ([substring])
45 'a' 'e' 'ede' 'ande' 'ende' 'ane' 'ene' 'hetene' 'en' 'heten' 'ar'
46 'er' 'heter' 'as' 'es' 'edes' 'endes' 'enes' 'hetenes' 'ens'
47 'hetens' 'ers' 'ets' 'et' 'het' 'ast'
50 (s_ending or ('k' non-v) delete)
56 define consonant_pair as (
58 setlimit tomark p1 for ([substring])
66 define other_suffix as (
67 setlimit tomark p1 for ([substring])
69 'leg' 'eleg' 'ig' 'eig' 'lig' 'elig' 'els' 'lov' 'elov' 'slov'