liblevenshtein 0.9.1

Levenshtein/Universal Automata for approximate string matching using various dictionary backends
Documentation
// Irish Base Phonetic Rules
// =========================
// Phonetic rules for Irish (Gaeilge).
// Celtic language spoken in Ireland.
//
// Key features:
//   - Séimhiú (lenition): consonant + h changes sound
//   - Lenited consonants: bh, ch, dh, fh, gh, mh, ph, sh, th
//   - Fadas (acute accent): á, é, í, ó, ú (long vowels)
//   - FH is completely silent!
//
// Rule IDs: 4880-4966
//
// Note: Case variants removed as parser is case-insensitive.
// Identity mappings (a->a, b->b, etc.) removed as unmapped
// characters pass through unchanged.

@name "Irish Base Phonetic Rules"
@version "1.0.0"
@author "liblevenshtein"
@description "Phonetic normalization rules for Irish"

// ============================================================
// SÉIMHIÚ (LENITION) - consonant + h
// ============================================================

// BH → V (like English "v")
[id: 4880, name: "bh lenition", weight: 0.05, group: irish_lenition]
bh -> v;

// CH → x (voiceless velar fricative, like Scottish "loch")
[id: 4883, name: "ch lenition", weight: 0.05, group: irish_lenition, ipa: "/x/"]
ch -> x;

// DH → ɣ (voiced velar fricative)
[id: 4886, name: "dh lenition", weight: 0.05, group: irish_lenition, ipa: "/ɣ/"]
dh -> ɣ;

// FH → (silent!) - completely silent in Irish
[id: 4889, name: "fh lenition", weight: 0.05, group: irish_lenition]
fh -> ;

// GH → ɣ (voiced velar fricative)
[id: 4892, name: "gh lenition", weight: 0.05, group: irish_lenition, ipa: "/ɣ/"]
gh -> ɣ;

// MH → V (like English "v")
[id: 4895, name: "mh lenition", weight: 0.05, group: irish_lenition]
mh -> v;

// PH → F (like English "f")
[id: 4898, name: "ph lenition", weight: 0.05, group: irish_lenition]
ph -> f;

// SH → H (like English "h")
[id: 4901, name: "sh lenition", weight: 0.05, group: irish_lenition]
sh -> h;

// TH → H (like English "h")
[id: 4904, name: "th lenition", weight: 0.05, group: irish_lenition]
th -> h;

// ============================================================
// FADAS (long vowels with acute accent)
// ============================================================
// Fadas mark long vowels. They normalize to short vowels for
// phonetic matching while preserving the base vowel quality.

[id: 4907, name: "a fada", weight: 0.1, group: irish_fadas]
á -> a;

[id: 4909, name: "e fada", weight: 0.1, group: irish_fadas]
é -> e;

[id: 4911, name: "i fada", weight: 0.1, group: irish_fadas]
í -> i;

[id: 4913, name: "o fada", weight: 0.1, group: irish_fadas]
ó -> o;

[id: 4915, name: "u fada", weight: 0.1, group: irish_fadas]
ú -> u;

// ============================================================
// CONSONANT TRANSFORMATIONS
// ============================================================
// Only consonants that transform to different IPA symbols.
// Identity mappings removed - unmapped chars pass through.

// C always pronounced as K in Irish
[id: 4929, name: "c consonant", weight: 0.2, group: irish_consonants]
c -> k;

// G normalized to IPA ɡ (U+0261)
[id: 4935, name: "g consonant", weight: 0.2, group: irish_consonants, ipa: "/ɡ/"]
g -> ɡ;

// ============================================================
// ECLIPSIS (URÚ) - Nasal Mutation
// ============================================================
// In Irish, eclipsis occurs at the start of words in certain
// grammatical contexts. The eclipsing consonant replaces the
// pronunciation of the original consonant.

// mb eclipses b → pronounced as m
[id: 4960, name: "mb eclipsis", weight: 0.05, group: irish_eclipsis, ipa: "/m/"]
mb -> m;

// gc eclipses c → pronounced as ɡ
[id: 4961, name: "gc eclipsis", weight: 0.05, group: irish_eclipsis, ipa: "/ɡ/"]
gc -> ɡ;

// nd eclipses d → pronounced as n
[id: 4962, name: "nd eclipsis", weight: 0.05, group: irish_eclipsis, ipa: "/n/"]
nd -> n;

// bhf eclipses f → pronounced as w (labio-velar approximant)
[id: 4963, name: "bhf eclipsis", weight: 0.05, group: irish_eclipsis, ipa: "/w/"]
bhf -> w;

// bp eclipses p → pronounced as b
[id: 4964, name: "bp eclipsis", weight: 0.05, group: irish_eclipsis, ipa: "/b/"]
bp -> b;

// dt eclipses t → pronounced as d
[id: 4965, name: "dt eclipsis", weight: 0.05, group: irish_eclipsis, ipa: "/d/"]
dt -> d;

// ng eclipses g → pronounced as ŋ (velar nasal)
[id: 4966, name: "ng eclipsis", weight: 0.05, group: irish_eclipsis, ipa: "/ŋ/"]
ng -> ŋ;