-
Notifications
You must be signed in to change notification settings - Fork 7
/
igcheck
591 lines (424 loc) · 21.1 KB
/
igcheck
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
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
#!/bin/bash
## This shell script checks a list of words for potential
## spelling problems. It is provided for your hacking pleasure.
##
## It is designed to work with a raw list of words, one per line.
## % igcheck <wordlist>
##
## Uncomment the last couple of lines if you have time to browse
## through the (usually legal) violations of
## "broad with broad", "slender with slender"
if [ $# -ne 1 ]
then
echo "Usage: igcheck <WORDLIST>"
exit 1
fi
LIOSTA="${1}"
# pass three args;
# human readable test description, regex to match,
# and regex of permitted exceptions
find_pattern()
{
cat "${LIOSTA}" | sed 's/\/[A-Z]*$//' | egrep "${2}" | egrep -v "${3}" | sed "s/^/Error in ${LIOSTA} (${1}): /"
}
### ODD LETTERS
find_pattern 'non-alphabetic character' "[^a-zA-ZáéíóúÁÉÍÓÚ'-]" '^a$'
### LENITION and VOWELS
find_pattern 'weird h' '[aeiouáéíóúhjlnrvxz]h' '([aeiouáéíóú]h[aeiouáéíóú]|Fh?aranhaít|^g?Ch?óbanhávan|fh?orhalla|gh?ealhata|unnailheicsiam|ch?úlhaist|ainhidr|sh?eanhalla|sh?árheitridín|sh?eanhata|Úna-Minh|Ardalhaidh)'
find_pattern 'weird lenited s' 'sh[^aeiouáéíóúlnr]' '^a$'
## check for eclipsis and lenition of same consonant
## so it suffices to check m?bh? later...
find_pattern 'unexpected mbh' 'm[bB]h' "^(([bdm]'|h|[nt]-)?(io?mbh|ainmbhranda)|d?th?r[ao]mbh|g?ch?ambh|([bdm]'|bh)?fh?uaimbhai?c|lombh|gh?ormbhá)"
find_pattern 'unexpected ndh' 'n[dD]h' '(fh?lanndhe[ai]rg([ae])?$|^d?th?eanndháileoi?g)'
find_pattern 'unexpected bph, tsh, or dth' '(b[pP]|t[sS]|d[tT])h' '^a$'
find_pattern 'unexpected initial gch, ngh, or bhfh' '^(g[cC]|n[gG]|bh[fF])h' '^a$'
find_pattern 'repeated letter other than l,n,r' '([^lnr])\1' '(sh?núúi?l|Liammóir|gCopaleen)'
find_pattern 'lll,nnn, or rrr' '([lnr])\1\1'
find_pattern 'same vowel twice, one with fada one without' '(aá|áa|eé|ée|ií|ií|oó|óo|uú|úu)'
# diphthongs and triphthongs
find_pattern 'strange diphthong _e' '([iouáíóú][eé]|aé)' '^(bhuel|hiéana|t?sh?ubpoena)'
find_pattern 'strange diphthong _u' '[aeoáéíó]u'
find_pattern 'strange diphthong _a' '[íoóú][aá]' '(iúái?l|^(n?Gh?úam|sh?eampú|m?bh?uíá|g?ch?ó[aá]|reoá|t?sh?aíá|d?th?íái?l))'
find_pattern 'strange diphthong _ú' '[aáeéoó]ú' '^(m?bh?áú|g?ch?réú|n?dh?óú|n?gh?laeú|naoú|neamhbháú|t?sh?éú|t?sh?óú)'
find_pattern 'strange diphthong _ó' '[aáéíú]ó' '^(m?bh?uíó|n?dh?laíó|mh?éóis|réó|m?Bh?éóitia|mh?íóipe$)'
find_pattern 'strange diphthong; assorted' '(eí|é[áío]|[áuú]o)'
find_pattern 'strange triphthong' '[aeiouáéíóú][aeiouáéóú][aeouáéíóú]' "(uaí|iúá|^(([bdm]'|h|[nt]-)?aeó|n?gh?lae|hiéan|náia|naoú|b?ph?aranóia|reoá|s[pt]raeá))"
find_pattern 'strange triphthong' '(eó|éa|io|iu|ío|uó)i' "(uóige|^(([bdm]'|h|[nt]-)?aeóin|n?gh?iuirl|sciuir))"
find_pattern 'strange triphthong' '[aouáóú]íú' '(gh?naíú|^(buí|g?ch?roíú|dlaíó|saíá|spraíú))'
## Initial position
find_pattern 'unexpected consonant cluster at start' '^[bcdfghlmnprt]h?[bcdfgmnpst]' '^(b(p|hf)|[cgt]h?n|gc|mb|n[dg]|ts|dt|mh?ná$)'
# this one includes "no initial ll,nn,rr"!
find_pattern 'unexpected consonant cluster at start' '^(s[bdg]|[lmnr][lr]|nn|ps)' '^a$'
find_pattern 'unexpected combo starting with e' '^e[^aiouáíóú]' '^a$'
## Terminal position
find_pattern 'unexpected consonant cluster at end' '[bcdfghmpst][bcdfglmnprs]$' '(sc|dh[a-z]|[ptc]s|ai?sp|iamb|mp|t.*ghd)$'
find_pattern 'unexpected combination with h at end' '[^bcdgmt]h$'
find_pattern 'unexpected combination with t at end' '[bcdeéfghm]t$' '(sh?ei[cf]|ch?raif|ch|ing|abh)t$'
find_pattern 'unexpected combination with l_ at end' 'l[bdhinorsu]$' '(bh?oi?lb|gh?ild|scoi?lb)$'
find_pattern 'unexpected combination with n_ at end' 'n[dfhilmopru]$' '(ainm|sh?einm|sh?oicind|^Alaind)$'
## from Litriú na Gaeilge
# Rule 2.a, lch 103; lots of exceptions even beyond these...
#find_pattern 'old orthography tch' 'tch' '(fh?abhtcheartú$|^(g?ch?(airtchlá|eartch|ruitchorda|ostchiorr)|leachtchriostai?l$|n?dh?(íotchúis|réachtchon)|smúitcheo|[sS]tátchist[eí]|d?th?(oitcheo|uairtchai?rr)|vástchóta))'
# Rule 3.I.b, lch 104. ÓD lch viii -aidhe -> -aí
#find_pattern 'old orthography final dhe' 'dhe$' '(^([bdm]'|h|[nt]-)?(fhlidhe|[ou]idhe|uídhe)|^(luaidhe|(bh)?flidhe|m?bh?úidhe|g?Ch?oimdhe|d?th?eidhe|sh?oraidhe|spleidhe)|aghaidhe|réidhe)$'
# Rule 3.II.b, lch 105 (exceptions include some "lit." spellings)
#find_pattern 'old orthography -adha-' 'adha.' "^([bdm]'|h|[nt]-)?adha" | egrep -v '(th?adhai?ll|radhai?rc|n?gh?adhai?r)' | egrep -v '^(m?bh?anadhaltra|n?gh?leadha|spadha)' | egrep -v "^(g?ch?adhai?[ln]|g?ch?eannadhairt|g?ch?ladha|m?bh?ladha|d?th?radhaill|mh?eadhar|ladhar|g?ch?eadharla)" | egrep -v "^([bdm]')?fhe?adha" | egrep -v "^(bh)?fe?adha"
# Rule 3.II.c, lch 105
find_pattern 'old orthography aedh+slender' 'aedh(ea|i)' '^a$'
# Rule 3.II.e, lch 105
find_pattern 'old orthography idhea' 'idhea' '(idheanna?$|(infridhearg|fh?áidheadóireacht)a?$|(uidheadha|fh?eidheartha)$|^(g?ch?á|d?th?e)idheacha?$|^heicsidheachúla)'
# Rule 4, lch 106
find_pattern 'old orthography bhth or mhth' '[bm]hth' '(^(réamh|leath|(bh?)fh?rith|neamh|b?ph?ríomh|g?ch?oi?mh|ríomh)th|ubhthorai?dh|^(n?dh?o-chomhthomha|n?gh?eamhthro|d?th?aobhthro|n?dh?ubhthuirs|leamhthuirse$|rabhtha[rs]$))'
# Rule 6.I.b, lch 106
find_pattern 'old orthography final ghe' 'ghe$' "(^(n?dh?[aáó]|(bh)?fh?r?a|sh?eo|t?sh?o|d?th?ro|n?dh?eide|mh?a)ighe$|^[bdm]'fhraighe|^([bdm]'|h|[nt]-)?([aoó]|andó|éadó|ua)ighe)"
# Rule 6.I.c, lch 107, exceptions are literary
find_pattern 'old orthography ugh' 'ugh' '^m?bh?rugh'
# Rule 6.II.b, lch 107, exceptions are literary
find_pattern 'old orthography -ghail' '.ghail' '(fh?oghail|iorghaile|^(n?dh?íoghail|d?th?oghail)|^mh?ionghailf)$'
# Rule 8.b, lch 108
find_pattern 'old orthography tht' 'tht'
# Rule 14.a i and ii, lch 113
find_pattern 'old orthography llr or lls' 'll[rs]' '([oO]lls|bhallra|^(n?dh?allr|m?ballra|n?dh?uillsilt|n?gh?éillsin|g?ch?allshaoth|g?ch?eallra|stiallscann))'
# Rule 14.b.ii, sonnda is literary, lch 113
find_pattern 'old orthography nnd' 'nnd' '(nndh?e[ai]rg|^(lionndubh|g?ch?eanndán|sh?onnda$|b?ph?onnd|d?th?eanndháileoi?g))'
# Rule 14.b.iv, loinnreach/mainnre are genitives, lch 113
find_pattern 'old orthography nnr' 'nnr' '((nnrua|loinnreach)$|^(g?ch?eannr|mh?ainnre|lannrollá))'
# Rule 14.b.v, annsan is emphatic pronomial, not ==ansin, lch 113
find_pattern 'old orthography nns' 'nns' '(nns[ae]$|^(g?ch?eanns|n?dh?innseanch|n?gh?rinnscr|b?ph?roinnseomra|g?ch?rannseil|mh?ionnscríbhinn|m?bh?onnsmid|annsan$))'
# Rule 15.a, lch 114
find_pattern 'old orthography -ln-' 'ln' '(ilne$|iailnimh|ilnáisiúnta|ollnóva|ulna|ilnithe$|^(b?ph?ailn|m?bh?allnai?sc$))'
# Rule 15.b, oirmhidne is literary genitive, lch 114
find_pattern 'old orthography -dn-' 'dn' '(idne$|eicidn[eí]$|ardnósa|oirmhidne$|^(m?bh?róidn|m?bh?airdne$|mh?aidneachai?n$|muidne$))'
# Rule 16.a.i, lch 115
find_pattern 'old orthography sg' 'sg[^h]' '^a$'
# Rule 16.a.iii, lch 115
# way more exceptions than these...
#find_pattern 'old orthography sd' 'sd' '(aisdúich|eisdírith|osduine$|^(g?ch?osdearg|d?th?easdí|d?th?rasdu|leasde|rósd|n?gh?lasdoi?nn)|osdaonna$)'
# Rule 19.g, lch 121, bladha, miadha, mudha, spleadha literary
find_pattern 'old orthography final dha' 'dha$' '(fhea|uidhea|^((bh)?fea|m?bh?la|mh?(ia|u|o)|splea))dha$'
# Rule 23.I.a, lch 123
find_pattern 'old orthography árr' 'árr' '^a$'
# Rule 23.I.b, lch 123
find_pattern 'old orthography éird or éirl' 'éir[dl]' '^(léirlé|s?ph?éirl)'
# Rule 24, lch 124
find_pattern 'multiple hyphens or apostrophes' "(-.*-|'.*')" '(^[nt]-|iar-nua-|éan-féin-é$)'
# Rule 25, lch 127
find_pattern 'unexpected apostrophe' "'" "^(m?b|[dms])'"
# Others of a similar nature
# ÓD lch viii -amhail -> -úil
find_pattern 'old orthography final -amhail' 'amhail$' '(sh?|^)amhail$'
# ÓD lch viii -éaracht -> -éireacht
find_pattern 'old orthography final -éaracht' 'éaracht$' '^mh?éaracht$'
# Ó Siadhail notes that 'ío' replaces 'ía' before a consonant
find_pattern 'old orthography ía+consonant' 'ía[bcdfglmnprst]'
### Assumptions from aspell phonetics file
### (errors in this section may imply gaeilge_phonet.dat needs attention)
# ANBHANN
find_pattern 'aspell phonetics ANBHANN' 'nbhann' 'anbhanna?$'
# ANBHAIN
find_pattern 'aspell phonetics ANBHAIN' 'anbhai' '(anbhainne?$|^m?bh?uanbhail|^n?gh?rianbhaic$)'
# AERGA
find_pattern 'aspell phonetics AERGA' 'erga' 'aerga$'
# AORG
find_pattern 'aspell phonetics AORG' 'aorg[^h]' '^(mh?|t?sh?)aorg[aá]'
# AEILG
find_pattern 'aspell phonetics AEILG' 'aeilg' 'Gh?aeilge'
# AILBH
find_pattern 'aspell phonetics AILBH' 'ailbh' '[bcs]h?ailbh'
# ALBHÁI?D
find_pattern 'aspell phonetics ALBHÁ' 'albhái?d' '^(g?ch?oinnealbhái?d|n?gh?albhái?d$)'
# ALBH
find_pattern 'aspell phonetics ALBH' 'albh[^aáeoóuúr]'
# ARBHÁI?D
find_pattern 'aspell phonetics ARBHÁ' 'arbhái?d' '^mh?ótarbhái?d$'
# ARBHUIL
find_pattern 'aspell phonetics ARBHUIL' 'arbhui[^t]' '(arbhuill|^mh?arbhuisc)[eí]$'
# ARBHUA
find_pattern 'aspell phonetics ARBHUA' 'arbhua' 'eadarbhuasa'
# ARBHIN
find_pattern 'aspell phonetics ARBHIN' 'arbhin' '^mh?arbhintinn'
# ARBH(EI), ARBH
# ATHFH(ÁÉÓAEIOU)---
find_pattern 'aspell phonetics ATHFH' 'thfh[íú]' '^d?th?áthfhéithl'
# ATH(BCD...), ADH
# AGHI---
find_pattern 'aspell phonetics AGHI' 'aghi' '^g?ch?orraghiob'
# AGHLOIN
find_pattern 'aspell phonetics AGHLOIN' 'aghloi[^t]' '^b?ph?leicseaghloine$'
# AGH
# AOMH(FLNST)--- (first says no fh exception needed)
find_pattern 'aspell phonetics AOMHFH' 'aomhfh' '^naomhfhá'
find_pattern 'aspell phonetics AOMH+consonant' 'aomh[bcdgmpr]'
# ÁIRG-
# ÁDHU
find_pattern 'aspell phonetics ÁDHU' 'ádhu' '^b?ph?ádhuill[eí]$'
# ÁDH
find_pattern 'aspell phonetics ÁDH' 'ádh[^u]' 'ádhú(il|la)$'
# ÁTHFH
find_pattern 'aspell phonetics ÁTHFH' 'áthfh[aeiouáéíóú]' '^(d?th?áthfhéithl|n?gh?náth)'
# ÁTH(BCD...)
# BANBH, BHANBH, BAINBH, BHAINBH
find_pattern 'aspell phonetics BANB or BAINB' 'bh?ai?nb' '^m?bh?ai?nbh(arúi?n)?$'
# CHÉAFAÍ--$
# CH?EARCH--
find_pattern 'aspell phonetics CEARCH' 'ch?earch' '^g?ch?earchaill[eí]?$'
# CH?ONF
find_pattern 'aspell phonetics CONF' 'ch?onf' '^g?ch?onfa(cha?|i?dh|igh|í)$'
# CH?ANBH--
find_pattern 'aspell phonetics CANB' 'ch?anb' '^g?ch?anbhái?s'
# CH?OLBH
find_pattern 'aspell phonetics COLBH' 'ch?olbh' '^g?ch?olbhaí?$'
# CH?URF
find_pattern 'aspell phonetics CURF' 'ch?urf' '^g?ch?urfá(nna)?$'
# DH?ORCH
# DH?EARF
find_pattern 'aspell phonetics DEARF' 'dh?earf' '^n?dh?earf[aáó]'
# DH?EIRF
find_pattern 'aspell phonetics DEIRF' 'dh?eirf' '^(n|leas)?dh?eirf(éar|iúr)'
# DH?OIL(BF)
find_pattern 'aspell phonetics DOIL' 'dh?oil[bf]' '^n?dh?oil(fe|bh)'
# DH?IFEAR
find_pattern 'aspell phonetics DIFE' 'dh?ife' '^n?dh?ifear$'
# DH$
find_pattern 'aspell phonetics final DH' '[^aeiouáéíóú]dh$' '^a$'
# DH
find_pattern 'aspell phonetics EDH' 'edh' '(uiscedh|ch?inedh(eigh|íothú$))'
find_pattern 'aspell phonetics ÚDH' 'údh.' '^a$'
find_pattern 'aspell phonetics other DH' '(^|[^aáiou])dh[^aeiouáéíóúlr]'
# DHLÚ-- and DHL(EIÍ)--
find_pattern 'aspell phonetics non-initial DHL' '[^aáiou]dhl' '(dhlú(th|ite)|dhlistean|dhleatha|^neamhdhlíthiú)'
find_pattern 'aspell phonetics initial DHL' '^dhl[^aeíiuú]' '^a$'
# DHR rules
# ton of exceptions
#find_pattern 'aspell phonetics non-initial dhr plus broad' '[^aáiou]dhr[aáoóuú]' '((dh?obhar|uisce)dhro|^mh?arbhdhra|^(scig|n?gh?earr)dhrámaí?$|^t?sh?reangdhrumaí?$)'
find_pattern 'aspell phonetics non-initial dhr plus slender' '[^aáiou]dhr[eéií]' '(^n?dh?ídhreasacht|dhr[eé]acht|dhreacha?$|eirdhris)'
find_pattern 'aspell phonetics initial dhr' '^dhr[^aáeéiouú]' '^dhr(óla|íoda)'
# EAFAR
find_pattern 'aspell phonetics final eafar' 'eafar$' '^(n?g|m)h?eafar$'
# EOFAR
# EILBH
# EIDH
# EOMH
find_pattern 'aspell phonetics EOMH' 'eomh[bcdfglmnprst]' '^leomh[ft]'
# ÉARBH
find_pattern 'aspell phonetics ÉARB' 'éarb' '^n?gh?éarbh'
# ÉARM
find_pattern 'aspell phonetics ÉARM' 'éarm[^h]' 'th?éarm(a|eol)'
# ÉARG
find_pattern 'aspell phonetics ÉARG' 'éarg[^h]' '^(lán)?léargai?s$'
# ÉIRG
find_pattern 'aspell phonetics ÉIRG' 'éirg[^h]' 'ailléirg'
# ÉIRBH
find_pattern 'aspell phonetics ÉIRBH' 'éirbh' '^(léirbhreith|spéirbhe?an$)'
# ÉALBH
find_pattern 'aspell phonetics ÉALBH' 'éalbh' '^m?bh?éalbh'
# ÉAFÁ
find_pattern 'aspell phonetics ÉAFÁ' 'éafá' 'éafá$'
# FH?AIRCH
find_pattern 'aspell phonetics FAIRC' 'fh?airc' 'fh?airch(e|í|íní?)$'
# FH?OIRF
find_pattern 'aspell phonetics FOIRF' 'foirf' '^(bh)?foirf'
# FH?ONNMH
find_pattern 'aspell phonetics FONNM' 'fh?onnm' "^(b'|bh)?fh?onnmhai?r"
# FH?OILMH
find_pattern 'aspell phonetics FOILM' 'fh?oilm' "^([bdm]'|bh)?fh?oilmh[eí]"
# FAIDH, almost always terminal
find_pattern 'aspell phonetics FAIDH' 'faidh[^b]' "fh?aidhpeái?l"
# FADH, almost always terminal
find_pattern 'aspell phonetics FADH' 'fadh[^bf]' 'fh?adharcái?n$'
# FIDH (fidh only terminal)
find_pattern 'aspell phonetics FIDH' 'fidh.' '^a$'
# FEADH almost always terminal
find_pattern 'aspell phonetics FEADH' 'feadh[^n]' '^(bh)?feadha(in)?$'
# FEAR, FAR
# FINN almost always terminal
find_pattern 'aspell phonetics FINN' 'finn[^eé]' 'finnse$'
# FAINN almost always terminal
find_pattern 'aspell phonetics FAINN' 'fainn[^eéi]' 'fainnse$'
# FÁ
# FEÁ almost always terminal
find_pattern 'aspell phonetics FEÁ' 'feá.' '(^(bh)?feá(dói?r|nna$)|feása$)'
# FA?Í
# FA?IMI(DS)
find_pattern 'aspell phonetics FAIMID and FAIMIS' 'fa?imi[ds].' '^imi[ds]ne$'
# FA?IDÍS
find_pattern 'aspell phonetics FAIDÍS' 'fa?idís.' '^a$'
# GH?AINMH, GH?EALLMH
find_pattern 'aspell phonetics GAINMH and GEALLMH' 'gh?(ain|eall)mh' '^n?gh?(ain|eall)mh'
# GH?LAFAI?DH
# GH
find_pattern 'aspell phonetics other GH' '[^aiou]gh[^aeiouáéíóúlnr]' '^a$'
find_pattern 'aspell phonetics GHL' '[^aiou]ghl[ií]' '(^t?sh?árghliú|aimhghlic(ea|i)s)$'
# IARG
find_pattern 'aspell phonetics IARG' 'iarg[^áhú]' '^a$'
# IARBH
# IDIRBH
# IRBHRÚ
find_pattern 'aspell phonetics IRBHRÚ' 'irbhrú' '^mh?uirbhrúchta?(nna)?$'
# IRBHU
find_pattern 'aspell phonetics IRBHU' 'irbhu' '(eochairbhuill[eí]$|^litirbhuamaí?$)'
# IFÍ$ (lots)
# INMHE(AÁ)
find_pattern 'aspell phonetics INMHE' 'inmhe[^aá]' '^a$'
# INNMH
find_pattern 'aspell phonetics INNMH' 'innmh' '(fh?uinnmh|^g?ch?oinnmh)'
# IONMHAG, IONMH
find_pattern 'aspell phonetics IONMH' 'ionmh' '^(g?ch?ionmhai?r|mh?ionmh)'
# ITHFH
find_pattern 'aspell phonetics ITHFH' 'ithfh' '(ch?ithfholc|ch?rithfhuacht|fh?rithfh|^sh?uaithfhriochadh$)'
# ITH(BCD...)
# IDH(BCD...)
find_pattern 'aspell phonetics IDH' 'idh[aouáéíóú]' 'idhí$'
# IGH(...)
find_pattern 'aspell phonetics IGH' 'igh[bgmpaouáéíóú]' '^a$'
# ÍORM
find_pattern 'aspell phonetics ÍORM' 'íorm' '(^n?dh?íormaí?$|fh?íormh)'
# ÍOMH(BCD...)
find_pattern 'aspell phonetics ÍOMH' 'íomh[bcdfglmnprst]' '^(b?ph?r|l|r|(n?g|s)h?n)íomh'
# ÍTHS-
find_pattern 'aspell phonetics ÍTH' 'íth[bcdfglmnpst]' '^g?ch?líths(í|eacha?)$'
# J
find_pattern 'aspell phonetics J' '[jJ]' '^(j|n?dh?iosc-j)'
# K
find_pattern 'aspell phonetics K' '[kK]' '^(karaté|Kiótó)$'
# LEANBH/LINBH always terminal
find_pattern 'aspell phonetics LEANBH or LINBH' 'l(ea|i)nbh.' '^leanbhaoise?$'
# L(BGM)H?
# MORFAÍ--$ always terminal
find_pattern 'aspell phonetics MORFAÍ' 'morfaí.' '^a$'
# MBANBH, MBAINBH see BANBH, etc. above
# MH?ARF
find_pattern 'aspell phonetics MARF' 'mharf[^aó]' '^a$'
# MODH, MHODH
# NAFAÍ--
find_pattern 'aspell phonetics NAFA' 'nafaí' '^sh?nafaí$'
# NNARB
find_pattern 'aspell phonetics NNARB' 'nnarb' 'ionnarb'
# NNEALBH--
find_pattern 'aspell phonetics NNEALBH' 'nnealbh' '^g?ch?oinnealbhá'
# NDORCH, NDEARF, NDEIRF, NDOIL, NDIFEAR see D-
# NGAINMH, NGEALLMH, NGLAF... see G-
# NCHA(ÍS)/NCHAIS/NCHAITHE
find_pattern 'aspell phonetics NCHA' 'ncha([ís]|is|ith)' '(ionchai?s|sh?eancha)'
# NCHAIR(D)
find_pattern 'aspell phonetics NCHAIR' 'nchair' '(nchaird[ei]|(th?ea|th?io|grea)nchair)'
# N(BM)H?
# OFAR--$
find_pattern 'aspell phonetics OFAR' '[^ae]ofar' '^(n?gh?l?a|mh?í)ofara?$'
# OIRCH
find_pattern 'aspell phonetics OIRCH' 'oirch' '.?.?oirch'
# OCALBH
find_pattern 'aspell phonetics OCALB' 'ocalb' 'fh?ocalbhá'
# ORBHÁ
find_pattern 'aspell phonetics ORBHÁ' 'orbhá' 'fh?orbhái?s$'
# ONNCHA
find_pattern 'aspell phonetics ONNCHA' 'onncha' '(Dh?|fh?i)onncha'
# OMHARB
find_pattern 'aspell phonetics OMHARB' 'omharb' '^g?ch?omharba'
# OMH(BCD...)
# OTH(BCD...)
find_pattern 'aspell phonetics OTH' 'oth[ft]' '^a$'
# ODHAO
find_pattern 'aspell phonetics ODHAO' 'odhao' 'fh?odhao(ine|nna)$'
# ODH(ACLNR)
find_pattern 'aspell phonetics ODH' 'odh[bcdfgmpst]' '^d?th?odhchaí'
# OGHRÚP
find_pattern 'aspell phonetics OGHRÚP' 'oghrúp' 'fh?oghrúpa'
# OGHLUA
find_pattern 'aspell phonetics OGHLUA' 'oghlua' '(^(n?dh?|t?sh?)oghluaiste(achta?)?$|^d?th?oghluai?s)'
# OGHAF
find_pattern 'aspell phonetics OGHAF' 'oghaf' '^n?dh?oghafa'
# OGH(AÁBCD...)
find_pattern 'aspell phonetics OGHÁ' 'oghá' '^d?th?oghái?n$'
# ÓR[GM]
find_pattern 'aspell phonetics ÓRG' 'órg[^h]' '(órga$|^mh?órga|^mórgóir$)'
find_pattern 'aspell phonetics ÓRM' 'órm[^h]' 'th?órma(ch|igh)$'
# ÓGH
# ton of exceptions
find_pattern 'aspell phonetics ÓGH' 'ógh' "^([bdm]'|[hr]|[nt]-)?ógh"
# Q
find_pattern 'aspell phonetics Q' '[qQ]' '^qu(inín|arto)$'
# RANFAÍ
find_pattern 'aspell phonetics RANFA' 'ranfa' 'fh?rith-chuaranfaí?$'
# RAFAÍ, lots, not nec. terminal either
# RRBHA
# REALMH
find_pattern 'aspell phonetics REALM' 'realm' '^d?th?realmh'
# RÍFEAR
find_pattern 'aspell phonetics RÍFEAR' 'rífear' '^((h|n-)?ath)?rífear$'
# ROMH(FT)
find_pattern 'aspell phonetics ROMH' 'romh[bcdfglmnprst]' '^b?ph?romh[ft]'
# RFEAN/RFIN
find_pattern 'aspell phonetics RFEAN or RFIN' 'rf(ean|in$)' '(ionoirfin|^(m?bh?e|n?gh?a|t?sh?e|mh?e)irf(ea|i)n)$'
# R(BGM)H--
# RBO--
find_pattern 'aspell phonetics RBO' 'rbo' '^g?ch?osarbolg'
# SH?ORCH
find_pattern 'aspell phonetics SORCH' 'sh?orch' '^(sh?orch|tsorchaithe$)'
# SH?OILBH
find_pattern 'aspell phonetics SOILB' 'sh?oilb' '^(sh?oilbhi?r|tsoilbhris$)'
# TH?ALMH
find_pattern 'aspell phonetics TALM' 'th?alm' '^d?th?almh[aóú]'
# TH?INFEADH/FIDH
find_pattern 'aspell phonetics TINF' 'th?inf[ei]' '^d?th?inf(ea|i)dh$'
# TH?AFA
find_pattern 'aspell phonetics TAFA' 'th?afa' '^d?th?afai?nn$'
# TSORCH-, TSOILBH see S-
# TH$ rule
find_pattern 'aspell phonetics final TH' '[^aeiouáéíóú]th$' '^a$'
# TH->H, following check for (and find no) potential exceptions (i.e.silent TH)
find_pattern 'aspell phonetics ETH' '[^a]eth' 'uilethac'
find_pattern 'aspell phonetics ÉTH' 'éth' '^(n?dh?éth|g?ch?réthul)'
find_pattern 'aspell phonetics ÓTH' 'óth[^aeiouáéíóú]' '^a$'
# UFA
find_pattern 'aspell phonetics UFA' 'ufa[ír]' '^(m?bh?rufara?|(g?ch?|r)ufaí)$'
# UAI?RG
find_pattern 'aspell phonetics UARG' 'uai?rg' '(fh?uarga(chta?)?$|^d?th?ua(irgn|rgai?n))'
# UARBH
# UALGA
find_pattern 'aspell phonetics UALG' 'ualg' '((^n)?dh?ualg|^m?bh?ualghl)ai?s$'
# ULLMH
find_pattern 'aspell phonetics ULLM' 'ullm' 'ullmh[aóúu]'
# UMH
# UTH(BCDGMNPR)
find_pattern 'aspell phonetics UTHF' 'uthf' '^a$'
find_pattern 'aspell phonetics UTH' 'uth[^aeiouáéíóú]' '^(t?sh?ruth|n?gh?uthphoi?st$)'
# ULCH
# URCH(AÓ)
# UDH
find_pattern 'aspell phonetics UDH' 'udh' '^mh?udh[aft]?'
# UGH
find_pattern 'aspell phonetics UGH' 'ugh' '^m?bh?rugh' # repeat of 6.I.c above
# ÚIRG
find_pattern 'aspell phonetics ÚIRG' 'úirg' '^liotúirg'
# ÚTH(BCDF...)- no 'fh' exception needed
find_pattern 'aspell phonetics ÚTH' 'úth([gmns]|fh)' '^a$'
# V (see Litriú na Gaeilge, Rule 20, lch 121)
# way too many exceptions now
#find_pattern 'aspell phonetics V' '[vV]' "^(.?|[bdm]')[A-ZÁÉÍÓÚ]"
# W
find_pattern 'aspell phonetics W' '[wW]' '(^wigwam|Dh?arwin)'
# X
find_pattern 'aspell phonetics X' '[xX]' '^(Mh?arx.|x([aeéií]|-gha))'
# Y
find_pattern 'aspell phonetics Y' '[yY]' '^yóyó'
# Z
find_pattern 'aspell phonetics Z' '[zZ]' "^(z|b?ph?uza|([bdm]'|h|[nt]-?)?(ózó|Úizbeiceast))"
## Remainder were inspired by gaeilge_phonet.dat but either
## correspond to defunct rules or exceptions have no logical implications
find_pattern 'defunct aspell phonetics EALBHR' 'ealbhr' '^n?gh?ealbhruth'
find_pattern 'defunct aspell phonetics internal gc' '..*gc[^h]' '^a$'
find_pattern 'defunct aspell phonetics FPH' 'fph' '^n?gh?rafpháip'
find_pattern 'defunct aspell phonetics CDH' 'cdh' '^(m?bh?reacdhorc|sh?priocdhát|t?sh?iocdhó)'
find_pattern 'defunct aspell phonetics internal BP' '..*bp' 'sh?ubpoena'
find_pattern 'defunct aspell phonetics ÍOMHB' 'íomhb' '^b?ph?ríomhbh'
find_pattern 'defunct aspell phonetics BHMH' 'bhmh' '^d?th?aobhmhao'
find_pattern 'defunct aspell phonetics CGH' 'cgh' '^(m?bh?rioscghlór|t?sh?earcghr)'
find_pattern 'defunct aspell phonetics CHDH' 'chdh' '^(n?dh?rochdh|g?ch?ríochdheigh|smeachdhún)'
find_pattern 'defunct aspell phonetics vowel plus FH' '[áiuú]fh' '^m?bh?áfhuinneo'
find_pattern 'defunct aspell phonetics ÉFH' 'éfh' '^n?dh?éfh'
find_pattern 'defunct aspell phonetics ÓFH' 'ófh' '^(g?ch?lófhoir|rófh)'
### Optional Broad/Broad, Slender/Slender check... lots of exceptions.
#echo 'Checking for broad/slender or slender/broad...'
#find_pattern 'consonant with broad on left, slender on right' '[aáoóuú][bcdfghlmnprst]+[iíeé]' '^a$'
#find_pattern 'consonant with slender on left, broad on right' '[iíeé][bcdfghlmnprst]+[aáoóuú]' '^a$'