forked from GitHub/gf-core
Inflect German Numeral pot01 ("ein") in gender and case. Needed to get phrases such as "eine grosse Pizza" correct when "eine" is a Numeral rather than indef art.
This commit is contained in:
@@ -55,8 +55,8 @@ concrete CatGer of Cat =
|
||||
Quant = {s : Number => Gender => Case => Str ; a : Adjf} ;
|
||||
Art = {s : Bool => Number => Gender => Case => Str ; a : Adjf} ;
|
||||
Predet = {s : Number => Gender => Case => Str} ;
|
||||
Num = {s : Str ; n : Number ; isNum : Bool} ;
|
||||
Card = {s : Str ; n : Number} ;
|
||||
Num = {s : Gender => Case => Str ; n : Number ; isNum : Bool} ;
|
||||
Card = {s : Gender => Case => Str ; n : Number} ;
|
||||
Ord = {s : AForm => Str} ;
|
||||
|
||||
-- Numeral
|
||||
|
||||
@@ -71,7 +71,7 @@ oper
|
||||
|
||||
cardOrd : Str -> Str -> CardOrd => Str = \drei,dritte ->
|
||||
table {
|
||||
NCard => drei ;
|
||||
NCard _ _ => drei ;
|
||||
NOrd a => (regA (init dritte)).s ! Posit ! a
|
||||
} ;
|
||||
|
||||
@@ -90,7 +90,7 @@ oper
|
||||
regDigit : Str -> LinDigit = \vier ->
|
||||
mkDigit vier (vier + "zehn") (vier + "zig") (vier + "te") ;
|
||||
|
||||
invNum : CardOrd = NCard ;
|
||||
invNum : CardOrd = NCard Masc Nom ;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
||||
a = quant.a
|
||||
in {
|
||||
s = \\g,c => quant.s ! n ! g ! c ++
|
||||
num.s ++ ord.s ! agrAdj g (adjfCase a c) n c ;
|
||||
num.s!g!c ++ ord.s ! agrAdj g (adjfCase a c) n c ;
|
||||
n = n ;
|
||||
a = a
|
||||
} ;
|
||||
@@ -53,7 +53,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
||||
n = num.n ;
|
||||
a = quant.a
|
||||
in {
|
||||
s = \\g,c => quant.s ! n ! g ! c ++ num.s ;
|
||||
s = \\g,c => quant.s ! n ! g ! c ++ num.s!g!c ;
|
||||
n = n ;
|
||||
a = a
|
||||
} ;
|
||||
@@ -64,7 +64,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
||||
a = quant.a
|
||||
in {
|
||||
s = \\g,c => quant.s ! num.isNum ! n ! g ! c ++
|
||||
num.s ++ ord.s ! agrAdj g (adjfCase a c) n c ;
|
||||
num.s!g!c ++ ord.s ! agrAdj g (adjfCase a c) n c ;
|
||||
n = n ;
|
||||
a = a
|
||||
} ;
|
||||
@@ -75,7 +75,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
||||
a = quant.a
|
||||
in {
|
||||
s = \\g,c => quant.s ! True ! n ! g ! c ++
|
||||
num.s ;
|
||||
num.s!g!c ;
|
||||
n = n ;
|
||||
a = a
|
||||
} ;
|
||||
@@ -99,16 +99,16 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
||||
|
||||
NumCard n = n ** {isNum = True} ;
|
||||
|
||||
NumPl = {s = []; n = Pl ; isNum = False} ;
|
||||
NumSg = {s = []; n = Sg ; isNum = False} ;
|
||||
NumPl = {s = \\g,c => []; n = Pl ; isNum = False} ;
|
||||
NumSg = {s = \\g,c => []; n = Sg ; isNum = False} ;
|
||||
|
||||
NumDigits numeral = {s = numeral.s ! NCard; n = numeral.n } ;
|
||||
NumDigits numeral = {s = \\g,c => numeral.s ! NCard g c; n = numeral.n } ;
|
||||
OrdDigits numeral = {s = \\af => numeral.s ! NOrd af} ;
|
||||
|
||||
NumNumeral numeral = {s = numeral.s ! NCard; n = numeral.n } ;
|
||||
NumNumeral numeral = {s = \\g,c => numeral.s ! NCard g c; n = numeral.n } ;
|
||||
OrdNumeral numeral = {s = \\af => numeral.s ! NOrd af} ;
|
||||
|
||||
AdNum adn num = {s = adn.s ++ num.s; n = num.n } ;
|
||||
AdNum adn num = {s = \\g,c => adn.s ++ num.s!g!c; n = num.n } ;
|
||||
|
||||
OrdSuperl a = {s = a.s ! Superl} ;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ lin
|
||||
|
||||
pot01 = {
|
||||
s = \\f => table {
|
||||
NCard => "ein" ; ----
|
||||
NCard g c => "ein" + pronEnding ! GSg g ! c ;
|
||||
NOrd af => (regA "erst").s ! Posit ! af
|
||||
} ;
|
||||
n = Sg
|
||||
@@ -53,7 +53,7 @@ lin
|
||||
IDig d = d ;
|
||||
|
||||
IIDig d i = {
|
||||
s = \\o => d.s ! NCard ++ i.s ! o ;
|
||||
s = \\o => d.s ! invNum ++ i.s ! o ;
|
||||
n = Pl
|
||||
} ;
|
||||
|
||||
@@ -74,7 +74,7 @@ lin
|
||||
mkDig : Str -> TDigit = \c -> mk2Dig c (c + "e") ;
|
||||
|
||||
mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> {
|
||||
s = table {NCard => c ; NOrd _ => o} ;
|
||||
s = table {NCard _ _ => c ; NOrd _ => o} ;
|
||||
n = n
|
||||
} ;
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ concrete QuestionGer of Question = CatGer ** open ResGer in {
|
||||
let
|
||||
n = num.n
|
||||
in {
|
||||
s = \\g,c => idet.s ! n ! g ! c ++ num.s ;
|
||||
s = \\g,c => idet.s ! n ! g ! c ++ num.s!g!c ;
|
||||
n = n
|
||||
} ;
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ resource ResGer = ParamX ** open Prelude in {
|
||||
|
||||
--2 For $Numeral$
|
||||
|
||||
CardOrd = NCard | NOrd AForm ;
|
||||
CardOrd = NCard Gender Case | NOrd AForm ;
|
||||
DForm = DUnit | DTeen | DTen ;
|
||||
|
||||
--2 Transformations between parameter types
|
||||
|
||||
Reference in New Issue
Block a user