From 40c8c5f9230dafe631c3ad1142f6712ab431399b Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sat, 20 Apr 2019 10:27:59 +0200 Subject: [PATCH] (Extend) Rename WhatSSC to EmbedSSlash and change type to SSlash -> SC --- src/abstract/Extend.gf | 6 ++++-- src/arabic/ExtendAra.gf | 6 +++++- src/arabic/SentenceAra.gf | 2 +- src/common/ExtendFunctor.gf | 2 +- src/english/ExtendEng.gf | 4 ++-- src/finnish/ExtendFin.gf | 13 ++++++++++++- src/persian/ExtendPes.gf | 5 ++++- src/spanish/ExtendSpa.gf | 2 +- src/swedish/ExtendSwe.gf | 4 ++-- 9 files changed, 32 insertions(+), 12 deletions(-) diff --git a/src/abstract/Extend.gf b/src/abstract/Extend.gf index ab198595..5e5039d0 100644 --- a/src/abstract/Extend.gf +++ b/src/abstract/Extend.gf @@ -148,9 +148,11 @@ abstract Extend = Cat ** { PredIAdvVP : IAdv -> VP -> QCl ; -- how to walk? --- alternative SC, with "what" +-- alternative to EmbedQS. For English, EmbedQS happens to work, +-- because "what" introduces question and relative. The default linearization +-- could be e.g. "the thing we did (was fun)". - WhatSSC : S -> SC ; -- what we did (was fun) + EmbedSSlash : SSlash -> SC ; -- what we did (was fun) -- reflexive noun phrases: a generalization of Verb.ReflVP, which covers just reflexive pronouns -- This is necessary in languages like Swedish, which have special reflexive possessives. diff --git a/src/arabic/ExtendAra.gf b/src/arabic/ExtendAra.gf index 9aa92abc..ec643783 100644 --- a/src/arabic/ExtendAra.gf +++ b/src/arabic/ExtendAra.gf @@ -5,7 +5,8 @@ concrete ExtendAra of Extend = GenNP, ApposNP, ICompAP, DetNPMasc, DetNPFem, EmptyRelSlash, PredAPVP, ComplDirectVS, ComplDirectVQ, -- because of Utt - VPS, MkVPS, PredVPS, BaseVPS, ConsVPS, ConjVPS + VPS, MkVPS, PredVPS, BaseVPS, ConsVPS, ConjVPS, + EmbedSSlash ] with (Grammar=GrammarAra) ** open @@ -46,6 +47,9 @@ lin -- : ClSlash -> RCl -- he lives in EmptyRelSlash = RelSlash (IdRP ** {s = \\_ => []}) ; + -- : SSlash -> SC + EmbedSSlash = Grammar.EmbedS ; + lincat VPS = {s : PerGenNum => Str} ; -- finite VP's with tense and polarity [VPS] = {s1,s2 : PerGenNum => Str} ; diff --git a/src/arabic/SentenceAra.gf b/src/arabic/SentenceAra.gf index 21ad52dd..0ee3a32a 100644 --- a/src/arabic/SentenceAra.gf +++ b/src/arabic/SentenceAra.gf @@ -42,7 +42,7 @@ concrete SentenceAra of Sentence = CatAra ** open -- SlashVS np vs sslash = TODO - EmbedS s = {s = "أَنْ" ++ s.s ! Verbal} ; + EmbedS s = {s = "مَا" ++ s.s ! Verbal} ; EmbedQS qs = {s = qs.s ! QIndir} ; EmbedVP vp = {s = uttVP VPPerf vp ! Masc} ; -- TODO: use VPGer once it's more stable diff --git a/src/common/ExtendFunctor.gf b/src/common/ExtendFunctor.gf index b338707a..311d712b 100644 --- a/src/common/ExtendFunctor.gf +++ b/src/common/ExtendFunctor.gf @@ -64,7 +64,7 @@ lin FrontComplDirectVQ = variants {} ; -- NP -> VQ -> Utt -> Cl ; -- "where", she asked PredAPVP ap vp = ImpersCl (UseComp (CompAP (SentAP ap (EmbedVP vp)))) ; -- DEFAULT it is (good to walk) PredIAdvVP iadv vp = QuestIAdv iadv (GenericCl vp) ; -- DEFAULT how does one walk - WhatSSC = EmbedS ; -- DEFAULT that we did (was fun) + EmbedSSlash = variants {} ; -- SSlash -> SC ; -- what we did (was fun) AdjAsCN = variants {} ; -- AP -> CN ; -- a green one ; en grön (Swe) AdjAsNP = variants {} ; -- AP -> NP ; -- green (is good) ReflRNP = variants {} ; -- VPSlash -> RNP -> VP ; -- love my family and myself diff --git a/src/english/ExtendEng.gf b/src/english/ExtendEng.gf index 7164bbc6..3af375bf 100644 --- a/src/english/ExtendEng.gf +++ b/src/english/ExtendEng.gf @@ -15,7 +15,7 @@ concrete ExtendEng of Extend = FocusAP, FocusAdV, FocusAdv, FocusObj, GenIP, GenModIP, GenModNP, GenNP, GenRP, GerundAdv, GerundCN, GerundNP, IAdvAdv, ICompAP, InOrderToVP, MkVPS, NominalizeVPSlashNP, PassAgentVPSlash, PassVPSlash, PastPartAP, PastPartAgentAP, PositAdVAdj, PredVPS, PredVPSVV, PredetRNP, PrepCN, - WhatSSC, PredIAdvVP, PresPartAP, PurposeVP, ReflPoss, ReflPron, ReflRNP, SlashBareV2S, SlashV2V, StrandQuestSlash, StrandRelSlash, + EmbedSSlash, PredIAdvVP, PresPartAP, PurposeVP, ReflPoss, ReflPron, ReflRNP, SlashBareV2S, SlashV2V, StrandQuestSlash, StrandRelSlash, UncontractedNeg, UttAccIP, UttAccNP, UttAdV, UttDatIP, UttDatNP, UttVPShort, WithoutVP, BaseVPS2, ConsVPS2, ConjVPS2, ComplVPS2, MkVPS2 ] with @@ -193,7 +193,7 @@ concrete ExtendEng of Extend = PredIAdvVP iadv vp = {s = \\t,a,p,q => iadv.s ++ infVP VVInf vp False Simul CPos (agrP3 Sg)} ; - WhatSSC s = {s = \\_ => "what" ++ s.s} ; + EmbedSSlash s = {s = \\_ => "what" ++ s.s ++ s.c2} ; NominalizeVPSlashNP vpslash np = let vp : ResEng.VP = insertObjPre (\\_ => vpslash.c2 ++ np.s ! NPAcc) vpslash ; diff --git a/src/finnish/ExtendFin.gf b/src/finnish/ExtendFin.gf index eefeb0a1..0a6827ff 100644 --- a/src/finnish/ExtendFin.gf +++ b/src/finnish/ExtendFin.gf @@ -5,7 +5,7 @@ concrete ExtendFin of Extend = VPI2,VPS2,MkVPS,MkVPS2,ConjVPS2,ComplVPS2, ConsVPS, BaseVPS, ListVPS, VPS, ConjVPS,PredVPS, MkVPI2,ConjVPI2,ComplVPI2,ComplVPIVV ,ExistCN, ExistMassCN, ICompAP, ByVP - ,CompoundN, GenNP, GenIP, AdvIsNP + ,CompoundN, GenNP, GenIP, AdvIsNP, EmbedSSlash ] with (Grammar = GrammarFin) ** @@ -149,4 +149,15 @@ lin ByVP vp = lin Adv {s = S.infVP vp.s.sc Pos (Ag Sg P3) vp Inf3Adess} ; ---- Agr ? AdvIsNP adv np = S.mkClause (\_ -> adv.s) np.a (UseComp (CompNP np)) ; + + -- : SSlash -> SC + EmbedSSlash ss = + let it_NP : NP = UsePron it_Pron ; + thatWhich : NP = it_NP ** { + s = \\nc => it_NP.s ! NPSep ++ case nc of { + NPCase c => mikaInt ! Sg ! c ; + NPAcc => mikaInt ! Sg ! Gen ; + NPSep => mikaInt ! Sg ! Nom } + } ; + in {s = appCompl True Pos ss.c2 thatWhich ++ ss.s} ; } diff --git a/src/persian/ExtendPes.gf b/src/persian/ExtendPes.gf index 91ccc932..33892c7b 100644 --- a/src/persian/ExtendPes.gf +++ b/src/persian/ExtendPes.gf @@ -3,7 +3,7 @@ concrete ExtendPes of Extend = CatPes ** ExtendFunctor - [ GenNP, ApposNP, ICompAP, AdvIsNP, InOrderToVP, ByVP - ,GerundNP,GerundCN,GerundAdv,EmbedPresPart + ,GerundNP,GerundCN,GerundAdv,EmbedPresPart,EmbedSSlash ] with (Grammar=GrammarPes) ** open Prelude, ResPes in { @@ -33,6 +33,9 @@ lin -- : VP -> SC ; EmbedPresPart vp = lin SC {s = showVPH Inf defaultAgr vp} ; + -- : SSlash -> SC + EmbedSSlash ss = {s = conjThat ++ ss.s ! Indic ++ ss.c2.s} ; + -- : Adv -> NP -> Cl -- here is the car / here are the cars AdvIsNP adv np = mkClause (indeclNP adv.s ** {a = np.a}) (UseComp (CompNP np)) ; diff --git a/src/spanish/ExtendSpa.gf b/src/spanish/ExtendSpa.gf index 05cd6fe1..0ee8aab4 100644 --- a/src/spanish/ExtendSpa.gf +++ b/src/spanish/ExtendSpa.gf @@ -61,7 +61,7 @@ concrete ExtendSpa of Extend = CatSpa ** ExtendRomanceFunctor - s = "qué tan" ++ adv.s } ; - WhatSSC s = {s = \\_ => "lo que" ++ s.s ! Indic} ; --- mood + EmbedSSlash s = {s = \\_ => "lo que" ++ s.s ! {g=Masc ; n=Sg} ! Indic} ; ExistsNP np = mkClause [] True False np.a diff --git a/src/swedish/ExtendSwe.gf b/src/swedish/ExtendSwe.gf index 5af405a5..63b3fa6a 100644 --- a/src/swedish/ExtendSwe.gf +++ b/src/swedish/ExtendSwe.gf @@ -8,7 +8,7 @@ concrete ExtendSwe of Extend = CatSwe ** PassVPSlash, PassAgentVPSlash, UttVPShort, ByVP, InOrderToVP, MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV, MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS, - ICompAP,ProDrop,WhatSSC, + ICompAP,ProDrop,EmbedSSlash, AdAdV, PositAdVAdj, GerundCN, GerundNP, GerundAdv, PresPartAP, PastPartAP, PastPartAgentAP, RNP, RNPList, ReflRNP, ReflPron, ReflPoss, PredetRNP, ConjRNP, Base_rr_RNP, Base_nr_RNP, Base_rn_RNP, Cons_rr_RNP, Cons_nr_RNP, @@ -231,5 +231,5 @@ concrete ExtendSwe of Extend = CatSwe ** AdvIsNP adv np = PredVP {s = \\_ => adv.s ; a = np.a ; isPron = False} (UseComp (CompNP np)) ; - WhatSSC s = {s = "det" ++ s.s ! Main} ; + EmbedSSlash ss = {s = "det" ++ ss.s ! Main ++ ss.c2.s ++ ss.n3 ! agrUSgP3} ; }