forked from GitHub/gf-rgl
make it possible to add more cardinals
This commit is contained in:
@@ -73,9 +73,9 @@ concrete CatEng of Cat = CommonX - [Pol,SC] ** open ResEng, Prelude in {
|
||||
DAP, Det = {s : Str ; sp : Gender => Bool => NPCase => Str ; n : Number ; hasNum : Bool} ;
|
||||
Predet = {s : Str} ;
|
||||
Ord = { s : Case => Str } ;
|
||||
Num = {s : Case => Str ; n : Number ; hasCard : Bool} ;
|
||||
Card = {s : Case => Str ; n : Number} ;
|
||||
Quant = {s : Bool => Number => Str ; sp : Gender => Bool => Number => NPCase => Str} ;
|
||||
Num = {s,sp : Bool => Case => Str ; n : Number ; hasCard : Bool} ;
|
||||
Card = {s,sp : Bool => Case => Str ; n : Number} ;
|
||||
Quant = {s : Bool => Number => Str ; sp : Gender => Bool => Number => NPCase => Str; isDef : Bool} ;
|
||||
|
||||
-- Numeral
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ concrete CompatibilityEng of Compatibility = CatEng ** open Prelude, ResEng in {
|
||||
-- from Noun 19/4/2008
|
||||
|
||||
lin
|
||||
NumInt n = {s = addGenitiveS n.s ; n = Pl ; hasCard = True} ;
|
||||
OrdInt n = {s = \\c => n.s ++ (regGenitiveS "th")!c } ;
|
||||
NumInt n = {s,sp = \\_ => addGenitiveS n.s ; n = Pl ; hasCard = True} ;
|
||||
OrdInt n = {s = \\c => n.s ++ (regGenitiveS "th")!c } ;
|
||||
|
||||
oper
|
||||
-- Note: this results in a space before 's, but there's
|
||||
|
||||
@@ -30,10 +30,10 @@ concrete ExtendEng of Extend =
|
||||
ParadigmsEng in {
|
||||
|
||||
lin
|
||||
GenNP np = {s = \\_,_ => np.s ! npGen ; sp = \\_,_,_,_ => np.s ! npGen} ;
|
||||
GenNP np = {s = \\_,_ => np.s ! npGen ; sp = \\_,_,_,_ => np.s ! npGen ; isDef = True} ;
|
||||
GenIP ip = {s = \\_ => ip.s ! NCase Gen} ;
|
||||
GenRP nu cn = {
|
||||
s = \\c => "whose" ++ nu.s ! Nom ++
|
||||
s = \\c => "whose" ++ nu.s ! False ! Nom ++
|
||||
case c of {
|
||||
RC _ (NCase Gen) => cn.s ! nu.n ! Gen ;
|
||||
_ => cn.s ! nu.n ! Nom
|
||||
@@ -313,7 +313,7 @@ concrete ExtendEng of Extend =
|
||||
lin
|
||||
ReflRNP vps rnp = insertObjPre (\\a => vps.c2 ++ rnp.s ! a) vps ;
|
||||
ReflPron = {s = reflPron} ;
|
||||
ReflPoss num cn = {s = \\a => possPron ! a ++ num.s ! Nom ++ cn.s ! num.n ! Nom} ;
|
||||
ReflPoss num cn = {s = \\a => possPron ! a ++ num.s ! True ! Nom ++ cn.s ! num.n ! Nom} ;
|
||||
PredetRNP predet rnp = {s = \\a => predet.s ++ rnp.s ! a} ;
|
||||
|
||||
ConjRNP conj rpns = conjunctDistrTable Agr conj rpns ;
|
||||
|
||||
@@ -2,10 +2,10 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
|
||||
open ResEng, Coordination, Prelude, MorphoEng, ParadigmsEng in {
|
||||
|
||||
lin
|
||||
GenNP np = {s = \\_,_ => np.s ! npGen ; sp = \\_,_,_,_ => np.s ! npGen} ;
|
||||
GenNP np = {s = \\_,_ => np.s ! npGen ; sp = \\_,_,_,_ => np.s ! npGen; isDef = True} ;
|
||||
GenIP ip = {s = \\_ => ip.s ! NCase Gen} ;
|
||||
GenRP nu cn = {
|
||||
s = \\c => "whose" ++ nu.s ! Nom ++
|
||||
s = \\c => "whose" ++ nu.s ! False ! Nom ++
|
||||
case c of {
|
||||
RC _ (NCase Gen) => cn.s ! nu.n ! Gen ;
|
||||
_ => cn.s ! nu.n ! Nom
|
||||
@@ -288,7 +288,7 @@ lin
|
||||
lin
|
||||
ReflRNP vps rnp = insertObjPre (\\a => vps.c2 ++ rnp.s ! a) vps ;
|
||||
ReflPron = {s = reflPron} ;
|
||||
ReflPoss num cn = {s = \\a => possPron ! a ++ num.s ! Nom ++ cn.s ! num.n ! Nom} ;
|
||||
ReflPoss num cn = {s = \\a => possPron ! a ++ num.s ! True ! Nom ++ cn.s ! num.n ! Nom} ;
|
||||
PredetRNP predet rnp = {s = \\a => predet.s ++ rnp.s ! a} ;
|
||||
|
||||
ConjRNP conj rpns = conjunctDistrTable Agr conj rpns ;
|
||||
|
||||
@@ -36,19 +36,20 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in {
|
||||
a = np.a
|
||||
} ;
|
||||
|
||||
|
||||
DetQuant quant num = {
|
||||
s = quant.s ! num.hasCard ! num.n ++ num.s ! Nom;
|
||||
s = quant.s ! num.hasCard ! num.n ++ num.s ! quant.isDef ! Nom;
|
||||
sp = \\g,hasAdj,c => case num.hasCard of {
|
||||
False => quant.sp ! g ! (orB hasAdj num.hasCard) ! num.n ! c ++ num.s ! Nom ;
|
||||
True => quant.s ! num.hasCard ! num.n ++ num.s ! npcase2case c
|
||||
False => quant.sp ! g ! hasAdj ! num.n ! c ++ num.s ! quant.isDef ! Nom ;
|
||||
True => quant.s ! True ! num.n ++ num.sp ! quant.isDef ! npcase2case c
|
||||
} ;
|
||||
n = num.n ;
|
||||
hasNum = num.hasCard
|
||||
} ;
|
||||
|
||||
DetQuantOrd quant num ord = {
|
||||
s = quant.s ! num.hasCard ! num.n ++ num.s ! Nom ++ ord.s ! Nom;
|
||||
sp = \\g,_,c => quant.s ! num.hasCard ! num.n ++ num.s ! Nom ++ ord.s ! npcase2case c ;
|
||||
s = quant.s ! num.hasCard ! num.n ++ num.s ! quant.isDef ! Nom ++ ord.s ! Nom;
|
||||
sp = \\g,_,c => quant.s ! num.hasCard ! num.n ++ num.s ! quant.isDef ! Nom ++ ord.s ! npcase2case c ;
|
||||
n = num.n ;
|
||||
hasNum = True
|
||||
} ;
|
||||
@@ -64,21 +65,24 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in {
|
||||
sp = \\_,hasAdj,_,c => case hasAdj of {
|
||||
True => p.s ! NCase Gen ;
|
||||
False => p.sp ! npcase2case c
|
||||
}
|
||||
} ;
|
||||
isDef = True
|
||||
} ;
|
||||
|
||||
NumSg = {s = \\c => []; n = Sg ; hasCard = False} ;
|
||||
NumPl = {s = \\c => []; n = Pl ; hasCard = False} ;
|
||||
NumSg = {s,sp = \\_,c => []; n = Sg ; hasCard = False} ;
|
||||
NumPl = {s,sp = \\_,c => []; n = Pl ; hasCard = False} ;
|
||||
|
||||
NumCard n = n ** {hasCard = True} ;
|
||||
|
||||
NumDigits n = {s = n.s ! NCard ; n = n.n} ;
|
||||
OrdDigits n = {s = n.s ! NOrd} ;
|
||||
NumDigits n = {s,sp = \\_ => n.s ! NCard ; n = n.n} ;
|
||||
OrdDigits n = {s = n.s ! NOrd} ;
|
||||
|
||||
NumNumeral numeral = {s = numeral.s ! NCard; n = numeral.n} ;
|
||||
OrdNumeral numeral = {s = numeral.s ! NOrd} ;
|
||||
NumNumeral numeral = {s,sp = \\_ => numeral.s ! NCard; n = numeral.n} ;
|
||||
OrdNumeral numeral = {s = numeral.s ! NOrd} ;
|
||||
|
||||
AdNum adn num = {s = \\c => adn.s ++ num.s!c ; n = num.n} ;
|
||||
AdNum adn num = {s = \\_,c => adn.s ++ num.s !False!c ;
|
||||
sp = \\_,c => adn.s ++ num.sp!False!c ;
|
||||
n = num.n} ;
|
||||
|
||||
OrdSuperl a = {s = \\c => a.s ! AAdj Superl c } ;
|
||||
|
||||
@@ -90,7 +94,8 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in {
|
||||
<Sg,False> => table { NCase Gen => table Gender ["its"; "his"; "her"] ! g; _ => table Gender ["it"; "he"; "she"] ! g } ;
|
||||
<Pl,False> => table { NCase Nom => "they"; NPAcc => "them"; _ => "theirs" } ;
|
||||
_ => \\c => artDef
|
||||
}
|
||||
} ;
|
||||
isDef = True
|
||||
} ;
|
||||
|
||||
IndefArt = {
|
||||
@@ -102,7 +107,8 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in {
|
||||
<Sg,False> => table {NCase Gen => "one's"; _ => "one" };
|
||||
<Pl,False> => table {NCase Gen => "ones'"; _ => "ones" } ;
|
||||
_ => \\c => []
|
||||
}
|
||||
} ;
|
||||
isDef = False
|
||||
} ;
|
||||
|
||||
MassNP cn = {
|
||||
|
||||
@@ -443,7 +443,8 @@ mkInterj : Str -> Interj
|
||||
s = \\_ => table { Sg => sg ; Pl => pl } ;
|
||||
sp = \\g,_ => table {
|
||||
Sg => \\c => regGenitiveS (case g of {Masc=>sg1'; Fem=>sg1'; Neutr=>sg2'}) ! npcase2case c ;
|
||||
Pl => \\c => regGenitiveS (case g of {Masc=>pl1'; Fem=>pl1'; Neutr=>pl2'}) ! npcase2case c}
|
||||
Pl => \\c => regGenitiveS (case g of {Masc=>pl1'; Fem=>pl1'; Neutr=>pl2'}) ! npcase2case c} ;
|
||||
isDef = True
|
||||
} ;
|
||||
|
||||
mkOrd : Str -> Ord = \x -> lin Ord { s = regGenitiveS x};
|
||||
|
||||
@@ -15,7 +15,7 @@ concrete PhraseEng of Phrase = CatEng ** open Prelude, ResEng in {
|
||||
UttVP vp = {s = infVP VVInf vp False Simul CPos (agrP3 Sg)} ;
|
||||
UttAdv adv = adv ;
|
||||
UttCN n = {s = n.s ! Sg ! Nom} ;
|
||||
UttCard n = {s = n.s ! Nom} ;
|
||||
UttCard n = {s = n.s ! False ! Nom} ;
|
||||
UttAP ap = {s = ap.s ! agrP3 Sg} ;
|
||||
UttInterj i = i ;
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ concrete QuestionEng of Question = CatEng ** open ResEng, Prelude in {
|
||||
} ;
|
||||
|
||||
IdetQuant idet num = {
|
||||
s = idet.s ! num.n ++ num.s ! Nom ;
|
||||
s = idet.s ! num.n ++ num.s ! False ! Nom ;
|
||||
n = num.n
|
||||
} ;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ lin
|
||||
SymbPN i = {s = addGenitiveS i.s ; g = Neutr} ;
|
||||
IntPN i = {s = addGenitiveS i.s ; g = Neutr} ;
|
||||
FloatPN i = {s = addGenitiveS i.s ; g = Neutr} ;
|
||||
NumPN i = {s = i.s ; g = Neutr} ;
|
||||
NumPN i = {s = i.s ! False ; g = Neutr} ;
|
||||
CNIntNP cn i = {
|
||||
s = \\c => cn.s ! Sg ! Nom ++ (addGenitiveS i.s) ! npcase2case c ;
|
||||
a = agrgP3 Sg cn.g
|
||||
@@ -16,14 +16,14 @@ lin
|
||||
a = agrgP3 det.n cn.g
|
||||
} ;
|
||||
CNNumNP cn i = {
|
||||
s = \\c => cn.s ! Sg ! Nom ++ i.s ! npcase2case c ;
|
||||
s = \\c => cn.s ! Sg ! Nom ++ i.s ! False ! npcase2case c ;
|
||||
a = agrgP3 Sg cn.g
|
||||
} ;
|
||||
|
||||
SymbS sy = sy ;
|
||||
|
||||
SymbNum sy = { s = addGenitiveS sy.s ; n = Pl ; hasCard = True } ;
|
||||
SymbOrd sy = { s = \\c => sy.s ++ (regGenitiveS "th")!c} ;
|
||||
SymbNum sy = { s,sp = \\_ => addGenitiveS sy.s ; n = Pl ; hasCard = True } ;
|
||||
SymbOrd sy = { s = \\c => sy.s ++ (regGenitiveS "th")!c} ;
|
||||
|
||||
lincat
|
||||
|
||||
|
||||
Reference in New Issue
Block a user