From 1008ec8625606aee30893aaa99a7e19c354b5376 Mon Sep 17 00:00:00 2001 From: aarne Date: Thu, 24 Apr 2008 06:33:57 +0000 Subject: [PATCH] restest completed, English ready in exper --- lib/resource/exper/abstract/Backward.gf | 4 ++ lib/resource/exper/abstract/Extra.gf | 6 +-- lib/resource/exper/abstract/Relative.gf | 2 +- lib/resource/exper/abstract/Sentence.gf | 15 +++----- lib/resource/exper/abstract/Text.gf | 4 +- lib/resource/exper/abstract/Verb.gf | 39 ++++++++------------ lib/resource/exper/english/English.gf | 2 +- lib/resource/exper/english/ExtraEng.gf | 5 ++- lib/resource/exper/english/VerbEng.gf | 2 +- lib/resource/exper/restest.gfs | 49 ++++++++++++++++++++++++- 10 files changed, 84 insertions(+), 44 deletions(-) diff --git a/lib/resource/exper/abstract/Backward.gf b/lib/resource/exper/abstract/Backward.gf index 926d9e042..458fb3010 100644 --- a/lib/resource/exper/abstract/Backward.gf +++ b/lib/resource/exper/abstract/Backward.gf @@ -21,6 +21,10 @@ fun ReflV2 : V2 -> VP ; -- use itself + UseVQ : VQ -> V2 ; -- ask (a question) + UseVS : VS -> V2 ; -- know (a secret) + + -- from Sentence 19/4/2008 SlashV2 : NP -> V2 -> Slash ; -- (whom) he sees diff --git a/lib/resource/exper/abstract/Extra.gf b/lib/resource/exper/abstract/Extra.gf index 08a39ea78..b0601019f 100644 --- a/lib/resource/exper/abstract/Extra.gf +++ b/lib/resource/exper/abstract/Extra.gf @@ -10,9 +10,9 @@ abstract Extra = Cat ** { GenNP : NP -> Quant ; -- this man's ComplBareVS : VS -> S -> VP ; -- know you go - StrandRelSlash : RP -> Slash -> RCl ; -- that he lives in - EmptyRelSlash : RP -> Slash -> RCl ; -- he lives in - StrandQuestSlash : IP -> Slash -> QCl ; -- whom does John live with + StrandRelSlash : RP -> ClSlash -> RCl ; -- that he lives in + EmptyRelSlash : RP -> ClSlash -> RCl ; -- he lives in + StrandQuestSlash : IP -> ClSlash -> QCl ; -- whom does John live with -- $VP$ conjunction, which has different fragments implemented in -- different languages - never a full $VP$, though. diff --git a/lib/resource/exper/abstract/Relative.gf b/lib/resource/exper/abstract/Relative.gf index 0926af254..6db45d085 100644 --- a/lib/resource/exper/abstract/Relative.gf +++ b/lib/resource/exper/abstract/Relative.gf @@ -20,7 +20,7 @@ abstract Relative = Cat ** { -- or suffixing (depending on language) prepositional phrases. IdRP : RP ; -- which - FunRP : Prep -> NP -> RP -> RP ; -- all the roots of which + FunRP : Prep -> NP -> RP -> RP ; -- the mother of whom } diff --git a/lib/resource/exper/abstract/Sentence.gf b/lib/resource/exper/abstract/Sentence.gf index ea8e4e455..32b885f9f 100644 --- a/lib/resource/exper/abstract/Sentence.gf +++ b/lib/resource/exper/abstract/Sentence.gf @@ -16,7 +16,7 @@ abstract Sentence = Cat ** { -- This can be overgenerating. E.g. "whether you go" as subject -- is only meaningful for some verb phrases. - PredSCVP : SC -> VP -> Cl ; -- that you go makes me happy + PredSCVP : SC -> VP -> Cl ; -- that she goes is good --2 Clauses missing object noun phrases @@ -29,9 +29,9 @@ abstract Sentence = Cat ** { -- *Note* the set is not complete and lacks e.g. verbs with more than 2 places. SlashVP : NP -> VPSlash -> ClSlash ; -- (whom) he sees - AdvSlash : ClSlash -> Adv -> ClSlash ; -- (whom) he sees tomorrow + AdvSlash : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today SlashPrep : Cl -> Prep -> ClSlash ; -- (with whom) he walks - SlashVS : NP -> VS -> SSlash -> ClSlash ; -- (whom) he says that she loves + SlashVS : NP -> VS -> SSlash -> ClSlash ; -- (whom) she says that he loves --2 Imperatives @@ -39,15 +39,15 @@ abstract Sentence = Cat ** { -- It has variation over positive and negative, singular and plural. -- To fix these parameters, see [Phrase Phrase.html]. - ImpVP : VP -> Imp ; -- go + ImpVP : VP -> Imp ; -- love yourselves --2 Embedded sentences -- Sentences, questions, and infinitival phrases can be used as -- subjects and (adverbial) complements. - EmbedS : S -> SC ; -- that you go - EmbedQS : QS -> SC ; -- whether you go + EmbedS : S -> SC ; -- that she goes + EmbedQS : QS -> SC ; -- who goes EmbedVP : VP -> SC ; -- to go --2 Sentences @@ -70,9 +70,6 @@ abstract Sentence = Cat ** { --. ---- todo: tense of embedded Slash --- SlashVSS : NP -> VS -> Slash -> Slash; -- (whom) I think he sees - -- Examples for English $S$/$Cl$: {- Pres Simul Pos ODir : he sleeps diff --git a/lib/resource/exper/abstract/Text.gf b/lib/resource/exper/abstract/Text.gf index ee4056a42..d3cfac16f 100644 --- a/lib/resource/exper/abstract/Text.gf +++ b/lib/resource/exper/abstract/Text.gf @@ -9,7 +9,7 @@ abstract Text = Common ** { fun TEmpty : Text ; -- TFullStop : Phr -> Text -> Text ; -- John walks. ... - TQuestMark : Phr -> Text -> Text ; -- Are you OK? ... - TExclMark : Phr -> Text -> Text ; -- John walks! ... + TQuestMark : Phr -> Text -> Text ; -- Are they here? ... + TExclMark : Phr -> Text -> Text ; -- Let's go! ... } diff --git a/lib/resource/exper/abstract/Verb.gf b/lib/resource/exper/abstract/Verb.gf index 548d6ccad..c1462acc7 100644 --- a/lib/resource/exper/abstract/Verb.gf +++ b/lib/resource/exper/abstract/Verb.gf @@ -11,30 +11,30 @@ abstract Verb = Cat ** { UseV : V -> VP ; -- sleep ComplVV : VV -> VP -> VP ; -- want to run - ComplVS : VS -> S -> VP ; -- know that she runs - ComplVQ : VQ -> QS -> VP ; -- wonder if she runs - ComplVA : VA -> AP -> VP ; -- look red + ComplVS : VS -> S -> VP ; -- say that she runs + ComplVQ : VQ -> QS -> VP ; -- wonder who runs + ComplVA : VA -> AP -> VP ; -- they become red - SlashV2a : V2 -> VPSlash ; -- use (it) - Slash2V3 : V3 -> NP -> VPSlash ; -- send it (to her) - Slash3V3 : V3 -> NP -> VPSlash ; -- send (it) to her + SlashV2a : V2 -> VPSlash ; -- love (it) + Slash2V3 : V3 -> NP -> VPSlash ; -- give it (to her) + Slash3V3 : V3 -> NP -> VPSlash ; -- give (it) to her - SlashV2V : V2V -> VP -> VPSlash ; -- cause (it) to burn - SlashV2S : V2S -> S -> VPSlash ; -- tell (me) that it rains - SlashV2Q : V2Q -> QS -> VPSlash ; -- ask (me) who came + SlashV2V : V2V -> VP -> VPSlash ; -- beg (her) to go + SlashV2S : V2S -> S -> VPSlash ; -- answer (to him) that it is good + SlashV2Q : V2Q -> QS -> VPSlash ; -- ask (him) who came SlashV2A : V2A -> AP -> VPSlash ; -- paint (it) red - ComplSlash : VPSlash -> NP -> VP ; -- use it + ComplSlash : VPSlash -> NP -> VP ; -- love it - SlashVV : VV -> VPSlash -> VPSlash ; -- want to give her - SlashV2VNP : V2V -> NP -> VPSlash -> VPSlash ; -- want me to give her + SlashVV : VV -> VPSlash -> VPSlash ; -- want to buy + SlashV2VNP : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy --2 Other ways of forming verb phrases -- Verb phrases can also be constructed reflexively and from -- copula-preceded complements. - ReflVP : VPSlash -> VP ; -- use itself + ReflVP : VPSlash -> VP ; -- love himself UseComp : Comp -> VP ; -- be warm -- Passivization of two-place verbs is another way to use @@ -47,7 +47,7 @@ abstract Verb = Cat ** { -- *Note*. the rule can be overgenerating, since the $V2$ need not -- take a direct object. - PassV2 : V2 -> VP ; -- be used + PassV2 : V2 -> VP ; -- be loved -- Adverbs can be added to verb phrases. Many languages make -- a distinction between adverbs that are attached in the end @@ -65,16 +65,7 @@ abstract Verb = Cat ** { -- Adjectival phrases, noun phrases, and adverbs can be used. CompAP : AP -> Comp ; -- (be) small - CompNP : NP -> Comp ; -- (be) a soldier + CompNP : NP -> Comp ; -- (be) a man CompAdv : Adv -> Comp ; -- (be) here ---2 Coercions - --- Verbs can change subcategorization patterns in systematic ways, --- but this is very much language-dependent. The following two --- work in all the languages we cover. - - UseVQ : VQ -> V2 ; -- ask (a question) - UseVS : VS -> V2 ; -- know (a secret) - } diff --git a/lib/resource/exper/english/English.gf b/lib/resource/exper/english/English.gf index a117f34d3..ab3552c6a 100644 --- a/lib/resource/exper/english/English.gf +++ b/lib/resource/exper/english/English.gf @@ -1,4 +1,4 @@ ---# -path=.:../abstract:../common:prelude +--# -path=.:abstract:../common:prelude concrete English of EnglishAbs = LangEng, diff --git a/lib/resource/exper/english/ExtraEng.gf b/lib/resource/exper/english/ExtraEng.gf index a8904ec8e..d80387476 100644 --- a/lib/resource/exper/english/ExtraEng.gf +++ b/lib/resource/exper/english/ExtraEng.gf @@ -6,7 +6,8 @@ concrete ExtraEng of ExtraEngAbs = CatEng ** ComplBareVS v s = insertObj (\\_ => s.s) (predV v) ; StrandRelSlash rp slash = { - s = \\t,a,p,_ => rp.s ! RC Acc ++ slash.s ! t ! a ! p ! ODir ++ slash.c2 ; + s = \\t,a,p,ag => + rp.s ! RC (fromAgr ag).g Acc ++ slash.s ! t ! a ! p ! ODir ++ slash.c2 ; c = Acc } ; EmptyRelSlash rp slash = { @@ -43,7 +44,7 @@ concrete ExtraEng of ExtraEngAbs = CatEng ** UncNegImpSg imp = {s = imp.s ! neg ! ImpF Sg False} ; UncNegImpPl imp = {s = imp.s ! neg ! ImpF Pl False} ; - CompoundCN a b = {s = \\n,c => a.s ! Sg ! Nom ++ b.s ! n ! c} ; + CompoundCN a b = {s = \\n,c => a.s ! Sg ! Nom ++ b.s ! n ! c ; g = b.g} ; oper diff --git a/lib/resource/exper/english/VerbEng.gf b/lib/resource/exper/english/VerbEng.gf index 28d969104..5b40af45b 100644 --- a/lib/resource/exper/english/VerbEng.gf +++ b/lib/resource/exper/english/VerbEng.gf @@ -41,7 +41,7 @@ concrete VerbEng of Verb = CatEng ** open ResEng in { PassV2 v = insertObj (\\_ => v.s ! VPPart) (predAux auxBe) ; - UseVS, UseVQ = \vv -> {s = vv.s ; c2 = [] ; isRefl = vv.isRefl} ; -- no "to" +---b UseVS, UseVQ = \vv -> {s = vv.s ; c2 = [] ; isRefl = vv.isRefl} ; -- no "to" CompAP ap = ap ; CompNP np = {s = \\_ => np.s ! Acc} ; diff --git a/lib/resource/exper/restest.gfs b/lib/resource/exper/restest.gfs index 2242789f0..e50895932 100644 --- a/lib/resource/exper/restest.gfs +++ b/lib/resource/exper/restest.gfs @@ -138,9 +138,56 @@ QuestIComp (CompIP whoSg_IP) (UsePron it_Pron) -- Relative + +ExistNP (DetArtSg IndefArt (RelCN (UseN woman_N) (UseRCl TPres ASimul PPos (RelCl (PredVP (UsePN john_PN) (ComplSlash (SlashV2a love_V2) (UsePron she_Pron))))))) +ExistNP (DetArtSg IndefArt (RelCN (UseN woman_N) (UseRCl TPres ASimul PPos (RelVP IdRP (ComplSlash (SlashV2a love_V2) (UsePN john_PN)))))) +ExistNP (DetArtSg IndefArt (RelCN (UseN woman_N) (UseRCl TPres ASimul PPos (RelSlash IdRP (SlashVP (UsePN john_PN) (SlashV2a love_V2)))))) +ExistNP (DetArtSg IndefArt (RelCN (UseN woman_N) (UseRCl TPres ASimul PPos (RelSlash (FunRP possess_Prep (DetArtSg DefArt (UseN2 mother_N2)) IdRP) (SlashVP (UsePN john_PN) (SlashV2a love_V2)))))) + -- Sentence + +PredVP (UsePN john_PN) (UseV walk_V) +PredSCVP (EmbedS (UseCl TPres ASimul PPos (PredVP (UsePron she_Pron) (UseV go_V)))) (UseComp (CompAP (PositA good_A))) +RelCN (UseN girl_N) (UseRCl TPres ASimul PPos (RelSlash IdRP (SlashVP (UsePron he_Pron) (SlashV2a see_V2)))) +RelCN (UseN girl_N) (UseRCl TPres ASimul PPos (RelSlash IdRP (AdvSlash (SlashVP (UsePron he_Pron) (SlashV2a see_V2)) today_Adv))) +RelCN (UseN girl_N) (UseRCl TPres ASimul PPos (RelSlash IdRP (SlashPrep (PredVP (UsePron he_Pron) (UseV walk_V)) with_Prep))) +RelCN (UseN girl_N) (UseRCl TPres ASimul PPos (RelSlash IdRP (SlashVS (UsePron she_Pron) say_VS (UseSlash TPres ASimul PPos (SlashVP (UsePron he_Pron) (SlashV2a love_V2)))))) +ImpVP (ReflVP (SlashV2a love_V2)) +EmbedS (UseCl TPres ASimul PPos (PredVP (UsePron she_Pron) (UseV go_V))) +EmbedQS (UseQCl TPres ASimul PPos (QuestVP whoSg_IP (UseV go_V))) +EmbedVP (UseV go_V) +UseCl TCond AAnter PNeg (PredVP (UsePN john_PN) (UseV walk_V)) +UseQCl TCond AAnter PNeg (QuestCl (PredVP (UsePN john_PN) (UseV walk_V))) +RelCN (UseN girl_N) (UseRCl TCond AAnter PNeg (RelVP IdRP (UseV walk_V))) +RelCN (UseN girl_N) (UseRCl TCond AAnter PNeg (RelSlash IdRP (SlashPrep (PredVP (UsePron i_Pron) (UseV walk_V)) with_Prep))) + -- Text + +TEmpty +TFullStop (PhrUtt NoPConj (UttS (UseCl TPres ASimul PPos (PredVP (UsePN john_PN) (UseV walk_V)))) NoVoc) TEmpty +TQuestMark (PhrUtt NoPConj (UttQS (UseQCl TPres ASimul PPos (QuestCl (PredVP (UsePron they_Pron) (UseComp (CompAdv here_Adv)))))) NoVoc) TEmpty +TExclMark (PhrUtt NoPConj (ImpPl1 (UseV go_V)) NoVoc) TEmpty + -- Verb - +PredVP (UsePron i_Pron) (UseV sleep_V) +PredVP (UsePron i_Pron) (ComplVV want_VV (UseV run_V)) +PredVP (UsePron i_Pron) (ComplVS say_VS (UseCl TPres ASimul PPos (PredVP (UsePron she_Pron) (UseV run_V)))) +PredVP (UsePron i_Pron) (ComplVQ wonder_VQ (UseQCl TPres ASimul PPos (QuestVP whoSg_IP (UseV run_V)))) +PredVP (UsePron they_Pron) (ComplVA become_VA (PositA red_A)) +PredVP (UsePron i_Pron) (ComplSlash (Slash3V3 give_V3 (UsePron he_Pron)) (UsePron it_Pron)) +PredVP (UsePron i_Pron) (ComplSlash (SlashV2V beg_V2V (UseV go_V)) (UsePron she_Pron)) +PredVP (UsePron i_Pron) (ComplSlash (SlashV2S answer_V2S (UseCl TPres ASimul PPos (PredVP (UsePron it_Pron) (UseComp (CompAP (PositA good_A)))))) (UsePron he_Pron)) +PredVP (UsePron i_Pron) (ComplSlash (SlashV2Q ask_V2Q (UseQCl TPast ASimul PPos (QuestVP whoSg_IP (UseV come_V)))) (UsePron he_Pron)) +PredVP (UsePron i_Pron) (ComplSlash (SlashV2A paint_V2A (PositA red_A)) (UsePron it_Pron)) +RelCN (UseN car_N) (UseRCl TPres ASimul PPos (RelSlash IdRP (SlashVP (UsePron i_Pron) (SlashVV want_VV (SlashV2a buy_V2))))) +RelCN (UseN car_N) (UseRCl TPres ASimul PPos (RelSlash IdRP (SlashVP (UsePron they_Pron) (SlashV2VNP beg_V2V (UsePron i_Pron) (SlashV2a buy_V2))))) +PredVP (UsePron he_Pron) (ReflVP (SlashV2a love_V2)) +PredVP (DetNP (DetQuant this_Quant NumSg)) (UseComp (CompAP (PositA warm_A))) +PredVP (UsePron we_Pron) (PassV2 love_V2) +PredVP (UsePron we_Pron) (AdvVP (UseV sleep_V) here_Adv) +PredVP (UsePron we_Pron) (AdVVP always_AdV (UseV sleep_V)) +PredVP (UsePron we_Pron) (UseComp (CompAP (PositA small_A))) +PredVP (UsePron i_Pron) (UseComp (CompNP (DetArtSg IndefArt (UseN man_N)))) +PredVP (UsePron i_Pron) (UseComp (CompAdv here_Adv))