/
apertium-hyw.hyw.twol
224 lines (172 loc) · 8.38 KB
/
apertium-hyw.hyw.twol
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
Alphabet
ա ե է ը ո օ ի լ
բ գ դ զ թ ժ խ ծ կ հ ձ ղ ճ մ յ ն շ չ պ ջ ռ ս վ տ ր ց ւ փ ք ֆ
Ա Ե Է Ը Ո Օ Ի Լ
Բ Գ Դ Զ Թ Ժ Խ Ծ Կ Հ Ձ Ղ Ճ Մ Յ Ն Շ Չ Պ Ջ Ռ Ս Վ Տ Ր Ց Ւ Փ Ք Ֆ
՚ !apostrophe
՛ !exclamation mark in imperatives
%
%{G1%}:ը %{G2%}:%
%{ThAյ%}:0
%{լ%}:լ
%{ProhPl%}:0 %{ImpSg%}:0 %{Aor%}:0 %{Impf%}:0 %{Pres3SG%}:0 %{Pres2PL%}:0
%{PossPlի%}:ի ! The plural possessive generally surfaces with ի unless before a vowel
%{SpurPlե%}:0 ! Spurious plural is deleted unless after monosyllables
%{SpurPlր%}:0
%{defն%}:ը ! for definite allomorphy ն-ը; i assume easier default is ը
%{Plն%}:ն !for plural allomorphy եր ներ; I assume easier default is polysyllabic ներ
%{Ninfl%}:0 ! Boundary between noun and inflection
%{NinflRed%}:0 ! Boundary between noun and inflection, for obligatory reduction
%{NinflRedForcedNer%}:0 ! Boundary between noun and -ner suffix, obligatory reduction in some lexemes
%{mono%}:0 ! This is boundary before a monosyllabic root to trigger the right plural
;
Sets
Vowel = ա ե է ը ո օ ի
Ա Ե Է Ը Ո Օ Ի ;
Cons = բ գ դ զ թ ժ լ խ ծ կ հ ձ ղ ճ մ յ ն շ չ պ ջ ռ ս վ տ ր ց ւ փ ք ֆ
Բ Գ Դ Զ Թ Ժ Լ Խ Ծ Կ Հ Ձ Ղ Ճ Մ Յ Ն Շ Չ Պ Ջ Ռ Ս Վ Տ Ր Ց Ւ Փ Ք Ֆ
;
!Noun-infl boundaries
GeneralNInflBoundary = %{Ninfl%} %{NinflRed%} ;
!Summary of contexts ե theme vowel becomes է
JeToE = %{ProhPl%} %{Pres3SG%} %{ImpSg%} %{Impf%} %{Pres2PL%}
;
! Some contexts where ի theme vowel becomes է
IToE = %{ImpSg%} %{Impf%}
;
! Some contexts where ի theme vowel becomes ե
IToJe = %{Aor%}
;
! Summary of contexts where ա theme vowel becomes այ
AtoAJ = %{Pres3SG%}
;
Definitions
FullVowel = [ :ա | :ե | :է | :ո | :օ | :ի | :ո :ւ |
:Ա | :Ե | :Է | :Ո | :Օ | :Ի | :Ո :Ւ ]
;
RealVowel = [ FullVowel | :ը | :Ը ];
RealVowelUR = [ ա: | ե: | է: | ո: | օ: | ի: | ո: ւ: | ը: |
Ա: | Ե: | Է: | Ո: | Օ: | Ի: | Ո: Ւ: | Ը:]
;
! For finding monosyllables, I have to specify monosyllabic words with schwa
! because of conflicts with vowel reduction
! Also has to reference underlyng segments because of conflicts with other rules
MonosyllableWithoutSchwa = .#. (Cons: (յ:)) RealVowelUR (Cons: (Cons:)) (ք:) ;
MonosyllableWithSchwa = .#. Cons: (Cons:) (Cons:) ;
Monosyllable = [ MonosyllableWithoutSchwa | MonosyllableSchwa ];
;
Rules
!!!!! AFFIX ALLOMORPHY
!Indicative prefix /կ{G1}{G2}/ is [կը ] before C's and [կ'] before V's
!Complication is that ու is a vowel while ոX is not
"For G1, prefix կ{G1}{G2} to [կ՚] before a vowel"
%{G1%}:՚ <=> _ %{G2%}: [ [ :Vowel - :ո ] | :ո :ւ ] ;
"For G2, prefix կ{G1}{G2} to կ՚ before a vowel"
%{G2%}:0 <=> _ [ [ :Vowel - :ո ] | :ո :ւ ] ;
!"For G1, prefix կ{G1}{G2} to [կը ] before a consonant"
!%{G1%}:ը <=> _ %{G2%}: [ [ :Cons ] | [ :ո - [ :ո :ւ ] ] ] ;
!"For G2, prefix կ{G1}{G2} to [կը ] before a consonant"
!%{G2%}:% <=> _ [ [ :Cons ] | [ :ո - [ :ո :ւ ] ] ] ;
!!!! GLIDE EPENTHESIS
!The glide յ is added between the ա theme vowel and pres3sg + imperfective-i
"The glide յ between the ա theme vowel and before 3sg: /ա{ThAյ}Pres/ -> [այ]"
%{ThAյ%}:յ <=> ա: _ [ %{Pres3SG%}: | %{Impf%}: :ի ] ;
!!! Imperative exclamation point
!Some irregular verbs have a C-final imperative, but the exlamation mark is inside the verb
!This will metathesize the exclamation mark in this contetx
!It only works for verbs like բերել -- the very լալ has a cheat in the lexd
"delete the exclamation mark when it follows a consonant"
՛:0 <=> :Cons _ ;
"add an exclamation mark after an irregular imperative verb's final vowel"
0:՛ <=> FullVowel _ :Cons* :Cons ՛:0 ;
!!!!! THEME VOWEL CHANGES
!In many contexts, the ի theme vowel becomes է
! These contexts are part of IToE
"theme vowel /իIToE/ to [է]"
ի:է <=> _ IToE: ;
!!In many contexts, the ե theme vowel becomes է
! These contexts are part of JeToE
"theme vowel /ե{JeToE}/ to [է]"
ե:է <=> _ JeToE: ;
!In some contexts, the ի theme vowel becomes ե
! These contexts are part of IToJe
"theme vowel /իIToJe}/ to [ե]"
ի:ե <=> _ IToJe: ;
!When there's a full vowel after the infinitival, the ի theme vowel becomes ե
!Needed finessing in order to apply across zero morphs and consonants liek նի
"theme vowel /ի{լ}V/ to [ե]"
ի:ե <=> _ %{լ%}: [ :0 | :Cons ]* FullVowel ;
!When there's a full vowel after the infinitival, the ու theme vowel becomes ե
"theme vowel /ու/ to [ե]"
ո:ե <=> _ ւ:0 %{լ%}: [ :0 | :Cons ]* FullVowel ;
"theme vowel /ու/ to [ե]"
ւ:0 <=> _ %{լ%}: [ :0 | :Cons ]* FullVowel ;
!!!!!!!!!!!!!!!!!!!!!!
!!! Noun allomorphy
! For definite allomorphy, the input definite suffix is %{defն%}
! It's a ը after consonants, and ն after vowels
! Need the :0* context because of deleted glides
"definite suffix is ն after vowels"
%{defն%}:ն <=> RealVowel :0* _ ;
! For plural allomorphy, the input plural suffix is %{Plն%}եր
! The rule will drop %{Plն%} after monosyllables, defined roughty as maximally CJVCCk
!The suffix is -er also after monosyllabic-headed compounds
!I assume that the right compounds end in a {mono} diacritic
"plural suffix is եր after monosyllables and after monosyllabic-headed compounds"
%{Plն%}:0 <=> Monosyllable :0* _ ;
%{mono%}: :0* _ ;
! For plural possessive allomorphy, there is a fake plural suffix եր if after monosyllable
! The rule will turn the relevant diacritics into the plural suffix
!Same for compounds with monosyllabic head
"spurious plural suffix is եր after monosyllables and mono-head compounds: for ե"
%{SpurPlե%}:ե <=> Monosyllable :0* _ ;
%{mono%}: :0* _ ;
"spurious plural suffix is եր after monosyllables and mono-head compounds: for ր"
%{SpurPlր%}:ր <=> Monosyllable :0* %{SpurPlե%}:ե _ ;
%{mono%}: :0* %{SpurPlե%}:ե _ ;
! For plural possessive allomorphy, the suffix loses ի before a vowel
"Delete the vowel ի of the plural possessive before a vowel է ո ի "
%{PossPlի%}:0 <=> _ [:է | :ո | :ի ];
!!!!!!!!!!!!!!!!
!!!! Destressed reduction
! In nouns, if the last stem vowel is ի or ու, then it is deleted in the orthography if
! It precedes a vowel-initial inflectional suffix
! I capture that by using a morpheme boundary %{NinflRed%} that's only found
! between nouns and inflection for reduction
"Delete ի if before a vowel-initial suffix, with 1 or more consonants between them; can be forced before -ner in some lexemes"
ի:0 <=> _ :Cons :Cons* (:0)* %{NinflRed%}: (:0)* FullVowel ;
_ :Cons :Cons* (:0)* %{NinflRedForcedNer%}: ;
"Delete ու if before a vowel-initial suffix, with 1 or more consonants between them (part 1); can be forced before -ner in some lexemes"
ո:0 <=> _ ւ: :Cons :Cons* (:0)* %{NinflRed%}: (:0)* FullVowel ;
_ ւ: :Cons :Cons* (:0)* %{NinflRedForcedNer%}: ;
"Delete ու if before a vowel-initial suffix, with 1 or more consonants between them (part 2); can be forced before -ner in some lexemes"
ւ:0 <=> ո: _ :Cons :Cons* (:0)* %{NinflRed%}: (:0)* FullVowel ;
ո: _ :Cons :Cons* (:0)* %{NinflRedForcedNer%}: ;
!!!!!!!!!
!! glide deletion in nouns
! The glide յ is deleted when a) it follows ա or ո, b) it's before nominal suffixes
! and c) the suffix is consonantal-initial
! But not for monosyllabic nouns
! It's deleted before definite suffix
"Delete glide յ in the context ա/ո _ C-initial suffix "
յ:0 <=> :ա _ :0* GeneralNInflBoundary: :0* :Cons ;
:ա _ :0* GeneralNInflBoundary: :0* %{defն%}: ;
:ո _ :0* GeneralNInflBoundary: :0* :Cons ;
:ո _ :0* GeneralNInflBoundary: :0* %{defն%}: ;
except
Monosyllable :0* _ ;
!! glide epenthesis in nouns
! The glide յ is added when a) it follows ա , b) it's before nominal suffixes
! and c) the suffix is vowel-initial
! It's absent before definite suffix
"Insert glide յ in the context ա _ V-initial suffix "
0:յ <=> :ա _ :0* GeneralNInflBoundary: :0* RealVowelUR ;
except
Monosyllable :0* _ ;
! :ա _ :0* GeneralNInflBoundary: :0* %{defն%}: ;
! Resources:
! http://wiki.apertium.org/wiki/Starting_a_new_language_with_HFST#Enter_twol
! https://kitwiki.csc.fi/twiki/bin/view/KitWiki/HfstHome
! https://github.com/hfst/
! http://wiki.apertium.org/wiki/Twol
! http://wiki.apertium.org/wiki/Hfst