-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathipa.lark
235 lines (216 loc) · 3.76 KB
/
ipa.lark
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
// IPA transcription
transcription: syllables
| group
| segments
| phonetic
| phonemic
// bracketed types
phonetic: "[" (syllables | group | segments) "]"
phonemic: "/" (syllables | group | segments) "/"
// segmental sequences
group: major+ | minor+
major: minor+ "‖"
minor: syllables+ "|" | syllables+
syllables: [TONESTEP] [STRESS] syllable ([TONESTEP] [suprasegmental] syllable)*
segments: [STRESS] segment+ (suprasegmental segment+)*
// syllables
syllable: onset rime RIGHTTONECONTOUR | LEFTTONECONTOUR onset rime | onset tonalrime | onset rime
tonalrime: tonalnucleus coda
tonalnucleus: (vowel* (tonalvowel | syllabic TONEMARK [LENGTH])+ vowel*)+
rime: nucleus coda
nucleus: (vowel+ | (syllabic [LENGTH])+)+
coda: consonant*
onset: consonant*
// segmentals
segment: (consonant | vowel | syllabic [TONEMARK] [LENGTH] | tonalvowel)+
tonalvowel: tonemarkedv | tonaldipthong
tonaldipthong: tonemarkedv DOUBLEBREVE tonemarkedv
| tonemarkedv DOUBLEBREVE V [vfeatures] [LENGTH]
| V [vfeatures] [LENGTH] DOUBLEBREVE tonemarkedv
tonemarkedv: V [vfeatures] TONEMARK [vfeatures] [LENGTH]
vowel: V [vfeatures] [LENGTH] | dipthong
consonant: C [cfeatures] | affricate
dipthong: V [vfeatures] [LENGTH] DOUBLEBREVE V [vfeatures] [LENGTH]
affricate: C [cfeatures] DOUBLEBREVE C [cfeatures]
DOUBLEBREVE: ("\u035c" | "\u0361")
// suprasegmentals
suprasegmental: STRESS | BREAK | LINK
STRESS: "ˈ" | "ˌ"
BREAK: "."
LINK: "‿"
// length modifiers
LENGTH: "ː" | "ˑ" | "\u0306"
// consonant features
// the explicit permutations of (" ̩" | " ̍") with other features is annoying
// but, it's intended to separate syllabic consonants from nonsyllabic ones
syllabic: C SYLLABICMARK NONSYLLABIC* vfeatures*
| C NONSYLLABIC* SYLLABICMARK vfeatures*
| C NONSYLLABIC* vfeatures* SYLLABICMARK
| C SYLLABICMARK vfeatures* NONSYLLABIC*
| C vfeatures* SYLLABICMARK NONSYLLABIC*
| C vfeatures* NONSYLLABIC* SYLLABICMARK
cfeatures: (cfeature | XFEATURE)+
cfeature: NONSYLLABIC | SYLLABICMARK
SYLLABICMARK: "\u0329" | "\u030D"
NONSYLLABIC: "ʰ"
| "ʲ"
| "ʷ"
| "ˠ"
| "ˡ"
| "ˢ"
| "ˤ"
| "\u031a"
| "\u0325"
| "\u0329"
| "\u032a"
| "\u032c"
| "\u0334"
| "\u033a"
| "\u033b"
| "\u033c"
| "\u207f"
| XFEATURE
// vowel features
vfeatures: (VFEATURE | XFEATURE)+
VFEATURE: "˞"
| "\u02d4"
| "\u02d5"
| "\u0303"
| "\u0308"
| "\u0318"
| "\u0319"
| "\u031c"
| "\u031d"
| "\u031e"
| "\u031f"
| "\u0320"
| "\u032f"
| "\u0339"
| "\u033d"
// tones
TONEMARK: "\u0300"
| "\u0301"
| "\u0302"
| "\u030b"
| "\u030c"
| "\u030f"
| "\u1dc4"
| "\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