From d2b99a0607e99e4a2e031d34b9b59126ef4b1149 Mon Sep 17 00:00:00 2001 From: aarne Date: Wed, 30 Nov 2011 10:54:05 +0000 Subject: [PATCH] added RGL-functorial concepts to Phrasebook --- examples/phrasebook/DisambPhrasebookEng.gf | 22 ++++++++--- examples/phrasebook/Makefile | 10 +---- examples/phrasebook/Sentences.gf | 35 +++++++++++++++++ examples/phrasebook/SentencesGer.gf | 11 +++++- examples/phrasebook/SentencesI.gf | 44 ++++++++++++++++++++++ examples/phrasebook/SentencesTha.gf | 9 ++++- examples/phrasebook/SentencesUrd.gf | 2 +- examples/phrasebook/Words.gf | 9 +++++ examples/phrasebook/WordsEng.gf | 8 ++++ 9 files changed, 133 insertions(+), 17 deletions(-) diff --git a/examples/phrasebook/DisambPhrasebookEng.gf b/examples/phrasebook/DisambPhrasebookEng.gf index d2c468e8e..61f4470f9 100644 --- a/examples/phrasebook/DisambPhrasebookEng.gf +++ b/examples/phrasebook/DisambPhrasebookEng.gf @@ -10,16 +10,28 @@ concrete DisambPhrasebookEng of Phrasebook = PhrasebookEng - GSorry, GSorryPol, GPleaseGive, GPleaseGivePol, GNiceToMeetYou, -- GNiceToMeetYouPol, - PYes, PYesToNo, ObjMass + PYes, PYesToNo, ObjMass, + WeMale, WeFemale, + YouPlurFamMale, YouPlurFamFemale, + YouPlurPolMale, YouPlurPolFemale, + TheyMale, TheyFemale ] ** open SyntaxEng, ParadigmsEng, Prelude in { lin IMale = mkP i_Pron "(male)" ; IFemale = mkP i_Pron "(female)" ; - YouFamMale = mkP youSg_Pron "(familiar,male)" ; - YouFamFemale = mkP youSg_Pron "(familiar,female)" ; - YouPolMale = mkP youPol_Pron "(polite,male)" ; - YouPolFemale = mkP youPol_Pron "(polite,female)" ; + WeMale = mkP we_Pron "(male)" ; + WeFemale = mkP we_Pron "(female)" ; + YouFamMale = mkP youSg_Pron "(singular,familiar,male)" ; + YouFamFemale = mkP youSg_Pron "(singular,familiar,female)" ; + YouPolMale = mkP youPol_Pron "(singular,polite,male)" ; + YouPolFemale = mkP youPol_Pron "(singular,polite,female)" ; + YouPlurFamMale = mkP youSg_Pron "(plural,familiar,male)" ; + YouPlurFamFemale = mkP youSg_Pron "(plural,familiar,female)" ; + YouPlurPolMale = mkP youPol_Pron "(plural,polite,male)" ; + YouPlurPolFemale = mkP youPol_Pron "(plural,polite,female)" ; + TheyMale = mkP they_Pron "(male)" ; + TheyFemale = mkP they_Pron "(female)" ; LangNat nat = mkNP nat.lang (ParadigmsEng.mkAdv "(language)") ; -- CitiNat nat = nat.prop ; diff --git a/examples/phrasebook/Makefile b/examples/phrasebook/Makefile index 677b4085b..9af86ccfb 100644 --- a/examples/phrasebook/Makefile +++ b/examples/phrasebook/Makefile @@ -5,21 +5,15 @@ all: fin demo missing demo: compdemo linkdemo compdemo: - $(compile) Bul Cat Dan Dut Eng Fre Ger Ita Nor Pol Ron Rus Spa Swe Urd DisambPhrasebookEng + $(compile) Bul Cat Dan Dut Eng Fre Ger Ita Nor Pol Ron Rus Spa Swe Tha Urd DisambPhrasebookEng linkdemo: - $(compile) -link Eng Bul Cat Dan Dut Fin Fre Ger Ita Nor Pol Ron Rus Spa Swe Urd DisambPhrasebookEng + $(compile) -link Eng Bul Cat Dan Dut Fin Fre Ger Ita Nor Pol Ron Rus Spa Swe Tha Urd DisambPhrasebookEng #separate, because slow... fin: $(compile) Fin -pgfs: - $(compile) Bul Cat Dan Dut Eng Fin Fre Ger Ita Nor Pol Ron Rus Spa Swe Urd - -koe: - $(compile) Eng Fre DisambPhrasebookEng - missing: echo "pg -missing | wf -file=missing.txt" | gf -run Phrasebook.pgf diff --git a/examples/phrasebook/Sentences.gf b/examples/phrasebook/Sentences.gf index 47b5d0f1b..e0c58c40f 100644 --- a/examples/phrasebook/Sentences.gf +++ b/examples/phrasebook/Sentences.gf @@ -167,5 +167,40 @@ abstract Sentences = Numeral ** { AKnowPerson : Person -> Person -> Action ; -- you know me AKnowQuestion : Person -> Question -> Action ; -- you know how far the bar is +------------------------------------------------------------------------------------------ +-- New things added 30/11/2011 by AR +------------------------------------------------------------------------------------------ + + cat + VerbPhrase ; -- things one does, can do, must do, wants to do, e.g. swim + Modality ; -- can, want, must + fun + ADoVerbPhrase : Person -> VerbPhrase -> Action ; -- I swim + AModVerbPhrase : Modality -> Person -> VerbPhrase -> Action ; -- I can swim + ADoVerbPhrasePlace : Person -> VerbPhrase -> Place -> Action ; -- I swim in the hotel + AModVerbPhrasePlace : Modality -> Person -> VerbPhrase -> Place -> Action ; -- I can swim in the hotel + + QWhereDoVerbPhrase : Person -> VerbPhrase -> Question ; -- where do you swim + QWhereModVerbPhrase : Modality -> Person -> VerbPhrase -> Question ; -- where can I swim + + MCan, MKnow, MMust, MWant : Modality ; + +-- lexical items given in the resource Lexicon + + VPlay, VRun, VSit, VSleep, VSwim, VWalk : VerbPhrase ; + VDrink, VEat, VRead, VWait, VWrite : VerbPhrase ; +--- VBuy, VDrink, VEat : VerbPhrase ; +--- VWait : Person -> VerbPhrase ; + +-- other new things allowed by the resource + +--- PBecause : Sentence -> Sentence -> Phrase ; -- I want to swim because it is hot + + He, She, -- he, she + WeMale, WeFemale, -- we, said by men/women (affects agreement) + YouPlurFamMale, YouPlurFamFemale, -- plural familiar you, said to men/women (affects agreement) + YouPlurPolMale, YouPlurPolFemale, -- plural polite you, said to men/women (affects agreement) + TheyMale, TheyFemale : Person ; -- they, said of men/women (affects agreement) + } diff --git a/examples/phrasebook/SentencesGer.gf b/examples/phrasebook/SentencesGer.gf index 336aa4b11..7378c5201 100644 --- a/examples/phrasebook/SentencesGer.gf +++ b/examples/phrasebook/SentencesGer.gf @@ -2,7 +2,9 @@ concrete SentencesGer of Sentences = NumeralGer ** SentencesI - [PYesToNo,SHaveNo,SHaveNoMass, Proposition, Action, Is, IsMass, SProp, SPropNot, QProp, AHaveCurr, ACitizen, ABePlace, AKnowSentence, AKnowPerson, AKnowQuestion, - Nationality, Language + Nationality, Language, + ADoVerbPhrase, AModVerbPhrase, ADoVerbPhrasePlace, AModVerbPhrasePlace, + YouPlurPolMale, YouPlurPolFemale ] with (Syntax = SyntaxGer), (Symbolic = SymbolicGer), @@ -38,4 +40,11 @@ concrete SentencesGer of Sentences = NumeralGer ** SentencesI - Nationality = {lang : CN ; country : NP ; prop : A} ; Language = CN ; -- kein Deutsch +-- the new things + lin + ADoVerbPhrase p vp = prop (mkCl p.name vp) ; + AModVerbPrase m p vp = prop (mkCl p.name (mkVP m vp)) ; + ADoVerbPhrasePlace p vp x = prop (mkCl p.name (mkVP vp x.at)) ; + AModVerbPrasePlace m p vp x = prop (mkCl p.name (mkVP m (mkVP vp x.at))) ; + YouPlurPolMale, YouPlurPolFemale = mkPerson youPol_Pron ; } diff --git a/examples/phrasebook/SentencesI.gf b/examples/phrasebook/SentencesI.gf index cf6f6400e..0eb83e26d 100644 --- a/examples/phrasebook/SentencesI.gf +++ b/examples/phrasebook/SentencesI.gf @@ -228,4 +228,48 @@ oper -- for languages with GenNP, use "p's wife" -- relativePerson n x (\a,b,c -> mkNP (GenNP b) a c) p ; +------------------------------------------------------------------------------------------ +-- New things added 30/11/2011 by AR +------------------------------------------------------------------------------------------ + + lincat + VerbPhrase = VP ; + Modality = VV ; + lin + ADoVerbPhrase p vp = mkCl p.name vp ; + AModVerbPhrase m p vp = mkCl p.name (mkVP m vp) ; + ADoVerbPhrasePlace p vp x = mkCl p.name (mkVP vp x.at) ; + AModVerbPhrasePlace m p vp x = mkCl p.name (mkVP m (mkVP vp x.at)) ; + + QWhereDoVerbPhrase p vp = mkQS (mkQCl where_IAdv (mkCl p.name vp)) ; + QWhereModVerbPhrase m p vp = mkQS (mkQCl where_IAdv (mkCl p.name (mkVP m vp))) ; + + MWant = want_VV ; + MCan = can_VV ; + MKnow = can8know_VV ; + MMust = must_VV ; + + VPlay = mkVP play_V ; + VRun = mkVP run_V ; + VSit = mkVP sit_V ; + VSleep = mkVP sleep_V ; + VSwim = mkVP swim_V ; + VWalk = mkVP walk_V ; + VDrink = mkVP ; + VEat = mkVP ; + VRead = mkVP ; + VWait = mkVP ; + VWrite = mkVP ; + +-- other new things allowed by the resource + +--- PBecause a b = SSubjS a because_Subj b ; + + He = mkPerson he_Pron ; + She = mkPerson she_Pron ; + WeMale, WeFemale = mkPerson we_Pron ; + YouPlurFamMale, YouPlurFamFemale = mkPerson youPl_Pron ; + YouPlurPolMale, YouPlurPolFemale = mkPerson youPl_Pron ; + TheyMale, TheyFemale = mkPerson they_Pron ; + } diff --git a/examples/phrasebook/SentencesTha.gf b/examples/phrasebook/SentencesTha.gf index f2cd5a8a5..acb0cac81 100644 --- a/examples/phrasebook/SentencesTha.gf +++ b/examples/phrasebook/SentencesTha.gf @@ -1,4 +1,9 @@ -concrete SentencesTha of Sentences = NumeralTha ** SentencesI with +concrete SentencesTha of Sentences = NumeralTha ** SentencesI - [ACitizen] with (Syntax = SyntaxTha), (Symbolic = SymbolicTha), - (Lexicon = LexiconTha) ; + (Lexicon = LexiconTha) ** open SyntaxTha, (P = ParadigmsTha), (R = ResTha) in { + +lin + ACitizen p n = mkCl p.name (mkVP (mkCN n (P.personN R.khon_s))) ; + +} diff --git a/examples/phrasebook/SentencesUrd.gf b/examples/phrasebook/SentencesUrd.gf index 9ab6013bb..5854a6380 100644 --- a/examples/phrasebook/SentencesUrd.gf +++ b/examples/phrasebook/SentencesUrd.gf @@ -1,4 +1,4 @@ -concrete SentencesUrd of Sentences = NumeralUrd ** SentencesI - [sing,IFemale,YouFamFemale,YouPolFemale] with +concrete SentencesUrd of Sentences = NumeralUrd ** SentencesI - [sing,IFemale,YouFamFemale,YouPolFemale,MMust] with (Syntax = SyntaxUrd), (Symbolic = SymbolicUrd), (Lexicon = LexiconUrd) ** diff --git a/examples/phrasebook/Words.gf b/examples/phrasebook/Words.gf index 6964a022c..ba5e1ef93 100644 --- a/examples/phrasebook/Words.gf +++ b/examples/phrasebook/Words.gf @@ -195,4 +195,13 @@ abstract Words = Sentences ** { SuperlPlace : Superlative -> PlaceKind -> Place ; -- the best bar + +-------------------------------------------------- +-- New 30/11/2011 AR +-------------------------------------------------- + + fun + Thai : Nationality ; + Baht : Currency ; -- Thailand + } diff --git a/examples/phrasebook/WordsEng.gf b/examples/phrasebook/WordsEng.gf index 96af50d07..49d922014 100644 --- a/examples/phrasebook/WordsEng.gf +++ b/examples/phrasebook/WordsEng.gf @@ -258,4 +258,12 @@ concrete WordsEng of Words = SentencesEng ** far_IAdv = ExtraEng.IAdvAdv (ss "far") ; +-------------------------------------------------- +-- New 30/11/2011 AR +-------------------------------------------------- + + lin + Thai = mkNat "Thai" "Thailand" ; + Baht = mkCN (mkN "baht" "baht") ; + }