From 2d5a1118936c0b28c964558e1aa6b297e67ad45b Mon Sep 17 00:00:00 2001 From: Herbert Lange Date: Tue, 12 Nov 2019 14:44:46 +0100 Subject: [PATCH] update combinenounphrase --- src/latin/AdjectiveLat.gf | 6 +++--- src/latin/AdverbLat.gf | 4 ++-- src/latin/CatLat.gf | 2 +- src/latin/NounLat.gf | 2 +- src/latin/PhraseLat.gf | 4 ++-- src/latin/QuestionLat.gf | 2 +- src/latin/ResLat.gf | 12 +++++++++--- src/latin/VerbLat.gf | 2 +- 8 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/latin/AdjectiveLat.gf b/src/latin/AdjectiveLat.gf index 199ef20fa..6242dfcd4 100644 --- a/src/latin/AdjectiveLat.gf +++ b/src/latin/AdjectiveLat.gf @@ -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$. diff --git a/src/latin/AdverbLat.gf b/src/latin/AdverbLat.gf index db44f63fa..4c54ed03f 100644 --- a/src/latin/AdverbLat.gf +++ b/src/latin/AdverbLat.gf @@ -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 = diff --git a/src/latin/CatLat.gf b/src/latin/CatLat.gf index 1b7fab347..26537bda6 100644 --- a/src/latin/CatLat.gf +++ b/src/latin/CatLat.gf @@ -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) ; diff --git a/src/latin/NounLat.gf b/src/latin/NounLat.gf index e52cd3c94..d671ac5a4 100644 --- a/src/latin/NounLat.gf +++ b/src/latin/NounLat.gf @@ -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 diff --git a/src/latin/PhraseLat.gf b/src/latin/PhraseLat.gf index fa6fd9df0..828c17b0b 100644 --- a/src/latin/PhraseLat.gf +++ b/src/latin/PhraseLat.gf @@ -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 -- } diff --git a/src/latin/QuestionLat.gf b/src/latin/QuestionLat.gf index f9c2348e8..702d9f53e 100644 --- a/src/latin/QuestionLat.gf +++ b/src/latin/QuestionLat.gf @@ -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 = "" ; diff --git a/src/latin/ResLat.gf b/src/latin/ResLat.gf index 2ebbbb14c..f888f6742 100644 --- a/src/latin/ResLat.gf +++ b/src/latin/ResLat.gf @@ -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 diff --git a/src/latin/VerbLat.gf b/src/latin/VerbLat.gf index 8c8f30ebd..384a0b686 100644 --- a/src/latin/VerbLat.gf +++ b/src/latin/VerbLat.gf @@ -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