From e0747204258142b6da234579f34491f78bc20340 Mon Sep 17 00:00:00 2001 From: aarne Date: Tue, 16 May 2006 18:29:41 +0000 Subject: [PATCH] updated ExistIP for all languages --- lib/resource-1.0/danish/IdiomDan.gf | 17 +++++++++++++++-- lib/resource-1.0/english/CatEng.gf | 3 ++- lib/resource-1.0/english/IdiomEng.gf | 7 +------ lib/resource-1.0/english/QuestionEng.gf | 15 --------------- lib/resource-1.0/english/ResEng.gf | 15 +++++++++++++++ lib/resource-1.0/english/VerbEng.gf | 1 - lib/resource-1.0/finnish/IdiomFin.gf | 9 +++++++++ lib/resource-1.0/french/IdiomFre.gf | 5 ++--- lib/resource-1.0/italian/IdiomIta.gf | 12 ++++++++++-- lib/resource-1.0/italian/PhonoIta.gf | 2 +- lib/resource-1.0/norwegian/IdiomNor.gf | 18 ++++++++++++++++-- lib/resource-1.0/spanish/IdiomSpa.gf | 10 ++++++++-- 12 files changed, 79 insertions(+), 35 deletions(-) diff --git a/lib/resource-1.0/danish/IdiomDan.gf b/lib/resource-1.0/danish/IdiomDan.gf index 7d809f8f0..3fb12bf00 100644 --- a/lib/resource-1.0/danish/IdiomDan.gf +++ b/lib/resource-1.0/danish/IdiomDan.gf @@ -4,11 +4,24 @@ concrete IdiomDan of Idiom = CatDan ** flags optimize=all_subs ; lin + ImpersCl vp = mkClause "det" (agrP3 neutrum Sg) vp ; + GenericCl vp = mkClause "man" (agrP3 neutrum Sg) vp ; + ExistNP np = mkClause "det" (agrP3 neutrum Sg) (insertObj (\\_ => np.s ! accusative) (predV (depV finne_V))) ; - ImpersCl vp = mkClause "det" (agrP3 neutrum Sg) vp ; - GenericCl vp = mkClause "man" (agrP3 neutrum Sg) vp ; + + ExistIP ip = { + s = \\t,a,p => + let + cls = + (mkClause "det" (agrP3 neutrum Sg) (predV (depV finne_V))).s ! t ! a ! p ; + who = ip.s ! accusative + in table { + QDir => who ++ cls ! Inv ; + QIndir => who ++ cls ! Sub + } + } ; ProgrVP vp = insertObj (\\a => ["ved å"] ++ infVP vp a) (predV verbBe) ; diff --git a/lib/resource-1.0/english/CatEng.gf b/lib/resource-1.0/english/CatEng.gf index ada2241b1..370f7c1b7 100644 --- a/lib/resource-1.0/english/CatEng.gf +++ b/lib/resource-1.0/english/CatEng.gf @@ -36,11 +36,12 @@ concrete CatEng of Cat = CommonX ** open ResEng, Prelude in { VP = { s : Tense => Anteriority => Polarity => Order => Agr => {fin, inf : Str} ; - prp : Str ; -- present participle + prp : Str ; -- present participle inf : Str ; -- infinitive ad : Str ; s2 : Agr => Str } ; + Comp = {s : Agr => Str} ; SC = {s : Str} ; diff --git a/lib/resource-1.0/english/IdiomEng.gf b/lib/resource-1.0/english/IdiomEng.gf index 7f24b11de..432661a08 100644 --- a/lib/resource-1.0/english/IdiomEng.gf +++ b/lib/resource-1.0/english/IdiomEng.gf @@ -10,12 +10,7 @@ concrete IdiomEng of Idiom = CatEng ** open Prelude, ResEng in { mkClause "there" (agrP3 np.a.n) (insertObj (\\_ => np.s ! Acc) (predAux auxBe)) ; ExistIP ip = - let cl = - mkClause (ip.s ! Nom) (agrP3 ip.n) (insertObj (\\_ => "there") (predAux auxBe)) - in { - s = \\t,a,b,_ => cl.s ! t ! a ! b ! ODir --- "what is there", no "what there is" - } ; - + mkQuestion (ss (ip.s ! Nom)) (mkClause "there" (agrP3 ip.n) (predAux auxBe)) ; ProgrVP vp = insertObj (\\a => vp.ad ++ vp.prp ++ vp.s2 ! a) (predAux auxBe) ; diff --git a/lib/resource-1.0/english/QuestionEng.gf b/lib/resource-1.0/english/QuestionEng.gf index bfe4033c7..73ab335f2 100644 --- a/lib/resource-1.0/english/QuestionEng.gf +++ b/lib/resource-1.0/english/QuestionEng.gf @@ -41,19 +41,4 @@ concrete QuestionEng of Question = CatEng ** open ResEng, Prelude in { CompIAdv a = a ; - oper - mkQuestion : - {s : Str} -> Clause -> - {s : Tense => Anteriority => Polarity => QForm => Str} = \wh,cl -> - { - s = \\t,a,p => - let - cls = cl.s ! t ! a ! p ; - why = wh.s - in table { - QDir => why ++ cls ! OQuest ; - QIndir => why ++ cls ! ODir - } - } ; - } diff --git a/lib/resource-1.0/english/ResEng.gf b/lib/resource-1.0/english/ResEng.gf index 44a1b4e95..1f862986f 100644 --- a/lib/resource-1.0/english/ResEng.gf +++ b/lib/resource-1.0/english/ResEng.gf @@ -180,6 +180,7 @@ resource ResEng = ParamX ** open Prelude in { s2 : Agr => Str } ; + --- The order gets wrong with AdV, but works around a parser --- generation bug. @@ -390,4 +391,18 @@ resource ResEng = ParamX ** open Prelude in { _ => ten + "th" } ; + mkQuestion : + {s : Str} -> Clause -> + {s : Tense => Anteriority => Polarity => QForm => Str} = \wh,cl -> + { + s = \\t,a,p => + let + cls = cl.s ! t ! a ! p ; + why = wh.s + in table { + QDir => why ++ cls ! OQuest ; + QIndir => why ++ cls ! ODir + } + } ; + } diff --git a/lib/resource-1.0/english/VerbEng.gf b/lib/resource-1.0/english/VerbEng.gf index 230c04fe3..1b454332b 100644 --- a/lib/resource-1.0/english/VerbEng.gf +++ b/lib/resource-1.0/english/VerbEng.gf @@ -33,5 +33,4 @@ concrete VerbEng of Verb = CatEng ** open ResEng in { CompNP np = {s = \\_ => np.s ! Acc} ; CompAdv a = {s = \\_ => a.s} ; - } diff --git a/lib/resource-1.0/finnish/IdiomFin.gf b/lib/resource-1.0/finnish/IdiomFin.gf index ef0041074..d04585e25 100644 --- a/lib/resource-1.0/finnish/IdiomFin.gf +++ b/lib/resource-1.0/finnish/IdiomFin.gf @@ -14,6 +14,15 @@ concrete IdiomFin of Idiom = CatFin ** mkClause noSubj (agrP3 Sg) (insertObj (\\_,b,_ => "olemassa" ++ np.s ! cas b) (predV olla)) ; + ExistIP ip = + let + cas : NPForm = NPCase Part ; --- dep on num, pol? + vp = insertObj (\\_,b,_ => "olemassa") (predV olla) ; + cl = mkClause (subjForm (ip ** {isPron = False ; a = agrP3 Sg}) cas) (agrP3 Sg) vp + in { + s = \\t,a,p => cl.s ! t ! a ! p ! SDecl + } ; + ImpersCl vp = mkClause noSubj (agrP3 Sg) vp ; GenericCl vp = mkClause noSubj (agrP3 Sg) { diff --git a/lib/resource-1.0/french/IdiomFre.gf b/lib/resource-1.0/french/IdiomFre.gf index 44af51f7d..402fe728b 100644 --- a/lib/resource-1.0/french/IdiomFre.gf +++ b/lib/resource-1.0/french/IdiomFre.gf @@ -7,15 +7,14 @@ concrete IdiomFre of Idiom = CatFre ** ImpersCl vp = mkClause "il" (agrP3 Masc Sg) vp ; GenericCl vp = mkClause "on" (agrP3 Masc Sg) vp ; - ExistNP np = mkClause "il" (agrP3 Masc Sg) (insertClit2 "y" (insertComplement (\\_ => np.s ! Ton Acc) (predV avoir_V))) ; ExistIP ip = { s = \\t,a,p,_ => - (mkClause (ip.s ! Nom) (agrP3 ip.a.g ip.a.n) - (insertClit2 "y" (predV avoir_V))).s ! t ! a ! p ! Indic + ip.s ! Nom ++ + (mkClause "il" (agrP3 Masc Sg) (insertClit2 "y" (predV avoir_V))).s ! t ! a ! p ! Indic } ; ProgrVP vp = diff --git a/lib/resource-1.0/italian/IdiomIta.gf b/lib/resource-1.0/italian/IdiomIta.gf index 404858751..7ccf0d5e2 100644 --- a/lib/resource-1.0/italian/IdiomIta.gf +++ b/lib/resource-1.0/italian/IdiomIta.gf @@ -4,13 +4,21 @@ concrete IdiomIta of Idiom = CatIta ** flags optimize=all_subs ; lin + ImpersCl vp = mkClause [] (agrP3 Masc Sg) vp ; + GenericCl vp = mkClause "si" (agrP3 Masc Sg) vp ; ---- non se ci fanno cose + ExistNP np = mkClause [] (agrP3 np.a.g np.a.n) (insertClit2 (elision "ci" "c'" "ci") (insertComplement (\\_ => np.s ! Ton Nom) (predV copula))) ; - ImpersCl vp = mkClause [] (agrP3 Masc Sg) vp ; - GenericCl vp = mkClause "si" (agrP3 Masc Sg) vp ; ---- non se ci fanno cose + + ExistIP ip = { + s = \\t,a,p,_ => + ip.s ! Nom ++ + (mkClause [] (agrP3 ip.a.g ip.a.n) + (insertClit2 (elision "ci" "c'" "ci") (predV copula))).s ! t ! a ! p ! Indic + } ; ProgrVP vp = insertComplement diff --git a/lib/resource-1.0/italian/PhonoIta.gf b/lib/resource-1.0/italian/PhonoIta.gf index 43f0b1159..81fd60cf7 100644 --- a/lib/resource-1.0/italian/PhonoIta.gf +++ b/lib/resource-1.0/italian/PhonoIta.gf @@ -7,7 +7,7 @@ resource PhonoIta = open Prelude in { oper vocale : Strs = strs { - "a" ; "e" ; "h" ; "i" ; "o" ; "u" + "a" ; "e" ; "h" ; "i" ; "o" ; "u" ; "è" } ; sImpuro : Strs = strs { diff --git a/lib/resource-1.0/norwegian/IdiomNor.gf b/lib/resource-1.0/norwegian/IdiomNor.gf index 3dc67d61b..1f9ea30c6 100644 --- a/lib/resource-1.0/norwegian/IdiomNor.gf +++ b/lib/resource-1.0/norwegian/IdiomNor.gf @@ -4,11 +4,25 @@ concrete IdiomNor of Idiom = CatNor ** flags optimize=all_subs ; lin + + ImpersCl vp = mkClause "det" (agrP3 neutrum Sg) vp ; + GenericCl vp = mkClause "man" (agrP3 neutrum Sg) vp ; + ExistNP np = mkClause "det" (agrP3 neutrum Sg) (insertObj (\\_ => np.s ! accusative) (predV (depV finne_V))) ; - ImpersCl vp = mkClause "det" (agrP3 neutrum Sg) vp ; - GenericCl vp = mkClause "man" (agrP3 neutrum Sg) vp ; + + ExistIP ip = { + s = \\t,a,p => + let + cls = + (mkClause "det" (agrP3 neutrum Sg) (predV (depV finne_V))).s ! t ! a ! p ; + who = ip.s ! accusative + in table { + QDir => who ++ cls ! Inv ; + QIndir => who ++ cls ! Sub + } + } ; ProgrVP vp = insertObj (\\a => ["ved å"] ++ infVP vp a) (predV verbBe) ; diff --git a/lib/resource-1.0/spanish/IdiomSpa.gf b/lib/resource-1.0/spanish/IdiomSpa.gf index 6b6aff5c7..541ecc7e6 100644 --- a/lib/resource-1.0/spanish/IdiomSpa.gf +++ b/lib/resource-1.0/spanish/IdiomSpa.gf @@ -4,11 +4,17 @@ concrete IdiomSpa of Idiom = CatSpa ** flags optimize=all_subs ; lin + ImpersCl vp = mkClause [] (agrP3 Masc Sg) vp ; + GenericCl vp = mkClause "se" (agrP3 Masc Sg) vp ; ---- just Italian ? + ExistNP np = mkClause [] (agrP3 Masc Sg) (insertComplement (\\_ => np.s ! Ton Acc) (predV (verboV (hay_3 "haber")))) ; - ImpersCl vp = mkClause [] (agrP3 Masc Sg) vp ; - GenericCl vp = mkClause "se" (agrP3 Masc Sg) vp ; ---- just Italian ? + ExistIP ip = { + s = \\t,a,p,_ => + ip.s ! Nom ++ + (mkClause [] (agrP3 Masc Sg) (predV (verboV (hay_3 "haber")))).s ! t ! a ! p ! Indic + } ; ProgrVP vp = insertComplement