/
root.lexc
379 lines (293 loc) · 14.3 KB
/
root.lexc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
! ========================================================================== !
!! # Faroese morphological analyser
! ========================================================================== !
Multichar_Symbols !!≈ # Definitions for @CODE@
! to be fixed
! +st.prop
!! ## Tags for POS
+N +V +A +Adv +Prop +Num !!≈ * @CODE@ : Open POS's
+CC +CS +Interj +Pr +Pron +IM !!≈ * @CODE@ : Closed POS's
+Pers +Det +Refl +Recipr +Poss +Dem !!≈ * @CODE@ : Pron types
+Nom +Acc +Gen +Dat !!≈ * @CODE@ : Case
+Msc +Fem +Neu !!≈ * @CODE@ : Gender
+Sg +Pl !!≈ * @CODE@ : Number
+Def +Indef !!≈ * @CODE@ : Definiteness
+Comp +Superl !!≈ * @CODE@ : Comparison
+Prs +Prt !!≈ * @CODE@ : Tense
+1Sg !!≈ * @CODE@ : Person-Number
+2Sg !!≈ * @CODE@ : Person-Number
+3Sg !!≈ * @CODE@ : Person-Number
+Inf +PrfPtc +PrsPrc +Sup +Imp +Sbj +Subj !!≈ * @CODE@ : Verb forms
+Cmp !!≈ * @CODE@ : Compound
+Abbr +ABBR +ACR !!≈ * @CODE@ : Abbreviations, acronyms ,
+CLB +PUNCT +LEFT +RIGHT !!≈ * @CODE@ : Punctuation, parentheses
+Symbol !!≈ * @CODE@ : independent symbols in the text stream, like £, €, ©
+CLBfinal !!≈ * **@CODE@** Sentence final abbreviated expression ending in full stop, so that the full stop is ambiguous
+Sg3 !!≈ * @CODE@ : This is inherited from common files, should be changed to +3Sg.
+ABBR !!≈ * @CODE@ sub-pos
+Arab !!≈ * @CODE@ sub-pos
+Attr !!≈ * @CODE@ sub-pos
+Coll !!≈ * @CODE@ sub-pos
+Com !!≈ * @CODE@ samiske kasus, skal bort
+Dyn !!≈ * @CODE@ samiske kasus, skal bort
+Ela !!≈ * @CODE@ samiske kasus, skal bort
+Ess !!≈ * @CODE@ samiske kasus, skal bort
+Ill !!≈ * @CODE@ samiske kasus, skal bort
+Ine !!≈ * @CODE@ samiske kasus, skal bort
+MWE !!≈ * @CODE@ multiword expression
+Pos !!≈ * @CODE@ sjekk desse XXX
+Rom !!≈ * @CODE@ sjekk desse XXX
+Der/heit !!≈ * @CODE@ Derivation with -heit
+Der/A !!≈ * @CODE@ derivation to Adjective
+Der/Adv !!≈ * @CODE@ derivation to Adverb
+Ind !!≈ * @CODE@
+Pass !!≈ * @CODE@
+Interr !!≈ * @CODE@
+Ord !!≈ * @CODE@
!! ## Semantic tags
+Sem/Sur !!≈ * @CODE@
+Sem/Mal !!≈ * @CODE@
+Sem/Fem !!≈ * @CODE@
+Sem/Plc !!≈ * @CODE@
+Sem/Org !!≈ * @CODE@
+Sem/Veh !!≈ * @CODE@
+Sem/Fem !!≈ * @CODE@
+Sem/Year !!≈ * @CODE@ - year (i.e. 1000 - 2999), used only for numerals
+Sem/Amount !!≈ * @CODE@
+Sem/Build !!≈ * @CODE@
+Sem/Build-room !!≈ * @CODE@
+Sem/Cat !!≈ * @CODE@
+Sem/Curr !!≈ * @CODE@
+Sem/Date !!≈ * @CODE@
+Sem/Domain !!≈ * @CODE@
+Sem/Domain_Hum !!≈ * @CODE@
+Sem/Dummytag !!≈ * @CODE@
+Sem/Edu !!≈ * @CODE@
+Sem/Edu_Hum !!≈ * @CODE@
+Sem/Event !!≈ * @CODE@
+Sem/Food-med !!≈ * @CODE@
+Sem/Group_Hum !!≈ * @CODE@
+Sem/Hum !!≈ * @CODE@
+Sem/ID !!≈ * @CODE@
+Sem/Lang !!≈ * @CODE@
+Sem/Mat !!≈ * @CODE@
+Sem/Measr !!≈ * @CODE@
+Sem/Money !!≈ * @CODE@
+Sem/Obj !!≈ * @CODE@
+Sem/Obj-el !!≈ * @CODE@
+Sem/Obj-ling !!≈ * @CODE@
+Sem/Org_Prod-audio !!≈ * @CODE@
+Sem/Org_Prod-vis !!≈ * @CODE@
+Sem/Part !!≈ * @CODE@
+Sem/Prod-vis !!≈ * @CODE@
+Sem/Route !!≈ * @CODE@
+Sem/Rule !!≈ * @CODE@
+Sem/Sign !!≈ * @CODE@
+Sem/State !!≈ * @CODE@
+Sem/State-sick !!≈ * @CODE@
+Sem/Substnc !!≈ * @CODE@
+Sem/Time !!≈ * @CODE@
+Sem/Time-clock !!≈ * @CODE@
+Sem/Tool-it !!≈ * @CODE@
+Sem/Txt !!≈ * @CODE@
+Gram/TAbbr !!≈ * **@CODE@**: Transitive abbreviation (it needs an argument)
+Gram/NoAbbr !!≈ * **@CODE@**: Intransitive abbreviations that are homonymous
!! with more frequent words. They should only be considered
!! abbreviations in the middle of a sentence.
+Gram/TNumAbbr !!≈ * **@CODE@**: Transitive abbreviation if the following
!! constituent is numeric
+Gram/NumNoAbbr !!≈ * **@CODE@**: Transitive abbreviations for which numerals
!! are complements and normal words. The abbreviation usage
!! is less common and thus only the occurences in the middle of
!! the sentence can be considered as true cases.
+Gram/TIAbbr !!≈ * **@CODE@**: Both transitive and intransitive abbreviation
+Gram/IAbbr !!≈ * **@CODE@**: Intransitive abbreviation (it takes no argument)
!! ## Non-changing letters
a2 !!≈ * @CODE@ invariant a
g2 i2 j2 t2 v2 !!≈ * @CODE@ invariant g, i, j, t, v
a3 !!≈ * @CODE@ This is for a special a Umlaut case a3:ø (normal: a:o)
+v1 +v2 !!≈ * @CODE@ : different paradigms ,
!! ## Triggers for Morphophonology
%^UUML %^IUML %^eIUML %^ØUML !!≈ * @CODE@ : Umlaut types ,
%^W %^JI !!≈ * @CODE@ : Cns changes ,
%^EPH %^OEA !!≈ * @CODE@ : Epenthesis, ,
%^GDEL %^GGDEL %^GVDEL %^VDEL %^JDEL %^RDEL !!≈ * @CODE@ : Cns deletion triggers,
%^EIO %^OA %^WVV %^EDH %^VSH !!≈ * @CODE@ : TODO ,
%^AB1 %^AB2 %^AB3 %^AB4 %^AB5 %^AB6 %^AB7 !!≈ * @CODE@ : Ablaut series ,
%^aAB %^uAB !!≈ * @CODE@ : More Ablaut ,
%^NGKK !!≈ * @CODE@ : NG to KK ,
%^PASS !!≈ * @CODE@ : todo ,
%> !!≈ * @CODE@ : Suffix boundary ,
+v1 !!≈ * **@CODE@** - Paradigm identifier (e.g. gera+v1 = ger)
+v2 !!≈ * **@CODE@** - Paradigm identifier (e.g. gera+v2 = gerar)
!! Language tags
+OLang/ENG !!≈ * @CODE@
+OLang/FIN !!≈ * @CODE@
+OLang/NNO !!≈ * @CODE@
+OLang/NOB !!≈ * @CODE@
+OLang/RUS !!≈ * @CODE@
+OLang/SMA !!≈ * @CODE@
+OLang/SME !!≈ * @CODE@
+OLang/SWE !!≈ * @CODE@
+OLang/UND !!≈ * @CODE@
!! ## Non-ascii letters, perhaps needed as multichar symbols
æ ø å !!≈ * @CODE@
á é í ó ú ý Á É Í Ó Ý !!≈ * @CODE@
ä ö ü Ä Ö Ö !!≈ * @CODE@
!! ## Compounding tags
!! The tags are of the following form:
!! * **+CmpNP/xxx** - Normative (N), Position (P), ie the tag describes what
!! position the tagged word can be in in a compound
!! * **+CmpN/xxx** - Normative (N) **form** ie the tag describes what
!! form the tagged word should use when making compounds
!! * **+Cmp/xxx** - Descriptive compounding tags, ie tags that *describes*
!! what form a word actually is using in a compound
!! This entry / word should be in the following position(s):
+CmpNP/All !!≈ * **@CODE@** - ... in all positions, **default**, this tag does not have to be written
+CmpNP/First !!≈ * **@CODE@** - ... only be first part in a compound or alone
+CmpNP/Pref !!≈ * **@CODE@** - ... only **first** part in a compound, NEVER alone
+CmpNP/Last !!≈ * **@CODE@** - ... only be last part in a compound or alone
+CmpNP/Suff !!≈ * **@CODE@** - ... only **last** part in a compound, NEVER alone
+CmpNP/None !!≈ * **@CODE@** - ... does not take part in compounds
+CmpNP/Only !!≈ * **@CODE@** - ... only be part of a compound, i.e. can never
!! be used alone, but can appear in any position
+Cmp/Hyph
!! ## Usage tags
+Use/Disamb !!≈ * @CODE@ = Use only in disambiguator/tokeniser analyser
+Use/Circ !!≈ * @CODE@ = for compound restrictions
+Use/PMatch !!≈ * **@CODE@** means that the following is only used in the analyser feeding the disambiguator. This is missing.
+Use/-PMatch !!≈ * @CODE@
+Use/-Spell !!≈ * @CODE@
+Use/NG !!≈ * @CODE@
+Use/NGA !!≈ * @CODE@
+Use/SpellNoSugg !!≈ * @CODE@
+Use/GC !!≈ * **@CODE@** only retained in the HFST Grammar Checker disambiguation analyser
+Use/TTS !!≈ * **@CODE@** – **only** retained in the HFST Text-To-Speech disambiguation tokeniser
+Use/-TTS !!≈ * **@CODE@** – **never** retained in the HFST Text-To-Speech disambiguation tokeniser
+Err/Guess !!≈ * @CODE@ : Tag for Name Guesser component
+Err/Orth !!≈ * @CODE@ : Marking forms that are orthographical errors
+Err/Hyph !!≈ * @CODE@
+Err/Lex !!≈ * @CODE@
+Err/SpaceCmp !!≈ * @CODE@
+Err/MissingSpace !!≈ * @CODE@
!! ## Symbols that need to be escaped on the lower side (towards twolc):
!! Todo: Check whether these can be removed. They are probably obsolete.
»7 !!≈ * @CODE@ : Literal »
«7 !!≈ * @CODE@ : Literal «
!! ```
%[%>%] !!≈ @CODE@ - Literal >
%[%<%] !!≈ @CODE@ - Literal <
!! ```
!! ## Flag diacritics
!! We have manually optimised the structure of our lexicon using following
!! flag diacritics to restrict morhpological combinatorics - only allow compounds
!! with verbs if the verb is further derived into a noun again:
@P.NeedNoun.ON@ !!≈ | @CODE@ | (Dis)allow compounds with verbs unless nominalised
@D.NeedNoun.ON@ !!≈ | @CODE@ | (Dis)allow compounds with verbs unless nominalised
@C.NeedNoun@ !!≈ | @CODE@ | (Dis)allow compounds with verbs unless nominalised
!! ### Flags for speller suggestions
@D.ErrOrth.ON@ !!≈ | @CODE@
@C.ErrOrth@ !!≈ | @CODE@
@P.ErrOrth.ON@ !!≈ | @CODE@
@R.ErrOrth.ON@ !!≈ | @CODE@
!! ### Flag for case harmony in compounds
!! Set flag for compounds
!! | Flag | Example word
!! | ---- | ----
@P.Case.MscNom@ !!≈ | @CODE@ | fyrstiflokkur
@P.Case.MscObl@ !!≈ | @CODE@ | fyrstaflokk
@P.Case.FemNom@ !!≈ | @CODE@ | lítlasystir
@P.Case.FemObl@ !!≈ | @CODE@ | lítluusystur
@P.Case.Neu@ !!≈ | @CODE@ | breiðaskarð
@P.Case.Pl@ !!≈ | @CODE@ | fyrstuflokkar, lítlusystrar, breiðuskørð
!! Control flag values for compounds
!! | Flag | Example word
!! | ---- | ----
@R.Case.MscNom@ !!≈ | @CODE@ | fyrstiflokkur
@R.Case.MscObl@ !!≈ | @CODE@ | fyrstaflokk
@R.Case.FemNom@ !!≈ | @CODE@ | lítlasystir
@R.Case.FemObl@ !!≈ | @CODE@ | lítluusystur
@R.Case.Neu@ !!≈ | @CODE@ | breiðaskarð
@R.Case.Pl@ !!≈ | @CODE@ | fyrstuflokkar, lítlusystrar, breiðuskørð
!! Control flag values for compounds
!! | Flag | Example word
!! | ---- | ----
@U.Case.MscNom@ !!≈ | @CODE@ | fyrstiflokkur
@U.Case.MscObl@ !!≈ | @CODE@ | fyrstaflokk
@U.Case.FemNom@ !!≈ | @CODE@ | lítlasystir
@U.Case.FemObl@ !!≈ | @CODE@ | lítluusystur
@U.Case.Neu@ !!≈ | @CODE@ | breiðaskarð
@U.Case.Pl@ !!≈ | @CODE@ | fyrstuflokkar, lítlusystrar, breiðuskørð
!! Flag diacritic look-alikes for grammar checker & tokenisation purposes
!! | Flag | Explanation
!! | ---- | ----
@P.Pmatch.Loc@ !!≈ | @CODE@ | Location in string used or parsed by hfst-pmatch
@P.Pmatch.Backtrack@ !!≈ | @CODE@ | Also for hfst-pmatch
!! ### Flags for compound restriction
!! For languages that allow compounding, the following flag diacritics are needed
!! to control position-based compounding restrictions for nominals. Their use is
!! handled automatically if combined with +CmpN/xxx tags. If not used, they will
!! do no harm.
!! | Flag | Explanation
!! | ---- | ----
@P.CmpFrst.FALSE@ !!≈ | @CODE@ | Require that words tagged as such only appear first
@D.CmpPref.TRUE@ !!≈ | @CODE@ | Block such words from entering ENDLEX
@P.CmpPref.FALSE@ !!≈ | @CODE@ | Block these words from making further compounds
@D.CmpLast.TRUE@ !!≈ | @CODE@ | Block such words from entering R
@D.CmpNone.TRUE@ !!≈ | @CODE@ | Combines with the next tag to prohibit compounding
@U.CmpNone.FALSE@ !!≈ | @CODE@ | Combines with the prev tag to prohibit compounding
@P.CmpOnly.TRUE@ !!≈ | @CODE@ | Sets a flag to indicate that the word has passed R
@D.CmpOnly.FALSE@ !!≈ | @CODE@ | Disallow words coming directly from root.
!! Use the following flag diacritics to control downcasing of derived proper
!! nouns (e.g. Finnish Pariisi -> pariisilainen). See e.g. North Sámi for how to use
!! these flags. There exists a ready-made regex that will do the actual down-casing
!! given the proper use of these flags.
@U.Cap.Obl@ !!≈ | @CODE@ | Allowing downcasing of derived names: deatnulasj.
@U.Cap.Opt@ !!≈ | @CODE@ | Allowing downcasing of derived names: deatnulasj.
! ============ !
! Root lexicon !
! ============ !
LEXICON Root
!! # Lexicon @LEXNAME@
!! This is the beginning of everything. The **@LEXNAME@** lexicon is reserved in the
!! LexC language, and must be the first lexicon defined.
Nouns ; !!≈ * @CODE@
Shortnouns ; !!≈ * @CODE@ 1- and 2-letter nouns excluded from compounding
Propernouns ; !!≈ * @CODE@
Adjectives ; !!≈ * @CODE@
Shortadjectives ; !!≈ * @CODE@
Verbs ; !!≈ * @CODE@
Adverb ; !!≈ * @CODE@
Conjunction ; !!≈ * @CODE@
Subjunction ; !!≈ * @CODE@
Interjection ; !!≈ * @CODE@
Numeral ; !!≈ * @CODE@
Determiner ; !!≈ * @CODE@
Pronoun ; !!≈ * @CODE@
Preposition ; !!≈ * @CODE@
Punctuation ; !!≈ * @CODE@
Symbols ; !!≈ * @CODE@
Abbreviation ; !!≈ * @CODE@
Acronyms ; !!≈ * @CODE@
LEXICON Acronyms
!! Lexicon @LEXNAME@ is split in two:
Acronym-fao ; !!≈ * @CODE@ for fao acronyms
Acronym-smi ; !!≈ * @CODE@ for language independent acronums
LEXICON ENDLEX
!! # Lexicon @LEXNAME@
!! And this is the @LEXNAME@ of everything:
!! ```
@D.CmpOnly.FALSE@@D.CmpPref.TRUE@@D.NeedNoun.ON@ ENDLEX2 ; !!≈ @CODE@
! @D.Need3Part.ON@ # ; !3part
!! ```
!! The `@D.CmpOnly.FALSE@` flag diacritic is ued to disallow words tagged
!! with +CmpNP/Only to end here.
!! The `@D.NeedNoun.ON@` flag diacritic is used to block illegal compounds.
LEXICON ENDLEX2
# ;
! @R.SpellRlx.ON@+Err/Spellrelax@C.SpellRlx@:@R.SpellRlx.ON@@C.SpellRlx@ ENDLEX3 ;
! @D.SpellRlx.ON@@C.SpellRlx@ ENDLEX3 ;
! LEXICON ENDLEX3
! @R.SpaceCmp.ON@+Err/SpaceCmp@C.SpaceCmp@:@R.SpaceCmp.ON@@C.SpaceCmp@ # ;
! @D.SpaceCmp.ON@@C.SpaceCmp@ # ;
! vim: set ft=xfst-lexc: