-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapertium-grc.grc.twol
190 lines (146 loc) · 4.51 KB
/
apertium-grc.grc.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
Alphabet
Α Β Γ Δ Ε Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο Π Ρ Σ Τ Υ Φ Χ Ψ Ω
α β γ δ ε ζ η θ ι κ λ μ ν ξ ο π ρ σ τ υ φ χ ψ ω
ς
ᾳ ῃ ῳ
ϊ ϋ
Ἀ Ἐ Ἠ Ἰ Ὀ Ὠ
ἀ ἐ ἠ ἰ ὀ ὐ ὠ
Ἁ Ἑ Ἡ Ἱ Ὁ Ὑ Ὡ
ἁ ἑ ἡ ἱ ὁ ὑ ὡ
Ῥ ῥ
! pass these through to the stress twol file
%{'%} %{'%!%} %{%~%} %{%+long%} %{%-long%} %{clt%}
%{%+longd%}:0 %{%+longd%}:υ %{%+longd%}:%{%+long%}
%{%+longs%}:0
%{σ%}:0 %{σ%}:σ
%{ε%}:ε %{ε%}:0
%{'%?%}:0 %{'%?%}:%{'%} %{%~%?%}:0 %{%~%?%}:%{%~%} %{'%$%}:0
%{%(ν%)%}:0 %{%(ν%)%}:ν
%{%+%}
%{redup%}:0
%{%|%}:0
%{μ%}:μ
%{%-%}:0
%{g%+%}:0 %{g%-%}:0
%{οω%}:ο %{οω%}:ω
%{εη%}:ε %{εη%}:η
;
Sets
Vowel = Α Ε Η Ι Ο Υ Ω
α ε η ι ο υ ω
ᾳ ῃ ῳ
ϊ ϋ ;
Consonant = Β Γ Δ Ζ Θ Κ Λ Μ Ν Ξ Π Ρ Σ Τ Φ Χ Ψ
β γ δ ζ θ κ λ μ ν ξ π ρ σ τ φ χ ψ
Ῥ ῥ ς ;
Dental = Τ Δ Θ
τ δ θ ;
LabVel = π β φ κ γ χ ;
LabVelSig = ψ ψ ψ ξ ξ ξ ;
Mod = %{g%-%} %{g%+%} %{'%?%} %{%+longs%} ;
Rules
"augment is ε only before consonants"
%{ε%}:ε <=> _ :Consonant ;
"α → η"
α:η <=> _ ( %{'%} | %{'%?%}: ) [ %{%+longs%}: ] ;
%{ε%}: _ ;
"ε → η"
ε:η <=> _ ( %{'%} | %{'%?%}: ) [ %{%+long%}: | %{%+longs%}: ] ;
%{ε%}: _ ;
except %{ε%}: _ [ υ | ὐ | ὑ ] ;
"ο → ω"
ο:ω <=> _ ( %{'%} | %{'%?%}: ) [ %{%+long%}: | %{%+longs%}: ] ;
%{ε%}: _ ;
"aug + vowel with breathing"
Vx:Vy <=> %{ε%}:0 _ ;
where Vx in ( ἀ ἁ ἐ ἑ ὀ ὁ )
Vy in ( ἠ ἡ ἠ ἡ ὠ ὡ )
matched ;
"preposition before augment"
Vx:0 <=> Consonant _ %{ε%}: ;
where Vx in ( α ι ο ) ;
"{ε}ῥ → ερρ 1"
0:ρ <=> %{ε%}: ῥ:ρ _ ;
"{ε}ῥ → ερρ 2"
ῥ:ρ <=> %{ε%}: _ ;
"εκ → εξ before {ε}"
κ:ξ <=> _ %{ε%}: ;
"ο {+longd} -> ου"
%{%+longd%}:υ <=> ο _ ;
"{+long} -> 0"
%{%+long%}:0 <=> [ ε:η | ο:ω ] ( %{'%} | %{'%?%}: ) _ ;
%{%+long%}: _ ;
[ ο | ε ] υ ( %{'%?%}: | %{'%} ) _ ;
ω _ ;
"ε' -> ει' after {+longd}"
0:ι <=> ε _ %{'%} %{%+longd%}:0 ;
"ε' -> ει' after {+longd} part 2"
%{%+longd%}:0 <=> 0:ι %{'%} _ ;
ω _ ;
"{+longd} -> {+long}"
%{%+longd%}:%{%+long%} <=> α _ ;
"η + ι part 1"
η:ῃ <=> _ %{σ%}:0 ι:0 ;
"η + ι part 2"
ι:0 <=> η:ῃ %{σ%}:0 _ ;
"inserting noun acute stress marker"
%{'%?%}:%{'%} <=> _ ?* %{'%$%}:0 ;
"inserting noun circumflex stress marker"
%{%~%?%}:%{%~%} <=> _ ?* %{'%$%}:0 ;
except %{'%?%}: ?* _ ;
"reduplication"
%{redup%}:Cx <=> _ [ %{ε%}: | ι ] Cy ;
where Cx in ( β γ δ τ κ λ μ ν π σ τ π κ )
Cy in ( β γ δ θ κ λ μ ν π σ τ φ χ )
matched ;
"no final μ"
μ:ν <=> _ .#. ;
"no final dental or before σ"
Cx:0 <=> _ Mod:* .#. ;
_ Mod:* [ :σ | :ς | σ: | ς: ] ;
where Cx in Dental ;
"ζ also deletes before σ and κ"
ζ:0 <=> _ Mod:* [ :σ | :ς | σ: | ς: | κ ] ;
"ζθ → σθ"
ζ:σ <=> _ Mod:* θ ;
"{σ} deletes between vowels"
%{σ%}:0 <=> Vowel: _ Vowel: ;
"assimilation"
Cx:Cy <=> _ Cz ;
where Cx in ( π π β β φ φ κ κ γ γ χ χ )
Cy in ( β φ π φ π β γ χ κ χ κ γ )
Cz in ( δ θ τ θ τ δ δ θ τ θ τ δ )
matched ;
"stop before sigma part 1"
Cx:Cy <=> _ Mod:* ( Dental:0 ) Mod:* [ σ:0 | ς:0 ] ;
where Cx in LabVel
Cy in LabVelSig
matched ;
"stop before sigma part 2a"
σ:0 <=> Cx:Cy Mod:* ( Dental:0 ) Mod:* _ ;
where Cx in LabVel
Cy in LabVelSig
matched ;
"stop before sigma part 2b"
ς:0 <=> Cx:Cy Mod:* ( Dental:0 ) Mod:* _ ;
where Cx in LabVel
Cy in LabVelSig
matched ;
"vowel gradation 1"
%{οω%}:ω <=> _ ?* %{g%+%}:0 ;
"vowel gradation 2"
%{εη%}:η <=> _ ?* %{g%+%}:0 ;
"Euphonic change in perfect mid/pass participle"
Cx:Cy <=> _ %{μ%}:μ ;
where Cx in ( π β φ τ δ ζ ν κ χ )
Cy in ( μ μ μ σ σ σ σ γ γ )
matched ;
"{-} cancels {+}"
%{%+%}:0 <=> %{%-%}:0 ?* _ ;
! 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