5 Numbers in square brackets refer to the sections in
6 Fred Karlsson, Finnish: An Essential Grammar. Routledge, 1999
14 particle_etc possessive
27 booleans ( ending_removed )
28 groupings ( AEI V1 V2 particle_end )
32 /* special characters */
34 stringdef a" '{U+00E4}'
35 stringdef o" '{U+00F6}'
38 define V1 'aeiouy{a"}{o"}'
39 define V2 'aeiou{a"}{o"}'
40 define particle_end V1 + 'nt'
42 define mark_regions as (
47 goto V1 gopast non-V1 setmark p1
48 goto V1 gopast non-V1 setmark p2
53 define R2 as $p2 <= cursor
55 define particle_etc as (
56 setlimit tomark p1 for ([substring])
62 'pa' 'p{a"}' // Particles [91]
69 define possessive as ( // [36]
70 setlimit tomark p1 for ([substring])
73 (not 'k' delete) // take 'ksi' as the Comitative case
75 (delete ['kse'] <- 'ksi') // kseni = ksi + ni
80 /* Now for Vn possessives after case endings: [36] */
82 (among('ta' 'ssa' 'sta' 'lla' 'lta' 'na') delete)
84 (among('t{a"}' 'ss{a"}' 'st{a"}'
85 'll{a"}' 'lt{a"}' 'n{a"}') delete)
87 (among('lle' 'ine') delete)
92 among('aa' 'ee' 'ii' 'oo' 'uu' '{a"}{a"}' '{o"}{o"}')
96 define case_ending as (
97 setlimit tomark p1 for ([substring])
103 'h{a"}n' ('{a"}') // Illative [43]
104 'h{o"}n' ('{o"}') // |
109 'tten' VI // Genitive plurals [34]
111 'n' // Genitive or Illative
112 ( try ( LONG // Illative
116 /* otherwise Genitive */
121 'tta' 'tt{a"}' // Partitive [32]
125 'ssa' 'ss{a"}' // Inessive [41]
126 'sta' 'st{a"}' // Elative [42]
128 'lla' 'll{a"}' // Adessive [44]
129 'lta' 'lt{a"}' // Ablative [51]
130 'lle' // Allative [46]
131 'na' 'n{a"}' // Essive [49]
132 'ksi' // Translative[50]
133 'ine' // Comitative [51]
135 /* Abessive and Instructive are too rare for
142 define other_endings as (
143 setlimit tomark p2 for ([substring])
146 'mmi' 'mma' 'mm{a"}' // Comparative forms [85]
147 (not 'po') //-improves things
148 'impi' 'impa' 'imp{a"}'
149 'immi' 'imma' 'imm{a"}' // Superlative forms [86]
150 'eja' 'ej{a"}' // indicates agent [93.1B]
154 define i_plural as ( // [26]
155 setlimit tomark p1 for ([substring])
161 define t_plural as ( // [26]
162 setlimit tomark p1 for (
166 setlimit tomark p2 for ([substring])
168 'mma' (not 'po') //-mmat endings
169 'imma' //-immat endings
174 setlimit tomark p1 for (
175 do ( LONG and ([next] delete ) ) // undouble vowel
176 do ( [AEI] non-V1 delete ) // remove trailing a, a", e, i
177 do ( ['j'] 'o' or 'u' delete )
178 do ( ['o'] 'j' delete )
180 goto non-V1 [next] -> x x delete // undouble consonant
193 (ending_removed do i_plural) or do t_plural