From 37d848202dd4a96bb3acc756781e53752b3d7d2a Mon Sep 17 00:00:00 2001 From: aarne Date: Thu, 1 Dec 2011 12:51:40 +0000 Subject: [PATCH] imperatives added to Phrasebook (familiar,polite,plural,positive,negative) --- examples/phrasebook/DisambPhrasebookEng.gf | 18 +++++++++++++++++- examples/phrasebook/Sentences.gf | 8 ++++++++ examples/phrasebook/SentencesI.gf | 9 +++++++++ examples/phrasebook/Words.gf | 12 ++++++++++++ 4 files changed, 46 insertions(+), 1 deletion(-) diff --git a/examples/phrasebook/DisambPhrasebookEng.gf b/examples/phrasebook/DisambPhrasebookEng.gf index a56e9568c..e5182933f 100644 --- a/examples/phrasebook/DisambPhrasebookEng.gf +++ b/examples/phrasebook/DisambPhrasebookEng.gf @@ -15,7 +15,13 @@ concrete DisambPhrasebookEng of Phrasebook = PhrasebookEng - WeMale, WeFemale, YouPlurFamMale, YouPlurFamFemale, YouPlurPolMale, YouPlurPolFemale, - TheyMale, TheyFemale + TheyMale, TheyFemale, + PImperativeFamPos, + PImperativeFamNeg, + PImperativePolPos, + PImperativePlurNeg, + PImperativePlurPos, + PImperativePlurNeg ] ** open SyntaxEng, ParadigmsEng, IrregEng, Prelude in { lin @@ -53,6 +59,14 @@ lin ObjMass x = mkNP (mkNP x) (ParadigmsEng.mkAdv "(a portion of)") ; + PImperativeFamPos v = phrasePlease (mkUtt (mkImp (addAdv ("singular,familiar") v))) ; + PImperativeFamNeg v = phrasePlease (mkUtt negativePol (mkImp (addAdv ("singular,familiar") v))) ; + PImperativePolPos v = phrasePlease (mkUtt politeImpForm (mkImp (addAdv ("singular,polite") v))) ; + PImperativePolNeg v = phrasePlease (mkUtt politeImpForm negativePol (mkImp (addAdv ("singular,polite") v))) ; + PImperativePlurPos v = phrasePlease (mkUtt pluralImpForm (mkImp (addAdv ("plural,familiar") v))) ; + PImperativePlurNeg v = phrasePlease (mkUtt pluralImpForm negativePol (mkImp (addAdv ("plural,familiar") v))) ; + + oper fam : Str -> SS = \s -> postfixSS "(familiar)" (ss s) ; pol : Str -> SS = \s -> postfixSS "(polite)" (ss s) ; @@ -62,4 +76,6 @@ oper isPron = False ; -- to show the disambiguation poss = SyntaxEng.mkQuant youSg_Pron } ; + + addAdv : Str -> VP -> VP = \s,vp -> mkVP vp (ParadigmsEng.mkAdv ("("+s+")")) ; } diff --git a/examples/phrasebook/Sentences.gf b/examples/phrasebook/Sentences.gf index 60ae3f6a7..b6cde22d7 100644 --- a/examples/phrasebook/Sentences.gf +++ b/examples/phrasebook/Sentences.gf @@ -199,6 +199,14 @@ abstract Sentences = Numeral ** { V2Buy, V2Drink, V2Eat : Object -> VerbPhrase ; V2Wait : Person -> VerbPhrase ; + PImperativeFamPos, -- eat + PImperativeFamNeg, -- don't eat + PImperativePolPos, -- essen Sie + PImperativePlurNeg, -- essen Sie nicht + PImperativePlurPos, -- esst + PImperativePlurNeg : -- esst nicht + VerbPhrase -> Phrase ; + -- other new things allowed by the resource --- PBecause : Sentence -> Sentence -> Phrase ; -- I want to swim because it is hot diff --git a/examples/phrasebook/SentencesI.gf b/examples/phrasebook/SentencesI.gf index dfacb8d13..f45fa4a22 100644 --- a/examples/phrasebook/SentencesI.gf +++ b/examples/phrasebook/SentencesI.gf @@ -238,6 +238,8 @@ oper -- for languages with GenNP, use "p's wife" -- relativePerson n x (\a,b,c -> mkNP (GenNP b) a c) p ; + phrasePlease : Utt -> Text = \u -> lin Text (mkPhr noPConj u please_Voc) | lin Text u ; + ------------------------------------------------------------------------------------------ -- New things added 30/11/2011 by AR ------------------------------------------------------------------------------------------ @@ -276,6 +278,13 @@ oper V2Eat o = mkVP eat_V2 o ; V2Wait o = mkVP wait_V2 o.name ; + PImperativeFamPos v = phrasePlease (mkUtt (mkImp v)) ; + PImperativeFamNeg v = phrasePlease (mkUtt negativePol (mkImp v)) ; + PImperativePolPos v = phrasePlease (mkUtt politeImpForm (mkImp v)) ; + PImperativePolNeg v = phrasePlease (mkUtt politeImpForm negativePol (mkImp v)) ; + PImperativePlurPos v = phrasePlease (mkUtt pluralImpForm (mkImp v)) ; + PImperativePlurNeg v = phrasePlease (mkUtt pluralImpForm negativePol (mkImp v)) ; + -- other new things allowed by the resource --- PBecause a b = SSubjS a because_Subj b ; diff --git a/examples/phrasebook/Words.gf b/examples/phrasebook/Words.gf index 12d9830ee..a8356151e 100644 --- a/examples/phrasebook/Words.gf +++ b/examples/phrasebook/Words.gf @@ -216,10 +216,22 @@ abstract Words = Sentences ** { Durian : Kind ; Mango : Kind ; Pineapple : Kind ; + Egg : Kind ; Coke : DrinkKind ; IceCream : DrinkKind ; --- both mass and plural + OrangeJuice : DrinkKind ; + Lemonade : DrinkKind ; + Salad : DrinkKind ; Beach : PlaceKind ; + ItsRaining : Proposition ; + ItsWindy : Proposition ; + ItsWarm : Proposition ; + ItsCold : Proposition ; + SunShine : Proposition ; + + Smoke : VerbPhrase ; + }