Provides information on German words:
- Gender of German words, : Korpus is neutral, Friede is masculine, etc.
- Case declination of words: the genitive of Herr is Herren.
It is based on the german-pos-dict which provides an extensive morphological and syntactic lexicon for German.
npm install german-words
var GermanWords = ;// Fconsole;// Herrenconsole;// Gurkenconsole;
getGenderGermanWord takes a single string param which is the word at its root form and returns the gender M F or N.
getCaseGermanWord returns the declined word based on:
- first string param which is the word at its root form
- second string param which is the case (NOMINATIVE ACCUSATIVE DATIVE GENITIVE)
- third string param which is the number (S or P)
They take an optional second parameter: a list of word data, which completes the original list (and overrides when there are collisions); for format see the output of
Both throw an error when the word is not found.
Dependancies and licences
german-pos-dict provides linguistic binary resources under CC-BY-SA-4.0, which autorises commercial usages. It also contains an
export.sh script to generate a textual dump using https://github.com/languagetool-org.
dictionary.dump is this textual dump. It remains under CC-BY-SA-4.0 licence.