From 6dda3d2ebf60362bebe773f4d20e03d047eed4d5 Mon Sep 17 00:00:00 2001 From: aarne Date: Mon, 12 Apr 2010 21:26:36 +0000 Subject: [PATCH] completions of PhrasebookGer --- examples/phrasebook/Makefile | 8 +++-- examples/phrasebook/Ontology.html | 3 +- examples/phrasebook/WordsGer.gf | 51 ++++++++++++++++++++++++++----- examples/phrasebook/missing.txt | 4 +-- 4 files changed, 53 insertions(+), 13 deletions(-) diff --git a/examples/phrasebook/Makefile b/examples/phrasebook/Makefile index 2178c46b5..aafda9a92 100644 --- a/examples/phrasebook/Makefile +++ b/examples/phrasebook/Makefile @@ -1,9 +1,13 @@ compile = runghc Compile -all: demo missing +all: fin demo missing -demo: +demo: compdemo linkdemo + +compdemo: $(compile) Eng Fre Ger Ita Ron Swe DisambPhrasebookEng + +linkdemo: $(compile) -link Eng Fin Fre Ger Ita Ron Swe DisambPhrasebookEng #separate, because slow... diff --git a/examples/phrasebook/Ontology.html b/examples/phrasebook/Ontology.html index 469da449c..12ccd65cc 100644 --- a/examples/phrasebook/Ontology.html +++ b/examples/phrasebook/Ontology.html @@ -244,7 +244,8 @@ Notice that also negations and questions can be formed from these. AWantGo : Person -> Place -> Action ; -- I want to go to the hospital -miscellaneous phrases +Miscellaneous phrases. Notice that also negations and questions can be formed from +propositions.
       QWhatAge       : Person -> Question ;            -- how many years are you
       QWhatName      : Person -> Question ;            -- what is your name
diff --git a/examples/phrasebook/WordsGer.gf b/examples/phrasebook/WordsGer.gf
index 51303f87f..1b41fdb69 100644
--- a/examples/phrasebook/WordsGer.gf
+++ b/examples/phrasebook/WordsGer.gf
@@ -1,7 +1,7 @@
 -- (c) 2009 Aarne Ranta under LGPL
 
 concrete WordsGer of Words = SentencesGer ** 
