liblevenshtein 0.9.1

Levenshtein/Universal Automata for approximate string matching using various dictionary backends
Documentation
// Finnish Base Phonetic Rules
// ===========================
// Phonetic rules for Finnish (suomi).
// Finnish has nearly phonemic orthography.
//
// Key features:
//   - Nearly phonemic spelling (very regular)
//   - Two front vowels: ä, ö
//   - Vowel harmony: front (ä, ö, y) vs back (a, o, u)
//   - Gemination: double letters indicate long sounds
//   - Ng digraph = velar nasal [ŋː]
//   - No voiced stops (b, d, g) in native words
//
// Note: All rules are case-insensitive. Only lowercase patterns are defined;
//       uppercase and mixed-case variants are handled automatically.
//
// Rule IDs: 3800-3849

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

// ============================================================
// DIGRAPHS (highest priority)
// ============================================================
// Case variants (Ng, NG, Nk, NK) are handled automatically.

// ng → ŋː (geminate velar nasal, like "ng" in "singer")
[id: 3800, name: "ng digraph", weight: 0.05, group: finnish_digraphs, ipa: "/ŋː/"]
ng -> ŋː;

// nk → ŋk (velar nasal + k)
[id: 3803, name: "nk digraph", weight: 0.05, group: finnish_digraphs, ipa: "/ŋk/"]
nk -> ŋk;

// ============================================================
// LONG VOWELS (doubled letters = long sounds)
// ============================================================
// Finnish uses doubled letters to indicate vowel length.
// These must be matched BEFORE single vowel rules.
// Case variants (AA, EE, II, etc.) are handled automatically.

[id: 3806, name: "long aa", weight: 0.04, group: finnish_long_vowels, ipa: "/aː/"]
aa -> aː;

[id: 3808, name: "long ee", weight: 0.04, group: finnish_long_vowels, ipa: "/eː/"]
ee -> eː;

[id: 3850, name: "long ii", weight: 0.04, group: finnish_long_vowels, ipa: "/iː/"]
ii -> iː;

[id: 3852, name: "long oo", weight: 0.04, group: finnish_long_vowels, ipa: "/oː/"]
oo -> oː;

[id: 3854, name: "long uu", weight: 0.04, group: finnish_long_vowels, ipa: "/uː/"]
uu -> uː;

[id: 3856, name: "long ää", weight: 0.04, group: finnish_long_vowels, ipa: "/æː/"]
ää -> æː;

[id: 3858, name: "long öö", weight: 0.04, group: finnish_long_vowels, ipa: "/øː/"]
öö -> øː;

[id: 3860, name: "long yy", weight: 0.04, group: finnish_long_vowels, ipa: "/yː/"]
yy -> yː;

// ============================================================
// FRONT VOWELS (special Finnish vowels)
// ============================================================
// Case variants (Ä, Ö) are handled automatically.

// ä → æ (front open vowel, like German ä)
[id: 3810, name: "a umlaut to æ", weight: 0.1, group: finnish_front_vowels, ipa: "/æ/"]
ä -> æ;

// ö → ø (front rounded vowel, like German ö)
[id: 3812, name: "o umlaut to ø", weight: 0.1, group: finnish_front_vowels, ipa: "/ø/"]
ö -> ø;

// ============================================================
// CONSONANTS (transformative rules for loanwords)
// ============================================================
// Case variants (B, C, D, G, W, X, Z) are handled automatically.

// b → p (b only in loanwords, often pronounced as p)
[id: 3826, name: "b to p", weight: 0.2, group: finnish_consonants]
b -> p;

// c → k (c only in loanwords)
[id: 3828, name: "c to k", weight: 0.2, group: finnish_consonants]
c -> k;

// d → t (d is marginal, often realized as t in dialects)
[id: 3830, name: "d consonant", weight: 0.2, group: finnish_consonants]
d -> t;

// g → k (g only in loanwords or after n)
[id: 3834, name: "g to k", weight: 0.2, group: finnish_consonants]
g -> k;

// w → v (loanwords, same as v)
[id: 3242, name: "w to v", weight: 0.2, group: finnish_consonants]
w -> v;

// x → ks (loanwords)
[id: 3244, name: "x to ks", weight: 0.2, group: finnish_consonants]
x -> ks;

// z → t͡s (loanwords, pronounced as ts)
[id: 3246, name: "z to t͡s", weight: 0.2, group: finnish_consonants, ipa: "/t͡s/"]
z -> t͡s;