1
0
forked from GitHub/gf-rgl

update combinenounphrase

This commit is contained in:
Herbert Lange
2019-11-12 14:44:46 +01:00
parent 57ba9c240a
commit 2d5a111893
8 changed files with 20 additions and 14 deletions

View File

@@ -8,12 +8,12 @@ concrete AdjectiveLat of Adjective = CatLat ** open ResLat, Prelude in {
-- ComparA : A -> NP -> AP ; -- warmer than I -- ComparA : A -> NP -> AP ; -- warmer than I
ComparA a np = { 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 : A2 -> NP -> AP ; -- married to her
ComplA2 a np = { 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 -- 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 -> AP ; -- as cool as John
CAdvAP cadv ap np = 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$. -- The superlative use is covered in $Ord$.

View File

@@ -8,12 +8,12 @@ concrete AdverbLat of Adverb = CatLat ** open ResLat, Prelude, ParadigmsLat in
-- PrepNP : Prep -> NP -> Adv ; -- in the house -- PrepNP : Prep -> NP -> Adv ; -- in the house
PrepNP prep np = 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 -> Adv ; -- more warmly than John
ComparAdvAdj cadv a np = 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 -> Adv ; -- more warmly than he runs
ComparAdvAdjS cadv a s = ComparAdvAdjS cadv a s =

View File

@@ -87,7 +87,7 @@ concrete CatLat of Cat = CommonX-[Adv] ** open ResLat, ParamX, Prelude in {
A2 = Adjective ** { c : Prep} ; A2 = Adjective ** { c : Prep} ;
linref 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 ; VP = \vp -> vp.adv ++ vp.inf ! VInfActPres ++ vp.obj ++ vp.compl ! Ag Masc Sg Nom ;
S = \s -> combineSentence s ! SPreO ! PreO ! CPreV ! SOV ; S = \s -> combineSentence s ! SPreO ! PreO ! CPreV ! SOV ;
V, VS, VQ, VA, VV = \v -> v.act ! (VAct VSim (VPres VInd) Sg P1) ; V, VS, VQ, VA, VV = \v -> v.act ! (VAct VSim (VPres VInd) Sg P1) ;

View File

@@ -177,7 +177,7 @@ concrete NounLat of Noun = CatLat ** open ResLat, Prelude, ConjunctionLat in {
ApposCN cn np = ApposCN cn np =
cn ** 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 } ; } ; -- massable = cn.massable } ;
-- CountNP : Det -> NP -> NP ; -- three of them, some of the boys -- CountNP : Det -> NP -> NP ; -- three of them, some of the boys

View File

@@ -18,7 +18,7 @@ concrete PhraseLat of Phrase = CatLat ** open Prelude, ResLat in {
-- UttIAdv : IAdv -> Utt -- UttIAdv : IAdv -> Utt
UttIAdv iadv = iadv ; UttIAdv iadv = iadv ;
-- UttNP : NP -> Utt -- 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 -> Utt
UttVP vp = ss (vp.inf ! VInfActPres) ; UttVP vp = ss (vp.inf ! VInfActPres) ;
@@ -36,6 +36,6 @@ concrete PhraseLat of Phrase = CatLat ** open Prelude, ResLat in {
PConjConj conj = {s = conj.s2} ; --- PConjConj conj = {s = conj.s2} ; ---
-- --
NoVoc = {s = []} ; 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
-- --
} }

View File

@@ -38,7 +38,7 @@ concrete QuestionLat of Question = CatLat ** open ResLat, IrregLat, Prelude in {
s = \\_ => "" ; s = \\_ => "" ;
adv = "" ; adv = "" ;
neg = \\_,_ => "" ; 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 ; q = icomp.s ;
v = \\t,a,_,ap,cp => esseAux.act ! VAct (anteriorityToVAnter a) (tenseToVTense t) np.n P3 ; v = \\t,a,_,ap,cp => esseAux.act ! VAct (anteriorityToVAnter a) (tenseToVTense t) np.n P3 ;
vcompl = "" ; vcompl = "" ;

View File

@@ -26,7 +26,8 @@ param
} ; } ;
param param
Order = SVO | VSO | VOS | OSV | OVS | SOV ; 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 ; ComplPos = CPreV | CPostV ;
SAdvPos = SPreS | SPreV | SPreO | SPreNeg ; SAdvPos = SPreS | SPreV | SPreO | SPreNeg ;
param param
@@ -148,8 +149,13 @@ param
emptyNP : NounPhrase = { s = \\_,_ => ""; g = Masc; n = Sg; p = P1 ; adv = "" ; preap, postap = { s = \\_ => "" } ; det = { s = \\_,_ => "" ; sp = \\_,_ => "" ; n = Sg } ;}; emptyNP : NounPhrase = { s = \\_,_ => ""; g = Masc; n = Sg; p = P1 ; adv = "" ; preap, postap = { s = \\_ => "" } ; det = { s = \\_,_ => "" ; sp = \\_,_ => "" ; n = Sg } ;};
combineNounPhrase : NounPhrase -> PronDropForm => Case => Str = \np -> combineNounPhrase : NounPhrase -> PronDropForm => AdvPos => DetPos => 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 ; 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 -- also used for adjectives and so on
-- adjectives -- adjectives

View File

@@ -115,7 +115,7 @@ concrete VerbLat of Verb = CatLat ** open (S=StructuralLat),ResLat,IrregLat,Extr
-- CompNP : NP -> Comp ; -- (be) the man -- CompNP : NP -> Comp ; -- (be) the man
CompNP np = {s = \\_ => CompNP np = {s = \\_ =>
(combineNounPhrase np) ! PronNonDrop ! Nom (combineNounPhrase np) ! PronNonDrop ! APostN ! DPreN ! Nom ;
} ; } ;
-- CompAdv : Adv -> Comp ; -- (be) here -- CompAdv : Adv -> Comp ; -- (be) here