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} ;
|
Quant = {s : Number => Gender => Case => Str ; a : Adjf} ;
|
||||||
Art = {s : Bool => Number => Gender => Case => Str ; a : Adjf} ;
|
Art = {s : Bool => Number => Gender => Case => Str ; a : Adjf} ;
|
||||||
Predet = {s : Number => Gender => Case => Str} ;
|
Predet = {s : Number => Gender => Case => Str} ;
|
||||||
Num = {s : Str ; n : Number ; isNum : Bool} ;
|
Num = {s : Gender => Case => Str ; n : Number ; isNum : Bool} ;
|
||||||
Card = {s : Str ; n : Number} ;
|
Card = {s : Gender => Case => Str ; n : Number} ;
|
||||||
Ord = {s : AForm => Str} ;
|
Ord = {s : AForm => Str} ;
|
||||||
|
|
||||||
-- Numeral
|
-- Numeral
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ oper
|
|||||||
|
|
||||||
cardOrd : Str -> Str -> CardOrd => Str = \drei,dritte ->
|
cardOrd : Str -> Str -> CardOrd => Str = \drei,dritte ->
|
||||||
table {
|
table {
|
||||||
NCard => drei ;
|
NCard _ _ => drei ;
|
||||||
NOrd a => (regA (init dritte)).s ! Posit ! a
|
NOrd a => (regA (init dritte)).s ! Posit ! a
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ oper
|
|||||||
regDigit : Str -> LinDigit = \vier ->
|
regDigit : Str -> LinDigit = \vier ->
|
||||||
mkDigit vier (vier + "zehn") (vier + "zig") (vier + "te") ;
|
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
|
a = quant.a
|
||||||
in {
|
in {
|
||||||
s = \\g,c => quant.s ! n ! g ! c ++
|
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 ;
|
n = n ;
|
||||||
a = a
|
a = a
|
||||||
} ;
|
} ;
|
||||||
@@ -53,7 +53,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
|||||||
n = num.n ;
|
n = num.n ;
|
||||||
a = quant.a
|
a = quant.a
|
||||||
in {
|
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 ;
|
n = n ;
|
||||||
a = a
|
a = a
|
||||||
} ;
|
} ;
|
||||||
@@ -64,7 +64,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
|||||||
a = quant.a
|
a = quant.a
|
||||||
in {
|
in {
|
||||||
s = \\g,c => quant.s ! num.isNum ! n ! g ! c ++
|
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 ;
|
n = n ;
|
||||||
a = a
|
a = a
|
||||||
} ;
|
} ;
|
||||||
@@ -75,7 +75,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
|||||||
a = quant.a
|
a = quant.a
|
||||||
in {
|
in {
|
||||||
s = \\g,c => quant.s ! True ! n ! g ! c ++
|
s = \\g,c => quant.s ! True ! n ! g ! c ++
|
||||||
num.s ;
|
num.s!g!c ;
|
||||||
n = n ;
|
n = n ;
|
||||||
a = a
|
a = a
|
||||||
} ;
|
} ;
|
||||||
@@ -99,16 +99,16 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
|||||||
|
|
||||||
NumCard n = n ** {isNum = True} ;
|
NumCard n = n ** {isNum = True} ;
|
||||||
|
|
||||||
NumPl = {s = []; n = Pl ; isNum = False} ;
|
NumPl = {s = \\g,c => []; n = Pl ; isNum = False} ;
|
||||||
NumSg = {s = []; n = Sg ; 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} ;
|
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} ;
|
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} ;
|
OrdSuperl a = {s = a.s ! Superl} ;
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ lin
|
|||||||
|
|
||||||
pot01 = {
|
pot01 = {
|
||||||
s = \\f => table {
|
s = \\f => table {
|
||||||
NCard => "ein" ; ----
|
NCard g c => "ein" + pronEnding ! GSg g ! c ;
|
||||||
NOrd af => (regA "erst").s ! Posit ! af
|
NOrd af => (regA "erst").s ! Posit ! af
|
||||||
} ;
|
} ;
|
||||||
n = Sg
|
n = Sg
|
||||||
@@ -53,7 +53,7 @@ lin
|
|||||||
IDig d = d ;
|
IDig d = d ;
|
||||||
|
|
||||||
IIDig d i = {
|
IIDig d i = {
|
||||||
s = \\o => d.s ! NCard ++ i.s ! o ;
|
s = \\o => d.s ! invNum ++ i.s ! o ;
|
||||||
n = Pl
|
n = Pl
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ lin
|
|||||||
mkDig : Str -> TDigit = \c -> mk2Dig c (c + "e") ;
|
mkDig : Str -> TDigit = \c -> mk2Dig c (c + "e") ;
|
||||||
|
|
||||||
mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> {
|
mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> {
|
||||||
s = table {NCard => c ; NOrd _ => o} ;
|
s = table {NCard _ _ => c ; NOrd _ => o} ;
|
||||||
n = n
|
n = n
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ concrete QuestionGer of Question = CatGer ** open ResGer in {
|
|||||||
let
|
let
|
||||||
n = num.n
|
n = num.n
|
||||||
in {
|
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
|
n = n
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ resource ResGer = ParamX ** open Prelude in {
|
|||||||
|
|
||||||
--2 For $Numeral$
|
--2 For $Numeral$
|
||||||
|
|
||||||
CardOrd = NCard | NOrd AForm ;
|
CardOrd = NCard Gender Case | NOrd AForm ;
|
||||||
DForm = DUnit | DTeen | DTen ;
|
DForm = DUnit | DTeen | DTen ;
|
||||||
|
|
||||||
--2 Transformations between parameter types
|
--2 Transformations between parameter types
|
||||||
|
|||||||
Reference in New Issue
Block a user