The stemming algorithm
German includes the following accented forms,
-
ä ö ü
and a special letter, ß, equivalent to double s.
The following letters are vowels:
-
a e i o u y ä ö ü
First, replace ß by ss, and put u and y between vowels into upper case.
R1 and R2 are first set up in the standard way
(see the note on R1 and R2),
but then R1 is
adjusted so that the region before it contains at least 3 letters.
Define a valid s-ending as one of b, d, f, g, h, k, l, m, n, r or t.
Define a valid st-ending as the same list, excluding letter r.
Do each of steps 1, 2 and 3.
Step 1:
-
Search for the longest among the following suffixes,
-
(a) em ern er
(b) e en es
(c) s (preceded by a valid s-ending)
and delete if in R1. (Of course the letter of the valid s-ending is
not necessarily in R1.) If an ending of group (b) is deleted, and the ending
is preceded by niss, delete the final s.
(For example, äckern -> äck, ackers -> acker,
armes -> arm, bedürfnissen -> bedürfnis)
Step 2:
-
Search for the longest among the following suffixes,
-
(a) en er est
(b) st (preceded by a valid st-ending, itself preceded by at least 3
letters)
and delete if in R1.
(For example, derbsten -> derbst by step 1, and derbst -> derb by step
2, since b is a valid st-ending, and is preceded by just 3 letters)
Step 3: d-suffixes (*)
-
Search for the longest among the following suffixes, and perform the
action indicated.
- end ung
- delete if in R2
- if preceded by ig, delete if in R2 and not preceded by e
- ig ik isch
- delete if in R2 and not preceded by e
- lich heit
- delete if in R2
- if preceded by er or en, delete if in R1
- keit
- delete if in R2
- if preceded by lich or ig, delete if in R2
Finally,
-
turn U and Y back into lower case, and remove the umlaut accent from a,
o and u.
|