liblevenshtein 0.9.1

Levenshtein/Universal Automata for approximate string matching using various dictionary backends
Documentation
// Catalan Base Phonetic Rules
// ===========================
// Phonetic rules for Catalan (català).
// Romance language spoken in Catalonia, Valencia, and Balearic Islands.
//
// Key features:
//   - L·L (ela geminada): Geminated l, unique to Catalan
//   - NY: Palatal nasal (like Spanish ñ)
//   - TX: Like English "ch"
//   - TG/TJ: Like English "j"
//   - Ç: s sound
//   - Accents distinguish vowel quality and stress
//   - Eight vowel phonemes: /a/, /e/, /ɛ/, /i/, /o/, /ɔ/, /u/, /ə/
//
// Rule IDs: 4900-4949

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

// ============================================================
// SPECIAL DIGRAPHS/TRIGRAPHS (highest priority)
// ============================================================

// L·L -> L (ela geminada, geminated l - normalize to single L)
[id: 4900, name: "l interpunct l", weight: 0.05, group: catalan_special]
l·l -> L;

// NY -> ɲ (palatal nasal, like Spanish ñ)
[id: 4902, name: "ny digraph", weight: 0.05, group: catalan_digraphs, ipa: "/ɲ/"]
ny -> ɲ;

// TX -> t͡ʃ (like English "ch")
[id: 4905, name: "tx digraph", weight: 0.05, group: catalan_digraphs, ipa: "/t͡ʃ/"]
tx -> t͡ʃ;

// IG -> t͡ʃ (in final position, like "ch")
[id: 4908, name: "ig digraph", weight: 0.05, group: catalan_digraphs, ipa: "/t͡ʃ/"]
ig -> t͡ʃ;

// TG -> d͡ʒ (like English "j" before e, i)
[id: 4910, name: "tg digraph", weight: 0.05, group: catalan_digraphs, ipa: "/d͡ʒ/"]
tg -> d͡ʒ;

// TJ -> d͡ʒ (like English "j")
[id: 4913, name: "tj digraph", weight: 0.05, group: catalan_digraphs, ipa: "/d͡ʒ/"]
tj -> d͡ʒ;

// LL -> ʎ (palatal lateral)
[id: 4916, name: "ll digraph", weight: 0.05, group: catalan_digraphs, ipa: "/ʎ/"]
ll -> ʎ;

// SS -> S (geminate s)
[id: 4919, name: "ss digraph", weight: 0.05, group: catalan_digraphs]
ss -> S;

// ============================================================
// SPECIAL CONSONANTS
// ============================================================

// Ç -> s (c cedilla, s sound)
[id: 4921, name: "c cedilla to s", weight: 0.1, group: catalan_consonants, ipa: "/s/"]
ç -> s;

// X -> ʃ (represents "sh" sound in Catalan)
[id: 4923, name: "x to ʃ", weight: 0.1, group: catalan_consonants, ipa: "/ʃ/"]
x -> ʃ;

// ============================================================
// ACCENTED VOWELS (normalize to base vowels)
// ============================================================

// À/à -> a (grave accent, open a)
[id: 4925, name: "a grave to a", weight: 0.1, group: catalan_vowels]
à -> a;

// È/è -> e (grave accent, open e)
[id: 4927, name: "e grave to e", weight: 0.1, group: catalan_vowels]
è -> e;

// É/é -> e (acute accent, closed e)
[id: 4929, name: "e acute to e", weight: 0.1, group: catalan_vowels]
é -> e;

// Í/í -> i (acute accent)
[id: 4931, name: "i acute to i", weight: 0.1, group: catalan_vowels]
í -> i;

// Ï/ï -> i (diaeresis, hiatus)
[id: 4933, name: "i diaeresis to i", weight: 0.1, group: catalan_vowels]
ï -> i;

// Ò/ò -> o (grave accent, open o)
[id: 4935, name: "o grave to o", weight: 0.1, group: catalan_vowels]
ò -> o;

// Ó/ó -> o (acute accent, closed o)
[id: 4937, name: "o acute to o", weight: 0.1, group: catalan_vowels]
ó -> o;

// Ú/ú -> u (acute accent)
[id: 4939, name: "u acute to u", weight: 0.1, group: catalan_vowels]
ú -> u;

// Ü/ü -> u (diaeresis, hiatus)
[id: 4941, name: "u diaeresis to u", weight: 0.1, group: catalan_vowels]
ü -> u;

// ============================================================
// CONSONANTS
// ============================================================

// C -> k (before a, o, u)
[id: 3268, name: "c consonant", weight: 0.2, group: catalan_consonants]
c -> k;

// H -> (silent in Catalan)
[id: 3276, name: "h silent", weight: 0.2, group: catalan_consonants]
h -> ;

// J -> ʒ (like French "j", voiced postalveolar fricative)
[id: 3278, name: "j consonant", weight: 0.2, group: catalan_consonants, ipa: "/ʒ/"]
j -> ʒ;

// Q -> k (always followed by u)
[id: 3290, name: "q consonant", weight: 0.2, group: catalan_consonants]
q -> k;

// V -> b (like Spanish, b/v merger in most dialects)
[id: 3298, name: "v to b", weight: 0.2, group: catalan_consonants]
v -> b;

// W -> u (loanwords)
[id: 3300, name: "w to u", weight: 0.2, group: catalan_consonants]
w -> u;

// Y -> i (loanwords)
[id: 3302, name: "y to i", weight: 0.2, group: catalan_consonants]
y -> i;