german-adjectives
v5.3.0
Published
German adjectives agreement
Downloads
864
Readme
german-adjectives
Agreement of German adjectives, based on the gender and number of the word, and the case.
You can use german-adjectives-dict
as the linguistic resource.
Installation
npm install german-adjectives
Usage
const GermanAdjectivesLib = require('german-adjectives');
const GermanAdjectives = require('german-adjectives-dict/dist/adjectives.json');
// neuen
console.log(GermanAdjectivesLib.agreeGermanAdjective(null, GermanAdjectives, 'neu', 'DATIVE', 'M', 'S', 'DEFINITE'));
One single function agreeGermanAdjective
that takes multiple parameters and return the agreed adjective:
- exception list on linguistic resources (elements in that list will override elements in second parameter); in general just put
null
here - linguistic resource (list of adjectives): for the format see below and
german-adjectives-dict
lib adjective
: the adjective to agree,germanCase
:NOMINATIVE
ACCUSATIVE
DATIVE
GENITIVE
gender
gender of the word;M
F
orN
number
: number of the word;S
orP
det
: determiner;DEFINITE
INDEFINITE
orDEMONSTRATIVE
[
"Dortmunder":{
"AKK":{
"DEF":{
"P":"Dortmunder",
"F":"Dortmunder",
"M":"Dortmunder",
"N":"Dortmunder"
},
"IND":{
"P":"Dortmunder",
"F":"Dortmunder",
"M":"Dortmunder",
"N":"Dortmunder"
},
"SOL":{
"P":"Dortmunder",
"F":"Dortmunder",
"M":"Dortmunder",
"N":"Dortmunder"
}
},
"DAT":{
...
},
"GEN":{
...
},
"NOM":{
...
}
},
...
]
Todo
Add more possible determiners.
dependencies 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
(zipped in dictionary.zip
) is this textual dump. It remains under CC-BY-SA-4.0 licence.