det([indef],[mask,sg,nom]) --> [ein].
det([def],  [mask,sg,nom]) --> [der].
det([qu],   [mask,sg,nom]) --> [welcher].
det([quant],[mask,sg,nom]) --> [jeder].

det([indef],[mask,sg,gen]) --> [eines].
det([def],  [mask,sg,gen]) --> [des].
det([qu],   [mask,sg,gen]) --> [welches].
det([quant],[mask,sg,gen]) --> [jedes].

det([indef],[mask,sg,dat]) --> [einem].
det([def],  [mask,sg,dat]) --> [dem].
det([qu],   [mask,sg,dat]) --> [welchem].
det([quant],[mask,sg,dat]) --> [jedem].

det([indef],[mask,sg,akk]) --> [einen].
det([def],  [mask,sg,akk]) --> [den].
det([qu],   [mask,sg,akk]) --> [welchen].
det([quant],[mask,sg,akk]) --> [jeden].

det([indef],[fem, sg,nom]) --> [eine].
det([def],  [fem, sg,nom]) --> [die].
det([qu],   [fem, sg,nom]) --> [welche].
det([quant],[fem, sg,nom]) --> [jede].

det([indef],[fem, sg,gen]) --> [einer].
det([def],  [fem, sg,gen]) --> [der].
det([qu],   [fem, sg,gen]) --> [welcher].
det([quant],[fem, sg,gen]) --> [jeder].

det([indef],[fem, sg,dat]) --> [einer].
det([def],  [fem, sg,dat]) --> [der].
det([qu],   [fem, sg,dat]) --> [welcher].
det([quant],[fem, sg,dat]) --> [jeder].

det([indef],[fem, sg,akk]) --> [eine].
det([def],  [fem, sg,akk]) --> [die].
det([qu],   [fem, sg,akk]) --> [welche].
det([quant],[fem, sg,akk]) --> [jede].

det([indef],[mask,pl,nom]) --> [einige].
det([def],  [mask,pl,nom]) --> [die].
det([qu],   [mask,pl,nom]) --> [welche].
det([quant],[mask,pl,nom]) --> [alle].

det([indef],[mask,pl,gen]) --> [einiger].
det([def],  [mask,pl,gen]) --> [der].
det([qu],   [mask,pl,gen]) --> [welcher].
det([quant],[mask,pl,gen]) --> [aller].

det([indef],[mask,pl,dat]) --> [einigen].
det([def],  [mask,pl,dat]) --> [den].
det([qu],   [mask,pl,dat]) --> [welchen].
det([quant],[mask,pl,dat]) --> [allen].

det([indef],[mask,pl,akk]) --> [einige].
det([def],  [mask,pl,akk]) --> [die].
det([qu],   [mask,pl,akk]) --> [welche].
det([quant],[mask,pl,akk]) --> [alle].

det([indef],[fem, pl,nom]) --> [einige].
det([def],  [fem, pl,nom]) --> [die].
det([qu],   [fem, pl,nom]) --> [welche].
det([quant],[fem, pl,nom]) --> [alle].

det([indef],[fem, pl,gen]) --> [einiger].
det([def],  [fem, pl,gen]) --> [der].
det([qu],   [fem, pl,gen]) --> [welcher].
det([quant],[fem, pl,gen]) --> [aller].

det([indef],[fem, pl,dat]) --> [einigen].
det([def],  [fem, pl,dat]) --> [den].
det([qu],   [fem, pl,dat]) --> [welchen].
det([quant],[fem, pl,dat]) --> [allen].

det([indef],[fem, pl,akk]) --> [einige].
det([def],  [fem, pl,akk]) --> [die].
det([qu],   [fem, pl,akk]) --> [welche].
det([quant],[fem, pl,akk]) --> [alle].

det([def],[_Gen,pl,_Kas]) --> [Zahlatom],  
    { anzahl(Zahlatom,Zahl), Zahl >= 2 }.

anzahl(Atom,N) :-
    atom_codes(Atom,Codes),
    number_codes(1234567890,NumCodes),
    subset(Codes,NumCodes), % Atom ist Zahlatom
    number_codes(N,Codes).

poss([rel],[mask,sg,gen]) --> [dessen].
poss([rel],[fem, sg,gen]) --> [deren].
poss([rel],[mask,pl,gen]) --> [deren].
poss([rel],[fem, pl,gen]) --> [deren].

pron([qu], [mask,sg,nom]) --> [wer].
pron([qu], [mask,sg,akk]) --> [wen].

pron([rel],[mask,sg,nom]) --> [der].
pron([rel],[mask,sg,gen]) --> [dessen].
pron([rel],[mask,sg,dat]) --> [dem].
pron([rel],[mask,sg,akk]) --> [den].

pron([rel],[fem, sg,nom]) --> [die].
pron([rel],[fem, sg,gen]) --> [derer].
pron([rel],[fem, sg,dat]) --> [der].
pron([rel],[fem, sg,akk]) --> [die].

pron([rel],[mask,pl,nom]) --> [die].
pron([rel],[mask,pl,gen]) --> [deren].
pron([rel],[mask,pl,dat]) --> [denen].
pron([rel],[mask,pl,akk]) --> [die].

pron([rel],[fem, pl,nom]) --> [die].
pron([rel],[fem, pl,gen]) --> [derer].
pron([rel],[fem, pl,dat]) --> [denen].
pron([rel],[fem, pl,akk]) --> [die].

pron([rezi],[mask,pl,akk]) --> [einander].
det([qu],[fem, pl,nom]) --> [wieviele].
det([qu],[fem, pl,gen]) --> [wievieler].
det([qu],[fem, pl,dat]) --> [wievielen].
det([qu],[fem, pl,akk]) --> [wieviele].
det([qu],[mask,pl,nom]) --> [wieviele].
det([qu],[mask,pl,gen]) --> [wievieler].
det([qu],[mask,pl,dat]) --> [wievielen].
det([qu],[mask,pl,akk]) --> [wieviele].

