gruut-lang-de (German language files for gruut)
raw JSON → 2.0.1 verified Mon Apr 27 auth: no python
Provides German (de) language data files for the gruut tokenizer and phonemizer library, including lexicons, grapheme-to-phoneme models, and text normalization rules. Version 2.0.1 is the latest standalone release; the overall gruut ecosystem is actively maintained with a recent v2.4.0 release. Install this package alongside the core `gruut` package to process German text.
pip install gruut-lang-de Common errors
error ModuleNotFoundError: No module named 'gruut.lang.de' ↓
cause gruut v2.0+ moved language data to separate packages; importing from 'gruut.lang.de' no longer works.
fix
Install gruut-lang-de and use
from gruut_lang_de import load_lexicon_de. error TypeError: sentences() got an unexpected keyword argument 'lexicon_loader' ↓
cause Using an older version of gruut (<2.0) that does not accept `lexicon_loader` parameter.
fix
Upgrade gruut to >=2.0:
pip install -U gruut. error ValueError: Language 'de' not available. Available languages: ... ↓
cause Missing the gruut-lang-de package or not registering the lexicon loader.
fix
Install gruut-lang-de and pass
lexicon_loader=load_lexicon_de to gruut.sentences(). Warnings
breaking In gruut v2.0, the API and CLI changed significantly. Language data is no longer bundled in core; you must install separate language packages (e.g., gruut-lang-en, gruut-lang-de). The primary entry point is now `gruut.sentences`. ↓
fix Upgrade gruut to >=2.0 and install the appropriate gruut-lang-* packages. Replace calls like `gruut.tokenize()` with `gruut.sentences()`.
deprecated Inline pronunciations and custom formats like `<number>_<format>` were removed in gruut v2.0. Use SSML tags instead. ↓
fix Replace inline pronunciations with SSML `<phoneme>` or `<say-as>` elements.
gotcha German language data is not automatically registered when installing gruut-lang-de. You must explicitly pass the lexicon loader from gruut_lang_de to gruut.sentences. ↓
fix Use `from gruut_lang_de import load_lexicon_de` and pass `lexicon_loader=load_lexicon_de` when calling `gruut.sentences()`.
Imports
- load_lexicon_de wrong
from gruut.lang.de import load_lexiconcorrectfrom gruut_lang_de import load_lexicon_de
Quickstart
import gruut
from gruut_lang_de import load_lexicon_de
sentences = gruut.sentences('Hallo Welt', lang='de', lexicon_loader=load_lexicon_de)
for sentence in sentences:
for word in sentence:
print(word.text, word.phonemes)