liblevenshtein 0.9.1

Levenshtein/Universal Automata for approximate string matching using various dictionary backends
Documentation
// Danish Base Phonetic Rules
// ==========================
// Phonetic rules for Danish (dansk).
// North Germanic language spoken in Denmark.
//
// Key features:
//   - Three extra vowels: æ (ae), ø (oe), å (o)
//   - Soft D: d after vowels often becomes ð (written D here)
//   - Silent letters: hv → v, hj → j
//   - Stød (glottal stop) not marked in spelling
//
// Rule IDs: 3808-3899

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

// ============================================================
// DIGRAPHS (high priority)
// ============================================================

// SJ → ʃ (sj-sound, voiceless postalveolar fricative)
[id: 3808, name: "sj digraph", weight: 0.05, group: danish_digraphs, ipa: "/ʃ/"]
sj -> ʃ;

[id: 3809, name: "Sj digraph", weight: 0.05, group: danish_digraphs, ipa: "/ʃ/"]
Sj -> ʃ;

[id: 3810, name: "SJ digraph", weight: 0.05, group: danish_digraphs, ipa: "/ʃ/"]
SJ -> ʃ;

// NG → ŋ (velar nasal)
[id: 3811, name: "ng digraph", weight: 0.05, group: danish_digraphs, ipa: "/ŋ/"]
ng -> ŋ;

[id: 3812, name: "NG digraph", weight: 0.05, group: danish_digraphs, ipa: "/ŋ/"]
NG -> ŋ;

// ============================================================
// SILENT CONSONANT CLUSTERS
// ============================================================

// HV → V (h is silent)
[id: 3813, name: "hv to v", weight: 0.05, group: danish_silent]
hv -> v;

[id: 3814, name: "Hv to v", weight: 0.05, group: danish_silent]
Hv -> v;

[id: 3815, name: "HV to V", weight: 0.05, group: danish_silent]
HV -> v;

// HJ → j (h is silent)
[id: 3816, name: "hj to j", weight: 0.05, group: danish_silent, ipa: "/j/"]
hj -> j;

[id: 3817, name: "Hj to j", weight: 0.05, group: danish_silent, ipa: "/j/"]
Hj -> j;

[id: 3818, name: "HJ to j", weight: 0.05, group: danish_silent, ipa: "/j/"]
HJ -> j;

// ============================================================
// SPECIAL VOWELS
// ============================================================

// Æ → æ (uppercase normalization only)
[id: 3820, name: "AE ligature", weight: 0.1, group: danish_vowels, ipa: "/æ/"]
Æ -> æ;

// Ø → ø (uppercase normalization only)
[id: 3822, name: "O slash", weight: 0.1, group: danish_vowels, ipa: "/ø/"]
Ø -> ø;

// Å/å → ɔ (rounded back vowel)
[id: 3823, name: "a ring to o", weight: 0.1, group: danish_vowels, ipa: "/ɔ/"]
å -> ɔ;

[id: 3824, name: "A ring to o", weight: 0.1, group: danish_vowels, ipa: "/ɔ/"]
Å -> ɔ;

// AA/aa → ɔ (old spelling for å)
[id: 3825, name: "aa to o", weight: 0.1, group: danish_vowels, ipa: "/ɔ/"]
aa -> ɔ;

[id: 3826, name: "Aa to o", weight: 0.1, group: danish_vowels, ipa: "/ɔ/"]
Aa -> ɔ;

[id: 3827, name: "AA to O", weight: 0.1, group: danish_vowels, ipa: "/ɔ/"]
AA -> ɔ;

// ============================================================
// STANDARD VOWELS
// ============================================================
// Note: Standard vowels (a, e, i, o, u, y) pass through unchanged.
// Identity mappings removed as they are no-ops - unmapped characters
// pass through the phonetic transformation unchanged.

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

// C → k (foreign letter, pronounced as k)
[id: 3842, name: "c consonant", weight: 0.2, group: danish_consonants]
c -> k;

[id: 3843, name: "C consonant", weight: 0.2, group: danish_consonants]
C -> k;

// Q → k (foreign letter, pronounced as k)
[id: 3864, name: "q consonant", weight: 0.2, group: danish_consonants]
q -> k;

[id: 3865, name: "Q consonant", weight: 0.2, group: danish_consonants]
Q -> k;

// W → v (foreign letter, pronounced as v)
[id: 3874, name: "w consonant", weight: 0.2, group: danish_consonants]
w -> v;

[id: 3875, name: "W consonant", weight: 0.2, group: danish_consonants]
W -> v;

// X → ks (pronounced as k+s)
[id: 3876, name: "x consonant", weight: 0.2, group: danish_consonants]
x -> ks;

[id: 3877, name: "X consonant", weight: 0.2, group: danish_consonants]
X -> ks;

// Z → s (foreign letter, pronounced as s)
[id: 3878, name: "z consonant", weight: 0.2, group: danish_consonants]
z -> s;

[id: 3879, name: "Z consonant", weight: 0.2, group: danish_consonants]
Z -> s;

// Note: Other consonants (b, d, f, g, h, j, k, l, m, n, p, r, s, t, v) pass through unchanged.
// Identity mappings removed as they are no-ops - unmapped characters
// pass through the phonetic transformation unchanged.