Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 47 additions & 1 deletion misaki/data/de_overrides.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"_comment": "German pronunciation overrides for DEG2P. Phonemes bypass espeak-ng and go straight to the model. Priority on lookup collisions: brand > en > de_foreign. Keys are matched after normalize_for_lookup() (casefold, NFKD, strip combining marks, + -> plus, & -> and, @ -> at, keep alphanumerics). Ported from kikiri-tts PR #28 (dida-80b).",
"_comment": "German pronunciation overrides for DEG2P. Phonemes bypass espeak-ng and go straight to the model. Priority on lookup collisions: brand > en > de_abbrevs > de_foreign. Keys are matched after normalize_for_lookup() (casefold, NFKD, strip combining marks, + -> plus, & -> and, @ -> at, keep alphanumerics). Ported from kikiri-tts PR #28 (dida-80b).",
"brand": {
"bark": "bˈaːɐk",
"claude": "klˈoːt",
Expand Down Expand Up @@ -82,6 +82,52 @@
"wsl": "dˌʌbəljˌuːˌɛsˈɛl",
"zero-shot": "zˈiːɹo ʃˈɔt"
},
"de_abbrevs": {
"_comment": "German abbreviations/acronyms mispronounced by espeak-ng. Letter names: A=aː B=beː C=tseː D=deː E=eː F=ɛf G=ɡeː H=haː I=iː K=kaː L=ɛl M=ɛm N=ɛn O=oː P=peː R=ɛɾ S=ɛs T=teː U=uː V=fW(=faʊ) W=veː X=ɪks Z=tsɛt",
"ADAC": "ˌaːˌdeːˌaːˈtseː",
"AFP": "ˌaːˌɛfˈpeː",
"AKW": "ˌaːˌkaːˈveː",
"AOK": "ˌaːˌoːˈkaː",
"AP": "ˌaːˈpeː",
"ARD": "ˌaːˌɛɾˈdeː",
"AfD": "ˌaːˌɛfˈdeː",
"BA": "ˌbeːˈaː",
"BASF": "ˌbeːˌaːˌɛsˈɛf",
"CEO": "ˌsiːˌiːˈoː",
"CGT": "ˌtseːˌɡeːˈteː",
"CIA": "ˌtseːˌaɪˈeɪ",
"CO": "ˌtseːˈoː",
"CO2": "ˌtseːˌoːˈtsvai",
"ESA": "ˌeːˌɛsˈaː",
"EU": "ˌeːˈuː",
"EVG": "ˌeːˌfWˈɡeː",
"EZB": "ˌeːˌtsɛtˈbeː",
"FAZ": "ˌɛfˌaːˈtsɛt",
"FPÖ": "ˌɛfˌpeːˈøː",
"IAEA": "ˌiːˌaːˌeːˈaː",
"ICE": "ˌiːˌtseːˈeː",
"IG": "ˌiːˈɡeː",
"IS": "ˌiːˈɛs",
"IT": "ˌiːˈteː",
"IW": "ˌiːˈveː",
"IWF": "ˌiːˌveːˈɛf",
"KI": "ˌkaːˈiː",
"OECD": "ˌoːˌeːˌtseːˈdeː",
"OPEC": "ˈoːpɛk",
"OSZE": "ˌoːˌɛsˌtsɛtˈeː",
"SDAX": "ˌɛsˌdeːˌaːˈɪks",
"UBS": "ˌuːˌbeːˈɛs",
"UEFA": "ˌuːˌeːˈfa",
"UK": "ˌjuːˈkeɪ",
"UN": "ˌuːˈɛn",
"US": "ˌuːˈɛs",
"USA": "ˌuːˌɛsˈaː",
"UV": "ˌuːˈfW",
"WHO": "ˌveːˌhaːˈoː",
"ZEW": "ˌtsɛtˌeːˈveː",
"ÖPNV": "ˌøːˌpeːˌɛnˈfW",
"ÖVP": "ˌøːˌfWˈpeː"
},
"de_foreign": {
"diathese": "diaˈteːzə",
"ekstase": "ɛkstˈaːzə",
Expand Down
4 changes: 2 additions & 2 deletions misaki/de.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,14 +409,14 @@ def normalize_for_lookup(text: str) -> str:
def _load_overrides():
"""Load de_overrides.json and build the normalized lookup table.

Priority on key collisions: brand > en > de_foreign (first writer wins).
Priority on key collisions: brand > en > de_abbrevs > de_foreign (first writer wins).
Returns (lookup, aliases) where lookup maps normalized keys to phonemes and
aliases maps one normalized key to another.
"""
with importlib.resources.open_text(data, "de_overrides.json") as r:
raw = json.load(r)
lookup = {}
for section in ("brand", "en", "de_foreign"):
for section in ("brand", "en", "de_abbrevs", "de_foreign"):
for key, value in raw.get(section, {}).items():
lookup.setdefault(normalize_for_lookup(key), value)
aliases = {
Expand Down