Document xapian-compact --blocksize takes an argument
[xapian.git] / xapian-core / languages / russian.sbl
blob6d0dd6b3a50e392d2a14c0b7d663d475136d2d6c
1 // Alias: ru
3 stringescapes {}
5 /* the 32 Cyrillic letters in Unicode */
7 stringdef a    hex '430'
8 stringdef b    hex '431'
9 stringdef v    hex '432'
10 stringdef g    hex '433'
11 stringdef d    hex '434'
12 stringdef e    hex '435'
13 stringdef zh   hex '436'
14 stringdef z    hex '437'
15 stringdef i    hex '438'
16 stringdef i`   hex '439'
17 stringdef k    hex '43A'
18 stringdef l    hex '43B'
19 stringdef m    hex '43C'
20 stringdef n    hex '43D'
21 stringdef o    hex '43E'
22 stringdef p    hex '43F'
23 stringdef r    hex '440'
24 stringdef s    hex '441'
25 stringdef t    hex '442'
26 stringdef u    hex '443'
27 stringdef f    hex '444'
28 stringdef kh   hex '445'
29 stringdef ts   hex '446'
30 stringdef ch   hex '447'
31 stringdef sh   hex '448'
32 stringdef shch hex '449'
33 stringdef "    hex '44A'
34 stringdef y    hex '44B'
35 stringdef '    hex '44C'
36 stringdef e`   hex '44D'
37 stringdef iu   hex '44E'
38 stringdef ia   hex '44F'
40 routines ( mark_regions R2
41            perfective_gerund
42            adjective
43            adjectival
44            reflexive
45            verb
46            noun
47            derivational
48            tidy_up
51 externals ( stem )
53 integers ( pV p2 )
55 groupings ( v )
57 define v '{a}{e}{i}{o}{u}{y}{e`}{iu}{ia}'
59 define mark_regions as (
61     $pV = limit
62     $p2 = limit
63     do (
64         gopast v  setmark pV  gopast non-v
65         gopast v  gopast non-v  setmark p2
66        )
69 backwardmode (
71     define R2 as $p2 <= cursor
73     define perfective_gerund as (
74         [substring] among (
75             '{v}'
76             '{v}{sh}{i}'
77             '{v}{sh}{i}{s}{'}'
78                 ('{a}' or '{ia}' delete)
79             '{i}{v}'
80             '{i}{v}{sh}{i}'
81             '{i}{v}{sh}{i}{s}{'}'
82             '{y}{v}'
83             '{y}{v}{sh}{i}'
84             '{y}{v}{sh}{i}{s}{'}'
85                 (delete)
86         )
87     )
89     define adjective as (
90         [substring] among (
91             '{e}{e}' '{i}{e}' '{y}{e}' '{o}{e}' '{i}{m}{i}' '{y}{m}{i}'
92             '{e}{i`}' '{i}{i`}' '{y}{i`}' '{o}{i`}' '{e}{m}' '{i}{m}'
93             '{y}{m}' '{o}{m}' '{e}{g}{o}' '{o}{g}{o}' '{e}{m}{u}'
94             '{o}{m}{u}' '{i}{kh}' '{y}{kh}' '{u}{iu}' '{iu}{iu}' '{a}{ia}'
95             '{ia}{ia}'
96                         // and -
97             '{o}{iu}'   // - which is somewhat archaic
98             '{e}{iu}'   // - soft form of {o}{iu}
99                 (delete)
100         )
101     )
103     define adjectival as (
104         adjective
106         /* of the participle forms, em, vsh, ivsh, yvsh are readily removable.
107            nn, {iu}shch, shch, u{iu}shch can be removed, with a small proportion of
108            errors. Removing im, uem, enn creates too many errors.
109         */
111         try (
112             [substring] among (
113                 '{e}{m}'                  // present passive participle
114                 '{n}{n}'                  // adjective from past passive participle
115                 '{v}{sh}'                 // past active participle
116                 '{iu}{shch}' '{shch}'     // present active participle
117                     ('{a}' or '{ia}' delete)
119      //but not  '{i}{m}' '{u}{e}{m}'      // present passive participle
120      //or       '{e}{n}{n}'               // adjective from past passive participle
122                 '{i}{v}{sh}' '{y}{v}{sh}'// past active participle
123                 '{u}{iu}{shch}'          // present active participle
124                     (delete)
125             )
126         )
128     )
130     define reflexive as (
131         [substring] among (
132             '{s}{ia}'
133             '{s}{'}'
134                 (delete)
135         )
136     )
138     define verb as (
139         [substring] among (
140             '{l}{a}' '{n}{a}' '{e}{t}{e}' '{i`}{t}{e}' '{l}{i}' '{i`}'
141             '{l}' '{e}{m}' '{n}' '{l}{o}' '{n}{o}' '{e}{t}' '{iu}{t}'
142             '{n}{y}' '{t}{'}' '{e}{sh}{'}'
144             '{n}{n}{o}'
145                 ('{a}' or '{ia}' delete)
147             '{i}{l}{a}' '{y}{l}{a}' '{e}{n}{a}' '{e}{i`}{t}{e}'
148             '{u}{i`}{t}{e}' '{i}{t}{e}' '{i}{l}{i}' '{y}{l}{i}' '{e}{i`}'
149             '{u}{i`}' '{i}{l}' '{y}{l}' '{i}{m}' '{y}{m}' '{e}{n}'
150             '{i}{l}{o}' '{y}{l}{o}' '{e}{n}{o}' '{ia}{t}' '{u}{e}{t}'
151             '{u}{iu}{t}' '{i}{t}' '{y}{t}' '{e}{n}{y}' '{i}{t}{'}'
152             '{y}{t}{'}' '{i}{sh}{'}' '{u}{iu}' '{iu}'
153                 (delete)
154             /* note the short passive participle tests:
155                '{n}{a}' '{n}' '{n}{o}' '{n}{y}'
156                '{e}{n}{a}' '{e}{n}' '{e}{n}{o}' '{e}{n}{y}'
157             */
158         )
159     )
161     define noun as (
162         [substring] among (
163             '{a}' '{e}{v}' '{o}{v}' '{i}{e}' '{'}{e}' '{e}'
164             '{i}{ia}{m}{i}' '{ia}{m}{i}' '{a}{m}{i}' '{e}{i}' '{i}{i}'
165             '{i}' '{i}{e}{i`}' '{e}{i`}' '{o}{i`}' '{i}{i`}' '{i`}'
166             '{i}{ia}{m}' '{ia}{m}' '{i}{e}{m}' '{e}{m}' '{a}{m}' '{o}{m}'
167             '{o}' '{u}' '{a}{kh}' '{i}{ia}{kh}' '{ia}{kh}' '{y}' '{'}'
168             '{i}{iu}' '{'}{iu}' '{iu}' '{i}{ia}' '{'}{ia}' '{ia}'
169                 (delete)
170             /* the small class of neuter forms '{e}{n}{i}' '{e}{n}{e}{m}'
171                '{e}{n}{a}' '{e}{n}' '{e}{n}{a}{m}' '{e}{n}{a}{m}{i}' '{e}{n}{a}{x}'
172                omitted - they only occur on 12 words.
173             */
174         )
175     )
177     define derivational as (
178         [substring] R2 among (
179             '{o}{s}{t}'
180             '{o}{s}{t}{'}'
181                 (delete)
182         )
183     )
185     define tidy_up as (
186         [substring] among (
188             '{e}{i`}{sh}'
189             '{e}{i`}{sh}{e}'  // superlative forms
190                (delete
191                 ['{n}'] '{n}' delete
192                )
193             '{n}'
194                ('{n}' delete) // e.g. -nno endings
195             '{'}'
196                (delete)  // with some slight false conflations
197         )
198     )
201 define stem as (
203     do mark_regions
204     backwards setlimit tomark pV for (
205         do (
206              perfective_gerund or
207              ( try reflexive
208                adjectival or verb or noun
209              )
210         )
211         try([ '{i}' ] delete)
212         // because noun ending -i{iu} is being treated as verb ending -{iu}
214         do derivational
215         do tidy_up
216     )