forked from GitHub/gf-rgl
update combinenounphrase
This commit is contained in:
@@ -8,12 +8,12 @@ concrete AdjectiveLat of Adjective = CatLat ** open ResLat, Prelude in {
|
||||
|
||||
-- ComparA : A -> NP -> AP ; -- warmer than I
|
||||
ComparA a np = {
|
||||
s = \\ag => a.s ! Compar ! ag ++ "quam" ++ (combineNounPhrase np) ! PronNonDrop ! Nom ;
|
||||
s = \\ag => a.s ! Compar ! ag ++ "quam" ++ (combineNounPhrase np) ! PronNonDrop ! APostN ! DPreN ! Nom ;
|
||||
} ;
|
||||
|
||||
-- ComplA2 : A2 -> NP -> AP ; -- married to her
|
||||
ComplA2 a np = {
|
||||
s = \\ag => a.s ! Posit ! ag ++ a.c.s ++ (combineNounPhrase np) ! PronNonDrop ! a.c.c ;
|
||||
s = \\ag => a.s ! Posit ! ag ++ a.c.s ++ (combineNounPhrase np) ! PronNonDrop ! APostN ! DPreN ! a.c.c ;
|
||||
} ;
|
||||
|
||||
-- ReflA2 : A2 -> AP -- married to myself
|
||||
@@ -31,7 +31,7 @@ concrete AdjectiveLat of Adjective = CatLat ** open ResLat, Prelude in {
|
||||
|
||||
-- CAdvAP : CAdv -> AP -> NP -> AP ; -- as cool as John
|
||||
CAdvAP cadv ap np =
|
||||
{ s = \\ag => cadv.s ++ ap.s ! ag ++ cadv.p ++ (combineNounPhrase np) ! PronNonDrop ! Nom } ;
|
||||
{ s = \\ag => cadv.s ++ ap.s ! ag ++ cadv.p ++ (combineNounPhrase np) ! PronNonDrop ! APostN ! DPreN ! Nom } ;
|
||||
|
||||
-- The superlative use is covered in $Ord$.
|
||||
|
||||
|
||||
@@ -8,12 +8,12 @@ concrete AdverbLat of Adverb = CatLat ** open ResLat, Prelude, ParadigmsLat in
|
||||
|
||||
-- PrepNP : Prep -> NP -> Adv ; -- in the house
|
||||
PrepNP prep np =
|
||||
mkAdv (prep.s ++ (combineNounPhrase np) ! PronNonDrop ! prep.c ) ;
|
||||
mkAdv (prep.s ++ (combineNounPhrase np) ! PronNonDrop ! APostN ! DPreN ! prep.c ) ;
|
||||
|
||||
|
||||
-- ComparAdvAdj : CAdv -> A -> NP -> Adv ; -- more warmly than John
|
||||
ComparAdvAdj cadv a np =
|
||||
mkAdv (cadv.s ++ a.adv.s ! Compar ++ cadv.p ++ (combineNounPhrase np) ! PronNonDrop ! Nom) ;
|
||||
mkAdv (cadv.s ++ a.adv.s ! Compar ++ cadv.p ++ (combineNounPhrase np) ! PronNonDrop ! APostN ! DPreN ! Nom) ;
|
||||
|
||||
-- ComparAdvAdjS : CAdv -> A -> S -> Adv ; -- more warmly than he runs
|
||||
ComparAdvAdjS cadv a s =
|
||||
|
||||
@@ -87,7 +87,7 @@ concrete CatLat of Cat = CommonX-[Adv] ** open ResLat, ParamX, Prelude in {
|
||||
A2 = Adjective ** { c : Prep} ;
|
||||
|
||||
linref
|
||||
NP = \np -> combineNounPhrase np ! PronNonDrop ! Nom ;
|
||||
NP = \np -> combineNounPhrase np ! PronNonDrop ! APreN ! DPostN ! Nom ;
|
||||
VP = \vp -> vp.adv ++ vp.inf ! VInfActPres ++ vp.obj ++ vp.compl ! Ag Masc Sg Nom ;
|
||||
S = \s -> combineSentence s ! SPreO ! PreO ! CPreV ! SOV ;
|
||||
V, VS, VQ, VA, VV = \v -> v.act ! (VAct VSim (VPres VInd) Sg P1) ;
|
||||
|
||||
@@ -177,7 +177,7 @@ concrete NounLat of Noun = CatLat ** open ResLat, Prelude, ConjunctionLat in {
|
||||
ApposCN cn np =
|
||||
cn **
|
||||
{
|
||||
s = \\n,c => cn.s ! n ! c ++ (combineNounPhrase np) ! PronNonDrop ! c ;
|
||||
s = \\n,c => cn.s ! n ! c ++ (combineNounPhrase np) ! PronNonDrop ! APostN ! DPreN ! c ;
|
||||
} ; -- massable = cn.massable } ;
|
||||
|
||||
-- CountNP : Det -> NP -> NP ; -- three of them, some of the boys
|
||||
|
||||
@@ -18,7 +18,7 @@ concrete PhraseLat of Phrase = CatLat ** open Prelude, ResLat in {
|
||||
-- UttIAdv : IAdv -> Utt
|
||||
UttIAdv iadv = iadv ;
|
||||
-- UttNP : NP -> Utt
|
||||
UttNP np = {s = np.adv ++ (combineNounPhrase np) ! PronNonDrop ! Nom} ;
|
||||
UttNP np = {s = np.adv ++ (combineNounPhrase np) ! PronNonDrop ! APostN ! DPreN ! Nom} ;
|
||||
-- UttVP : VP -> Utt
|
||||
UttVP vp = ss (vp.inf ! VInfActPres) ;
|
||||
|
||||
@@ -36,6 +36,6 @@ concrete PhraseLat of Phrase = CatLat ** open Prelude, ResLat in {
|
||||
PConjConj conj = {s = conj.s2} ; ---
|
||||
--
|
||||
NoVoc = {s = []} ;
|
||||
VocNP np = {s = "," ++ (combineNounPhrase np) ! PronNonDrop ! ResLat.Voc} ; ---- what is the compiler error here? AR 1/2/2014 -- answer: clash with the type name Voc 3/2
|
||||
VocNP np = {s = bindComma ++ (combineNounPhrase np) ! PronNonDrop ! APostN ! DPreN ! ResLat.Voc} ; ---- what is the compiler error here? AR 1/2/2014 -- answer: clash with the type name Voc 3/2
|
||||
--
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ concrete QuestionLat of Question = CatLat ** open ResLat, IrregLat, Prelude in {
|
||||
s = \\_ => "" ;
|
||||
adv = "" ;
|
||||
neg = \\_,_ => "" ;
|
||||
o = \\_ => combineNounPhrase np ! PronNonDrop ! Nom ; -- Should probably not go into the object field
|
||||
o = \\_ => combineNounPhrase np ! PronNonDrop ! APostN ! DPreN ! Nom ; -- Should probably not go into the object field
|
||||
q = icomp.s ;
|
||||
v = \\t,a,_,ap,cp => esseAux.act ! VAct (anteriorityToVAnter a) (tenseToVTense t) np.n P3 ;
|
||||
vcompl = "" ;
|
||||
|
||||
@@ -26,7 +26,8 @@ param
|
||||
} ;
|
||||
param
|
||||
Order = SVO | VSO | VOS | OSV | OVS | SOV ;
|
||||
AdvPos = PreS | PreV | PreO | PreNeg | InV | InS ; -- | InO
|
||||
-- (verb-modifying) adverb position
|
||||
AdvPos = APreS | APreV | APreO | APreNeg | AInV | AInS | APreN | APostN ; -- | InO
|
||||
ComplPos = CPreV | CPostV ;
|
||||
SAdvPos = SPreS | SPreV | SPreO | SPreNeg ;
|
||||
param
|
||||
@@ -148,8 +149,13 @@ param
|
||||
|
||||
emptyNP : NounPhrase = { s = \\_,_ => ""; g = Masc; n = Sg; p = P1 ; adv = "" ; preap, postap = { s = \\_ => "" } ; det = { s = \\_,_ => "" ; sp = \\_,_ => "" ; n = Sg } ;};
|
||||
|
||||
combineNounPhrase : NounPhrase -> PronDropForm => Case => Str = \np ->
|
||||
\\pd,c => np.det.s ! np.g ! c ++ np.adv ++ np.preap.s ! (Ag np.g np.n c) ++ np.s ! pd ! c ++ np.postap.s ! (Ag np.g np.n c) ++ np.det.sp ! np.g ! c ;
|
||||
combineNounPhrase : NounPhrase -> PronDropForm => AdvPos => DetPos => Case => Str = \np ->
|
||||
let detpren : DetPos -> { s , sp : Case => Str} = \dp -> case dp of { DPreN => np.det ; _ => { s, sp = \\_ => [] } } ;
|
||||
detpostn : DetPos -> { s , sp : Case => Str} = \dp -> case dp of { DPostN => np.det ; _ => { s, sp = \\_ => [] } } ;
|
||||
apren : AdvPos -> Str = \ap -> case ap of { APreN => np.adv ; _ => [] } ;
|
||||
apostn : AdvPos -> Str = \ap -> case ap of { APostN => np.adv ; _ => [] } ;
|
||||
in
|
||||
\\pd,ap,dp,c => apren ap ++ (detpren dp).s ! c ++ np.preap.s ! (Ag np.g np.n c) ++ np.s ! pd ! c ++ np.postap.s ! (Ag np.g np.n c) ++ (detpren dp).sp ! c ++ (detpostn dp).s ! c ++ apostn ap ;
|
||||
-- also used for adjectives and so on
|
||||
|
||||
-- adjectives
|
||||
|
||||
@@ -115,7 +115,7 @@ concrete VerbLat of Verb = CatLat ** open (S=StructuralLat),ResLat,IrregLat,Extr
|
||||
|
||||
-- CompNP : NP -> Comp ; -- (be) the man
|
||||
CompNP np = {s = \\_ =>
|
||||
(combineNounPhrase np) ! PronNonDrop ! Nom
|
||||
(combineNounPhrase np) ! PronNonDrop ! APostN ! DPreN ! Nom ;
|
||||
} ;
|
||||
|
||||
-- CompAdv : Adv -> Comp ; -- (be) here
|
||||
|
||||
Reference in New Issue
Block a user