[honey] Remove unless code copy
[xapian.git] / xapian-core / languages / lovins.sbl
blobf4334dc3699bdd7916d69585c2a1462ded02860b
1 // Alias:
3 stringescapes {}
5 routines (
6    A B C D E F G H I J K L M N O P Q R S T U V W X Y Z AA BB CC
8    endings
10    undouble respell
13 externals ( stem )
15 backwardmode (
17   /* Lovins' conditions A, B ... CC, as given in her Appendix B, where
18      a test for a two letter prefix ('test hop 2') is implicitly
19      assumed. Note that 'e' next 'u' corresponds to her u*e because
20      Snowball is scanning backwards. */
22   define A  as ( hop 2 )
23   define B  as ( hop 3 )
24   define C  as ( hop 4 )
25   define D  as ( hop 5 )
26   define E  as ( test hop 2 not 'e' )
27   define F  as ( test hop 3 not 'e' )
28   define G  as ( test hop 3 'f' )
29   define H  as ( test hop 2 't' or 'll' )
30   define I  as ( test hop 2 not 'o' not 'e' )
31   define J  as ( test hop 2 not 'a' not 'e' )
32   define K  as ( test hop 3 'l' or 'i' or ('e' next 'u') )
33   define L  as ( test hop 2 not 'u' not 'x' not ('s' not 'o') )
34   define M  as ( test hop 2 not 'a' not 'c' not 'e' not 'm' )
35   define N  as ( test hop 3 ( hop 2 not 's' or hop 2 ) )
36   define O  as ( test hop 2 'l' or 'i' )
37   define P  as ( test hop 2 not 'c' )
38   define Q  as ( test hop 2 test hop 3 not 'l' not 'n' )
39   define R  as ( test hop 2 'n' or 'r' )
40   define S  as ( test hop 2 'dr' or ('t' not 't') )
41   define T  as ( test hop 2 's' or ('t' not 'o') )
42   define U  as ( test hop 2 'l' or 'm' or 'n' or 'r' )
43   define V  as ( test hop 2 'c' )
44   define W  as ( test hop 2 not 's' not 'u' )
45   define X  as ( test hop 2 'l' or 'i' or ('e' next 'u') )
46   define Y  as ( test hop 2 'in' )
47   define Z  as ( test hop 2 not 'f' )
48   define AA as ( test hop 2 among ( 'd' 'f' 'ph' 'th' 'l' 'er' 'or'
49                                     'es' 't' ) )
50   define BB as ( test hop 3 not 'met' not 'ryst' )
51   define CC as ( test hop 2 'l' )
54   /* The system of endings, as given in Appendix A. */
56   define endings as (
57     [substring] among(
58     'alistically' B 'arizability' A 'izationally' B
60      'antialness' A  'arisations' A  'arizations' A  'entialness' A
62       'allically' C   'antaneous' A   'antiality' A   'arisation' A
63       'arization' A   'ationally' B   'ativeness' A   'eableness' E
64       'entations' A   'entiality' A   'entialize' A   'entiation' A
65       'ionalness' A   'istically' A   'itousness' A   'izability' A
66       'izational' A
68        'ableness' A    'arizable' A    'entation' A    'entially' A
69        'eousness' A    'ibleness' A    'icalness' A    'ionalism' A
70        'ionality' A    'ionalize' A    'iousness' A    'izations' A
71        'lessness' A
73         'ability' A     'aically' A     'alistic' B     'alities' A
74         'ariness' E     'aristic' A     'arizing' A     'ateness' A
75         'atingly' A     'ational' B     'atively' A     'ativism' A
76         'elihood' E     'encible' A     'entally' A     'entials' A
77         'entiate' A     'entness' A     'fulness' A     'ibility' A
78         'icalism' A     'icalist' A     'icality' A     'icalize' A
79         'ication' G     'icianry' A     'ination' A     'ingness' A
80         'ionally' A     'isation' A     'ishness' A     'istical' A
81         'iteness' A     'iveness' A     'ivistic' A     'ivities' A
82         'ization' F     'izement' A     'oidally' A     'ousness' A
84          'aceous' A      'acious' B      'action' G      'alness' A
85          'ancial' A      'ancies' A      'ancing' B      'ariser' A
86          'arized' A      'arizer' A      'atable' A      'ations' B
87          'atives' A      'eature' Z      'efully' A      'encies' A
88          'encing' A      'ential' A      'enting' C      'entist' A
89          'eously' A      'ialist' A      'iality' A      'ialize' A
90          'ically' A      'icance' A      'icians' A      'icists' A
91          'ifully' A      'ionals' A      'ionate' D      'ioning' A
92          'ionist' A      'iously' A      'istics' A      'izable' E
93          'lessly' A      'nesses' A      'oidism' A
95           'acies' A       'acity' A       'aging' B       'aical' A
96           'alist' A       'alism' B       'ality' A       'alize' A
97           'allic'BB       'anced' B       'ances' B       'antic' C
98           'arial' A       'aries' A       'arily' A       'arity' B
99           'arize' A       'aroid' A       'ately' A       'ating' I
100           'ation' B       'ative' A       'ators' A       'atory' A
101           'ature' E       'early' Y       'ehood' A       'eless' A
102           'elity' A       'ement' A       'enced' A       'ences' A
103           'eness' E       'ening' E       'ental' A       'ented' C
104           'ently' A       'fully' A       'ially' A       'icant' A
105           'ician' A       'icide' A       'icism' A       'icist' A
106           'icity' A       'idine' I       'iedly' A       'ihood' A
107           'inate' A       'iness' A       'ingly' B       'inism' J
108           'inity'CC       'ional' A       'ioned' A       'ished' A
109           'istic' A       'ities' A       'itous' A       'ively' A
110           'ivity' A       'izers' F       'izing' F       'oidal' A
111           'oides' A       'otide' A       'ously' A
113            'able' A        'ably' A        'ages' B        'ally' B
114            'ance' B        'ancy' B        'ants' B        'aric' A
115            'arly' K        'ated' I        'ates' A        'atic' B
116            'ator' A        'ealy' Y        'edly' E        'eful' A
117            'eity' A        'ence' A        'ency' A        'ened' E
118            'enly' E        'eous' A        'hood' A        'ials' A
119            'ians' A        'ible' A        'ibly' A        'ical' A
120            'ides' L        'iers' A        'iful' A        'ines' M
121            'ings' N        'ions' B        'ious' A        'isms' B
122            'ists' A        'itic' H        'ized' F        'izer' F
123            'less' A        'lily' A        'ness' A        'ogen' A
124            'ward' A        'wise' A        'ying' B        'yish' A
126             'acy' A         'age' B         'aic' A         'als'BB
127             'ant' B         'ars' O         'ary' F         'ata' A
128             'ate' A         'eal' Y         'ear' Y         'ely' E
129             'ene' E         'ent' C         'ery' E         'ese' A
130             'ful' A         'ial' A         'ian' A         'ics' A
131             'ide' L         'ied' A         'ier' A         'ies' P
132             'ily' A         'ine' M         'ing' N         'ion' Q
133             'ish' C         'ism' B         'ist' A         'ite'AA
134             'ity' A         'ium' A         'ive' A         'ize' F
135             'oid' A         'one' R         'ous' A
137              'ae' A          'al'BB          'ar' X          'as' B
138              'ed' E          'en' F          'es' E          'ia' A
139              'ic' A          'is' A          'ly' B          'on' S
140              'or' T          'um' U          'us' V          'yl' R
141            '{'}s' A        's{'}' A
143               'a' A           'e' A           'i' A           'o' A
144               's' W           'y' B
146         (delete)
147     )
148   )
150   /* Undoubling is rule 1 of appendix C. */
152   define undouble as (
153     test substring among ('bb' 'dd' 'gg' 'll' 'mm' 'nn' 'pp' 'rr' 'ss'
154                           'tt')
155     [next] delete
156   )
158   /* The other appendix C rules can be done together. */
160   define respell as (
161     [substring] among (
162       'iev'  (<-'ief')
163       'uct'  (<-'uc')
164       'umpt' (<-'um')
165       'rpt'  (<-'rb')
166       'urs'  (<-'ur')
167       'istr' (<-'ister')
168       'metr' (<-'meter')
169       'olv'  (<-'olut')
170       'ul'   (not 'a' not 'i' not 'o' <-'l')
171       'bex'  (<-'bic')
172       'dex'  (<-'dic')
173       'pex'  (<-'pic')
174       'tex'  (<-'tic')
175       'ax'   (<-'ac')
176       'ex'   (<-'ec')
177       'ix'   (<-'ic')
178       'lux'  (<-'luc')
179       'uad'  (<-'uas')
180       'vad'  (<-'vas')
181       'cid'  (<-'cis')
182       'lid'  (<-'lis')
183       'erid' (<-'eris')
184       'pand' (<-'pans')
185       'end'  (not 's' <-'ens')
186       'ond'  (<-'ons')
187       'lud'  (<-'lus')
188       'rud'  (<-'rus')
189       'her'  (not 'p' not 't' <-'hes')
190       'mit'  (<-'mis')
191       'ent'  (not 'm' <-'ens')
192         /* 'ent' was 'end' in the 1968 paper - a typo. */
193       'ert'  (<-'ers')
194       'et'   (not 'n' <-'es')
195       'yt'   (<-'ys')
196       'yz'   (<-'ys')
197     )
198   )
201 define stem as (
203   backwards (
204     do endings
205     do undouble
206     do respell
207   )