-    open SyntaxGer, ParadigmsGer, IrregGer, (L = LexiconGer), Prelude in {
+    open SyntaxGer, ParadigmsGer, IrregGer, (L = LexiconGer), ExtraGer, Prelude in {
 
    lin
 
@@ -23,6 +23,7 @@ concrete WordsGer of Words = SentencesGer **
 -- properties
 
     Bad = L.bad_A ;
+    Cheap = mkA "billig" ;
     Boring = mkA "langweilig" ;
     Cold = L.cold_A ;
     Delicious = mkA "lecker" ;
@@ -46,11 +47,11 @@ concrete WordsGer of Words = SentencesGer **
 
 -- currencies
 
-    DanishCrown = mkCN (mkA "Dänisch") (mkN "Krone") ;
+    DanishCrown = mkCN (mkA "Dänisch") (mkN "Krone") | mkCN (mkN "Krone") ;
 --     Dollar = mkCN (mkN "dollar" "dollar") ;
     Euro = mkCN (mkN "Euro" "Euro" "Euro" "Euro" "Euro" "Euro" neuter) ;
 --     Lei = mkCN (mkN "lei" "lei") ;
---     SwedishCrown = mkCN (mkA "svensk") (mkN "krona") ;
+    SwedishCrown = mkCN (mkA "Schwedisch") (mkN "Krone") | mkCN (mkN "Krone") ;
 
 -- nationalities
 
@@ -58,21 +59,31 @@ concrete WordsGer of Words = SentencesGer **
     Belgium = mkNP (mkPN "Belgien") ;
     English = mkNat "Englisch" "England" ;
     Finnish = mkNat "Finnisch" "Finnland" ;
---     Flemish = mkNP (mkPN "flamländska") ;
+    Flemish = mkNP (mkPN "Flämisch") ;
     French = mkNat "Französisch" "Frankreich" ; 
     Italian = mkNat "Italienisch" "Italien" ;
---     Romanian = mkNat "rumänsk" "Rumänien" ;
---     Swedish = mkNat "svensk" "Sverige" ;
--- 
--- -- actions
+    Romanian = mkNat "Rumänisch" "Rumänien" ;
+    Swedish = mkNat "Schwedisch" "Schweden" ;
 
+-- actions
+
+    AHasAge p num = mkCl p.name (mkNP num L.year_N) ;
     AHasName p name = mkCl p.name (mkV2 heißen_V) name ;
     AHungry p = mkCl p.name (mkA "hungrig") ;
+    AHasChildren p num = mkCl p.name have_V2 (mkNP num L.child_N) ;
+    AHasRoom p num = mkCl p.name have_V2 
+      (mkNP (mkNP a_Det (mkN "Zimmer" "Zimmer" neuter)) 
+        (SyntaxGer.mkAdv for_Prep (mkNP num (mkN "Persone")))) ;
+    AHasTable p num = mkCl p.name have_V2 
+      (mkNP (mkNP a_Det (mkN "Tisch")) 
+        (SyntaxGer.mkAdv for_Prep (mkNP num (mkN "Persone")))) ;
     AIll p = mkCl p.name (mkA "Krank") ;
     AKnow p = mkCl p.name wissen_V ;
     ALike p item = mkCl item (mkV2 (fixprefixV "ge" (fallen_V)) dative) p.name ;
     ALive p co = mkCl p.name (mkVP (mkVP (mkV "wohnen")) (SyntaxGer.mkAdv in_Prep co)) ;
     ALove p q = mkCl p.name (mkV2 (mkV "lieben")) q.name ;
+    AMarried p = mkCl p.name (mkA "verheiratet") ;
+    AReady p = mkCl p.name (mkA "fertig") ;
     AScared p = mkCl p.name have_V2 (mkNP (mkN "Angst" "Angsten" feminine)) ;
     ASpeak p lang = mkCl p.name  (mkV2 sprechen_V) lang ;
     AThirsty p = mkCl p.name (mkA "dürstig") ;
@@ -84,6 +95,7 @@ concrete WordsGer of Words = SentencesGer **
 -- miscellaneous
 
     QWhatName p = mkQS (mkQCl how_IAdv (mkCl p.name heißen_V)) ;
+    QWhatAge p = mkQS (mkQCl (ICompAP (mkAP L.old_A)) p.name) ;
 
     PropOpen p = mkCl p.name open_Adv ;
     PropClosed p = mkCl p.name closed_Adv ;
@@ -95,6 +107,24 @@ concrete WordsGer of Words = SentencesGer **
     HowMuchCost item = mkQS (mkQCl how8much_IAdv (mkCl item (mkV "kosten"))) ; 
     ItCost item price = mkCl item (mkV2 (mkV "kosten")) price ;
 
+-- Building phrases from strings is complicated: the solution is to use
+-- mkText : Text -> Text -> Text ;
+
+--    PSeeYou d = mkText (lin Text (ss ("auf Wiedersehen"))) (mkPhrase (mkUtt d)) ;
+--    PSeeYouPlace p d = 
+--      mkText (lin Text (ss ("auf Wiedersehen"))) 
+--        (mkText (mkPhrase (mkUtt p.at)) (mkPhrase (mkUtt d))) ;
+
+-- Relations are expressed as "my wife" or "my son's wife", as defined by $xOf$
+-- below. Languages without productive genitives must use an equivalent of
+-- "the wife of my son" for non-pronouns.
+
+    Wife = xOf sing (mkN "Frau" "Frauen" feminine) ;
+    Husband = xOf sing L.man_N ;
+    Son = xOf sing (mkN "Sohn" "Söhne" masculine) ;
+    Daughter = xOf sing (mkN "Tochter" "Töchter" feminine) ;
+    Children = xOf plur L.child_N ;
+
 -- week days
 
     Monday = mkDay "Montag" ;
@@ -105,6 +135,9 @@ concrete WordsGer of Words = SentencesGer **
     Saturday = mkDay "Samstag" ;
     Sunday = mkDay "Sonntag" ;
 
+    Tomorrow = ParadigmsGer.mkAdv "morgen" ;
+
+
   oper
     mkNat : Str -> Str -> {lang : NP ; prop : A ; country : NP} = \nat,co -> 
       {lang = mkNP (mkPN nat) ; 
@@ -126,4 +159,6 @@ concrete WordsGer of Words = SentencesGer **
     open_Adv = mkAdv "geöffnet" ;  ---- Adv to get right word order easily
     closed_Adv = mkAdv "geschlossen" ;
 
+    xOf : GNumber -> N -> NPPerson -> NPPerson = \n,x,p -> mkRelative n (mkCN x) p ; 
+
 }
diff --git a/examples/phrasebook/missing.txt b/examples/phrasebook/missing.txt
index c1d166b1c..200c5a081 100644
--- a/examples/phrasebook/missing.txt
+++ b/examples/phrasebook/missing.txt
@@ -1,8 +1,8 @@
 DisambPhrasebookEng :
 PhrasebookEng :
 PhrasebookFin :
-PhrasebookFre : AHasRoom AHasTable AReady Cheap Cinema Hotel PSeeYou PSeeYouPlace Park School Shop Suspect Theatre Tomorrow University
-PhrasebookGer : AHasAge AHasChildren AHasRoom AHasTable AMarried AReady Bar Cheap Chicken Children Cinema Coffee Daughter Dollar Flemish GNiceToMeetYou Hotel Husband Lei Meat Museum PSeeYou PSeeYouPlace Park QWhatAge Romanian School Shop Son Suspect Swedish SwedishCrown Tea Theatre Toilet Tomorrow Wife
+PhrasebookFre :
+PhrasebookGer : Bar Chicken Cinema Coffee Dollar GNiceToMeetYou Hotel Lei Meat Museum PSeeYou PSeeYouPlace Park School Shop Suspect Tea Theatre Toilet
 PhrasebookIta :
 PhrasebookRon : AHungry AThirsty Flemish GExcusePol GPleaseGivePol GSorryPol
 PhrasebookSwe :