forked from GitHub/gf-rgl
generalize DAP
This commit is contained in:
@@ -70,13 +70,12 @@ concrete CatEng of Cat = CommonX - [Pol,SC] ** open ResEng, Prelude in {
|
||||
-- sp Nom | Poss. pron. (subj.) | mine
|
||||
-- sp Gen | Poss. pron. (obj.) | mine's
|
||||
Pron = {s : NPCase => Str ; sp : Case => Str ; a : Agr} ;
|
||||
Det = {s : Str ; sp : NPCase => Str ; n : Number ; hasNum : Bool} ;
|
||||
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 : Bool => Number => NPCase => Str} ;
|
||||
DAP = {s : Str ; n : Number} ;
|
||||
Quant = {s : Bool => Number => Str ; sp : Gender => Bool => Number => NPCase => Str} ;
|
||||
|
||||
-- Numeral
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ concrete ConjunctionEng of Conjunction =
|
||||
|
||||
ConjCN co ns = conjunctDistrTable2 Number Case co ns ** {g = Neutr} ; --- gender?
|
||||
|
||||
ConjDet c xs = let cxs = (conjunctDistrSS c xs).s in {s = cxs ; sp = \\_ => cxs ++ "one" ; hasNum = False ; n = xs.n} ;
|
||||
ConjDet c xs = let cxs = (conjunctDistrSS c xs).s in {s = cxs ; sp = \\_,_,_ => cxs ++ "one" ; hasNum = False ; n = xs.n} ;
|
||||
|
||||
-- These fun's are generated from the list cat's.
|
||||
|
||||
|
||||
@@ -19159,7 +19159,7 @@ lin everlasting_N = mkN "everlasting" ;
|
||||
lin everlastingness_N = mkN "everlastingness" ;
|
||||
lin evermore_Adv = mkAdv "evermore";
|
||||
lin eversion_N = mkN "eversion" ;
|
||||
lin every_Det = mkDeterminerSpec singular "every" "everyone" False ;
|
||||
lin every_Det = mkDeterminerSpec singular "every" "everyone" "everything" False ;
|
||||
lin everybody_NP = mkNP "everybody" "everybody" "everybody's" singular P3 human;
|
||||
lin everyday_A = compoundA (mkA "everyday");
|
||||
lin everyman_N = mkN "everyman" ;
|
||||
|
||||
@@ -10,7 +10,7 @@ concrete ExtendEng of Extend =
|
||||
MkVPS2, ConjVPS2, ComplVPS2, MkVPI2, ConjVPI2, ComplVPI2,
|
||||
Base_nr_RNP, Base_rn_RNP, Base_rr_RNP, ByVP, CompBareCN,
|
||||
CompIQuant, CompQS, CompS, CompVP, ComplBareVS, ComplGenVV, ComplSlashPartLast, ComplVPSVV, CompoundAP,
|
||||
CompoundN, ConjRNP, ConjVPS, ConsVPS, Cons_nr_RNP, Cons_rr_RNP, DetNPFem, EmbedPresPart, EmptyRelSlash,
|
||||
CompoundN, ConjRNP, ConjVPS, ConsVPS, Cons_nr_RNP, Cons_rr_RNP, DetNPMasc, DetNPFem, EmbedPresPart, EmptyRelSlash,
|
||||
ExistsNP, ExistCN, ExistMassCN, ExistPluralCN,
|
||||
FocusAP, FocusAdV, FocusAdv, FocusObj, GenIP, GenModIP, GenModNP, GenNP, GenRP,
|
||||
GerundAdv, GerundCN, GerundNP, IAdvAdv, ICompAP, InOrderToVP, MkVPS, NominalizeVPSlashNP,
|
||||
@@ -30,7 +30,7 @@ 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} ;
|
||||
GenIP ip = {s = \\_ => ip.s ! NCase Gen} ;
|
||||
GenRP nu cn = {
|
||||
s = \\c => "whose" ++ nu.s ! Nom ++
|
||||
@@ -59,12 +59,12 @@ concrete ExtendEng of Extend =
|
||||
} ;
|
||||
|
||||
DetNPMasc det = {
|
||||
s = det.sp ;
|
||||
s = det.sp ! Masc ! False ;
|
||||
a = agrgP3 det.n Masc
|
||||
} ;
|
||||
|
||||
DetNPFem det = {
|
||||
s = det.sp ;
|
||||
s = det.sp ! Fem ! False ;
|
||||
a = agrgP3 det.n Fem
|
||||
} ;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ 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} ;
|
||||
GenIP ip = {s = \\_ => ip.s ! NCase Gen} ;
|
||||
GenRP nu cn = {
|
||||
s = \\c => "whose" ++ nu.s ! Nom ++
|
||||
|
||||
@@ -17,12 +17,12 @@ resource MorphoEng = open Prelude, (Predef=Predef), ResEng in {
|
||||
oper
|
||||
|
||||
mkDeterminer : Number -> Str ->
|
||||
{s : Str ; sp : NPCase => Str; n : Number ; hasNum : Bool} = \n,s -> mkDeterminerSpec n s s False ; --- was True!?
|
||||
{s : Str ; sp : Gender => Bool => NPCase => Str; n : Number ; hasNum : Bool} = \n,s -> mkDeterminerSpec n s s s False ; --- was True!?
|
||||
|
||||
mkDeterminerSpec : Number -> Str -> Str -> Bool ->
|
||||
{s : Str ; sp : NPCase => Str; n : Number ; hasNum : Bool} = \n,s,sp,hasNum ->
|
||||
{s = s;
|
||||
sp = \\c => regGenitiveS sp ! npcase2case c ;
|
||||
mkDeterminerSpec : Number -> Str -> Str -> Str -> Bool ->
|
||||
{s : Str ; sp : Gender => Bool => NPCase => Str; n : Number ; hasNum : Bool} = \n,s,sp1,sp2,hasNum ->
|
||||
{s = s;
|
||||
sp = \\g,hasAdj,c => regGenitiveS (case g of {Masc=>sp1; Fem=>sp1; Neutr=>sp2}) ! npcase2case c ;
|
||||
n = n ;
|
||||
hasNum = hasNum ; --- doesn't matter when s = sp
|
||||
} ;
|
||||
|
||||
@@ -38,35 +38,37 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in {
|
||||
|
||||
DetQuant quant num = {
|
||||
s = quant.s ! num.hasCard ! num.n ++ num.s ! Nom;
|
||||
sp = \\c => case num.hasCard of {
|
||||
False => quant.sp ! num.hasCard ! num.n ! c ++ num.s ! Nom ;
|
||||
True => quant.s ! num.hasCard ! num.n ++ num.s ! npcase2case c
|
||||
} ;
|
||||
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
|
||||
} ;
|
||||
n = num.n ;
|
||||
hasNum = num.hasCard
|
||||
} ;
|
||||
|
||||
DetQuantOrd quant num ord = {
|
||||
s = quant.s ! num.hasCard ! num.n ++ num.s ! Nom ++ ord.s ! Nom;
|
||||
sp = \\c => quant.s ! num.hasCard ! num.n ++ num.s ! Nom ++ ord.s ! npcase2case c ;
|
||||
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 ;
|
||||
n = num.n ;
|
||||
hasNum = True
|
||||
} ;
|
||||
|
||||
DetNP det = {
|
||||
-- s = case det.hasNum of {True => \\_ => det.s ; _ => \\c => det.sp ! c} ;
|
||||
s = det.sp ;
|
||||
s = det.sp ! Neutr ! False ;
|
||||
a = agrP3 det.n
|
||||
} ;
|
||||
|
||||
PossPron p = {
|
||||
s = \\_,_ => p.s ! NCase Gen ;
|
||||
sp = \\_,_,c => p.sp ! npcase2case c
|
||||
sp = \\_,hasAdj,_,c => case hasAdj of {
|
||||
True => p.s ! NCase Gen ;
|
||||
False => p.sp ! npcase2case c
|
||||
}
|
||||
} ;
|
||||
|
||||
NumSg = {s = \\c => []; n = Sg ; hasCard = False} ;
|
||||
NumPl = {s = \\c => []; n = Pl ; hasCard = False} ;
|
||||
---b NoOrd = {s = []} ;
|
||||
|
||||
NumCard n = n ** {hasCard = True} ;
|
||||
|
||||
@@ -84,8 +86,8 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in {
|
||||
|
||||
DefArt = {
|
||||
s = \\hasCard,n => artDef ;
|
||||
sp = \\hasCard,n => case <n,hasCard> of {
|
||||
<Sg,False> => table { NCase Gen => "its"; _ => "it" } ;
|
||||
sp = \\g,hasCard,n => case <n,hasCard> of {
|
||||
<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
|
||||
}
|
||||
@@ -96,7 +98,7 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in {
|
||||
<Sg,False> => artIndef ;
|
||||
_ => []
|
||||
} ;
|
||||
sp = \\hasCard,n => case <n,hasCard> of {
|
||||
sp = \\g,hasCard,n => case <n,hasCard> of {
|
||||
<Sg,False> => table {NCase Gen => "one's"; _ => "one" };
|
||||
<Pl,False> => table {NCase Gen => "ones'"; _ => "ones" } ;
|
||||
_ => \\c => []
|
||||
@@ -150,15 +152,20 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in {
|
||||
PartNP cn np = {s = \\n,c => cn.s ! n ! c ++ "of" ++ np.s ! NPAcc ; g = cn.g} ;
|
||||
|
||||
CountNP det np = {
|
||||
s = \\c => det.sp ! c ++ "of" ++ np.s ! NPAcc ;
|
||||
s = \\c => det.sp ! Neutr ! False ! c ++ "of" ++ np.s ! NPAcc ;
|
||||
a = agrP3 det.n
|
||||
} ;
|
||||
|
||||
AdjDAP det ap = {
|
||||
s = det.s ++ ap.s ! agrgP3 det.n Masc ; --- post-ap's ? "this larger than life (movie)"
|
||||
n = det.n ;
|
||||
AdjDAP dap ap = {
|
||||
s = dap.s ++ ap.s ! agrgP3 dap.n Masc ; --- post-ap's ? "this larger than life (movie)"
|
||||
sp = \\g,_,c => case c of {
|
||||
NCase Gen => dap.sp ! g ! True ! NCase Nom ++ ap.s ! agrgP3 dap.n g ++ BIND ++ "'s" ;
|
||||
c => dap.sp ! g ! True ! c ++ ap.s ! agrgP3 dap.n g
|
||||
} ;
|
||||
n = dap.n ;
|
||||
hasNum = dap.hasNum
|
||||
} ;
|
||||
|
||||
DetDAP d = d ; -- forgetting sp and hasNumber
|
||||
DetDAP d = d ;
|
||||
|
||||
}
|
||||
|
||||
@@ -434,15 +434,16 @@ mkInterj : Str -> Interj
|
||||
nounPN n = lin PN {s = n.s ! singular ; g = n.g} ;
|
||||
|
||||
mkQuant = overload {
|
||||
mkQuant : (this, these : Str) -> Quant = \sg,pl -> mkQuantifier sg pl sg pl;
|
||||
mkQuant : (no_sg, no_pl, none_sg, non_pl : Str) -> Quant = mkQuantifier;
|
||||
mkQuant : (this, these : Str) -> Quant = \sg,pl -> mkQuantifier sg pl sg pl sg pl;
|
||||
mkQuant : (no_sg, no_pl, none_sg, non_pl : Str) -> Quant = \sg,pl,sg',pl' -> mkQuantifier sg pl sg' pl' sg' pl';
|
||||
} ;
|
||||
|
||||
mkQuantifier : Str -> Str -> Str -> Str -> Quant =
|
||||
\sg,pl,sg',pl' -> lin Quant {
|
||||
s = \\_ => table { Sg => sg ; Pl => pl } ;
|
||||
sp = \\_ => table {
|
||||
Sg => \\c => regGenitiveS sg' ! npcase2case c ; Pl => \\c => regGenitiveS pl' ! npcase2case c}
|
||||
mkQuantifier : Str -> Str -> Str -> Str -> Str -> Str -> Quant =
|
||||
\sg,pl,sg1',pl1',sg2',pl2' -> lin Quant {
|
||||
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}
|
||||
} ;
|
||||
|
||||
mkOrd : Str -> Ord = \x -> lin Ord { s = regGenitiveS x};
|
||||
|
||||
@@ -54,7 +54,7 @@ concrete StructuralEng of Structural = CatEng **
|
||||
during_Prep = mkPrep "during" ;
|
||||
either7or_DConj = mkConj "either" "or" singular ;
|
||||
everybody_NP = regNP "everybody" singular ;
|
||||
every_Det = mkDeterminerSpec singular "every" "everyone" False ;
|
||||
every_Det = mkDeterminerSpec singular "every" "everyone" "everything" False ;
|
||||
everything_NP = regNP "everything" singular ;
|
||||
everywhere_Adv = mkAdv "everywhere" ;
|
||||
few_Det = mkDeterminer plural "few" ;
|
||||
|
||||
Reference in New Issue
Block a user