summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authoraarne <aarne@chalmers.se>2010-03-20 21:21:50 +0000
committeraarne <aarne@chalmers.se>2010-03-20 21:21:50 +0000
commit5584415807061e801c124bdbaa37350c3b418a25 (patch)
tree5047ed35f1668be91a2d7222ba915907b6b09c22 /examples
parentfba592ecf8f7a14b30f7bcef932f516396169ee9 (diff)
started Phrasebook with Finnish and Romanian
Diffstat (limited to 'examples')
-rw-r--r--examples/phrasebook/Food.gf8
-rw-r--r--examples/phrasebook/FoodFin.gf24
-rw-r--r--examples/phrasebook/FoodRon.gf26
-rw-r--r--examples/phrasebook/Greetings.gf37
-rw-r--r--examples/phrasebook/GreetingsFin.gf38
-rw-r--r--examples/phrasebook/GreetingsRon.gf38
-rw-r--r--examples/phrasebook/Phrasebook.gf16
-rw-r--r--examples/phrasebook/PhrasebookFin.gf23
-rw-r--r--examples/phrasebook/PhrasebookRon.gf22
-rw-r--r--examples/phrasebook/Sentences.gf20
-rw-r--r--examples/phrasebook/SentencesFin.gf2
-rw-r--r--examples/phrasebook/SentencesI.gf25
-rw-r--r--examples/phrasebook/SentencesRon.gf2
13 files changed, 281 insertions, 0 deletions
diff --git a/examples/phrasebook/Food.gf b/examples/phrasebook/Food.gf
new file mode 100644
index 000000000..c0ee9077e
--- /dev/null
+++ b/examples/phrasebook/Food.gf
@@ -0,0 +1,8 @@
+-- (c) 2009 Aarne Ranta under LGPL
+
+abstract Food = Sentences ** {
+ fun
+ Wine, Cheese, Fish, Pizza : Kind ;
+ Fresh, Warm, Italian,
+ Expensive, Delicious, Boring : Quality ;
+}
diff --git a/examples/phrasebook/FoodFin.gf b/examples/phrasebook/FoodFin.gf
new file mode 100644
index 000000000..59e15b039
--- /dev/null
+++ b/examples/phrasebook/FoodFin.gf
@@ -0,0 +1,24 @@
+-- (c) 2009 Aarne Ranta under LGPL
+
+concrete FoodFin of Food = SentencesFin **
+ open SyntaxFin, ParadigmsFin in {
+ lin
+ Wine = mkCN (mkN "viini") ;
+ Pizza = mkCN (mkN "pizza") ;
+ Cheese = mkCN (mkN "juusto") ;
+ Fish = mkCN (mkN "kala") ;
+ Fresh = mkAP (mkA "tuore") ;
+ Warm = mkAP (mkA
+ (mkN "lämmin" "lämpimän" "lämmintä" "lämpimänä" "lämpimään"
+ "lämpiminä" "lämpimiä" "lämpimien" "lämpimissä" "lämpimiin"
+ )
+ "lämpimämpi" "lämpimin") ;
+ Italian = mkAP (mkA "italialainen") ;
+ Expensive = mkAP (mkA "kallis") ;
+ Delicious = mkAP (mkA "herkullinen") ;
+ Boring = mkAP (mkA "tylsä") ;
+
+-- oper ---- optimization lasts forever
+-- mkCNN : Str -> CN = \s -> mkCN (mkN s) ;
+-- mkAPA : Str -> AP = \s -> mkAP (mkA s) ;
+}
diff --git a/examples/phrasebook/FoodRon.gf b/examples/phrasebook/FoodRon.gf
new file mode 100644
index 000000000..12679cbc6
--- /dev/null
+++ b/examples/phrasebook/FoodRon.gf
@@ -0,0 +1,26 @@
+-- (c) 2009 Ramona Enache under LGPL
+
+concrete FoodRon of Food = SentencesRon ** open
+ SyntaxRon,
+ ParadigmsRon in
+{
+flags coding=utf8 ;
+
+lin
+
+Wine = mkCN (mkN "vin" "vinuri" neuter) ;
+Cheese = mkCN (mkN "brânzã" "brânzeturi" feminine) ;
+Fish = mkCN (mkN "peºte" "peºti" masculine) ;
+Pizza = mkCN (mkN "pizza" "pizze" feminine) ;
+
+Fresh = mkAPA "proaspãt" "proaspãtã" "proaspeþi" "proaspete" ;
+Warm = mkAPA "cald" "caldã" "calzi" "calde" ;
+Italian = mkAPA "italian" "italianã" "italieni" "italiene" ;
+Expensive = mkAPA "scump" "scumpã" "scumpi" "scumpe" ;
+Delicious = mkAPA "delicios" "delcioasã" "delicioºi" "delicioase" ;
+Boring = mkAPA "plictisitor" "plictisitoare" "plictisitori" "plictisitoare" ;
+
+oper
+mkAPA : (_,_,_,_ : Str) -> AP = \x,y,z,u -> mkAP (mkA x y z u) ;
+
+}
diff --git a/examples/phrasebook/Greetings.gf b/examples/phrasebook/Greetings.gf
new file mode 100644
index 000000000..de7c6f064
--- /dev/null
+++ b/examples/phrasebook/Greetings.gf
@@ -0,0 +1,37 @@
+abstract Greetings = {
+
+cat
+ Greeting ;
+ Politeness ;
+
+fun
+ GHello : Greeting ;
+ GThanks : Greeting ;
+ GHowAreYou : Greeting ;
+ GPleaseGive : Greeting ;
+ GExcuse : Greeting ;
+ GSorry : Greeting ;
+ GGoodbye : Greeting ;
+ GBye : Greeting ;
+ GWhatsYourName : Greeting ;
+ GNiceToMeetYou : Greeting ;
+ GSeeYouSoon : Greeting ;
+ GHelp : Greeting ;
+ GLookOut : Greeting ;
+ GGoodMorning : Greeting ;
+ GGoodDay : Greeting ;
+ GGoodEvening : Greeting ;
+ GGoodNight : Greeting ;
+ GImHungry : Greeting ;
+ GImThirsty : Greeting ;
+ GImTired : Greeting ;
+ GImScared : Greeting ;
+ GIdontUnderstand : Greeting ;
+ GWheresTheBathroom : Greeting ;
+ GTheCheck : Greeting ;
+
+ GYes : Greeting ;
+ GNo : Greeting ;
+
+
+}
diff --git a/examples/phrasebook/GreetingsFin.gf b/examples/phrasebook/GreetingsFin.gf
new file mode 100644
index 000000000..2b7b5568f
--- /dev/null
+++ b/examples/phrasebook/GreetingsFin.gf
@@ -0,0 +1,38 @@
+concrete GreetingsFin of Greetings = open Prelude in {
+
+flags coding=utf8 ;
+
+lincat
+ Greeting, Politeness = SS ;
+
+lin
+ GHello = ss "hei" ;
+ GThanks = ss "kiitos" ;
+ GHowAreYou = ss "mitä kuuluu" ;
+ GPleaseGive = ss "ole hyvä" ;
+ GExcuse = ss "anteeksi" ;
+ GSorry = ss "anteeksi" ;
+ GGoodbye = ss "näkemiin" ;
+ GBye = ss "hei hei" ;
+ GWhatsYourName = ss "mikä sinun nimesi on" ;
+ GNiceToMeetYou = ss "hauska tutustua" ;
+ GSeeYouSoon = ss "nähdään pian" ;
+ GHelp = ss "apua" ;
+ GLookOut = ss "varo" ;
+ GGoodMorning = ss "hyvää huomenta" ;
+ GGoodDay = ss "hyvää päivää" ;
+ GGoodEvening = ss "hyvää iltaa" ;
+ GGoodNight = ss "hyvää yötä" ;
+ GImHungry = ss "minun on nälkä" ;
+ GImThirsty = ss "minun on jano" ;
+ GImTired = ss "minä olen väsynyt" ;
+ GImScared = ss "minua pelottaa" ;
+ GIdontUnderstand = ss "en ymmärrä" ;
+ GWheresTheBathroom = ss "missä on vessa" ;
+ GTheCheck = ss "lasku" ;
+
+ GYes = ss "kyllä" ;
+ GNo = ss "ei" ;
+
+
+}
diff --git a/examples/phrasebook/GreetingsRon.gf b/examples/phrasebook/GreetingsRon.gf
new file mode 100644
index 000000000..acc0f5241
--- /dev/null
+++ b/examples/phrasebook/GreetingsRon.gf
@@ -0,0 +1,38 @@
+concrete GreetingsRon of Greetings = open Prelude in {
+
+flags coding = utf8 ;
+
+lincat
+ Greeting, Politeness = SS ;
+
+lin
+ GHello = ss "salut" ;
+ GThanks = ss "mulţumesc" ;
+ GHowAreYou = ss "ce faci" ;
+ GPleaseGive = ss "vă rog" ;
+ GExcuse = ss "pardon" ;
+ GSorry = ss "îmi pare rău" ;
+ GGoodbye = ss "la revedere" ;
+ GBye = ss "pa" ;
+ GWhatsYourName = ss "cum te cheamă" ;
+ GNiceToMeetYou = ss "încântat" ;
+ GSeeYouSoon = ss "pe curând" ;
+ GHelp = ss "ajutor" ;
+ GLookOut = ss "atenţie" ;
+ GGoodMorning = ss "bună dimineaţa" ;
+ GGoodDay = ss "bună ziua" ;
+ GGoodEvening = ss "bună seara" ;
+ GGoodNight = ss "noapte bună" ;
+ GImHungry = ss "mi-e foame" ;
+ GImThirsty = ss "mi-e sete" ;
+ GImTired = ss "mi-e somn" ;
+ GImScared = ss "mi-e frică" ;
+ GIdontUnderstand = ss "nu înţeleg" ;
+ GWheresTheBathroom = ss "unde e toaleta" ;
+ GTheCheck = ss "nota de plată" ;
+
+ GYes = ss "da" ;
+ GNo = ss "nu" ;
+
+
+}
diff --git a/examples/phrasebook/Phrasebook.gf b/examples/phrasebook/Phrasebook.gf
new file mode 100644
index 000000000..05b777954
--- /dev/null
+++ b/examples/phrasebook/Phrasebook.gf
@@ -0,0 +1,16 @@
+abstract Phrasebook =
+ Greetings,
+ Food
+ ** {
+
+flags startcat = Phrase ;
+
+cat
+ Phrase ;
+fun
+ PNumeral : Numeral -> Phrase ;
+ PGreeting : Greeting -> Phrase ;
+ PSentence : Sentence -> Phrase ;
+
+
+}
diff --git a/examples/phrasebook/PhrasebookFin.gf b/examples/phrasebook/PhrasebookFin.gf
new file mode 100644
index 000000000..340d1c075
--- /dev/null
+++ b/examples/phrasebook/PhrasebookFin.gf
@@ -0,0 +1,23 @@
+--# -path=.:present
+
+concrete PhrasebookFin of Phrasebook =
+ GreetingsFin,
+ FoodFin ** open
+ SyntaxFin,
+ ResFin, ---- for Num to Utt
+ Prelude in {
+
+lincat
+ Phrase = Utt ;
+
+lin
+ PNumeral n =
+ mkPhrase (ss ((SyntaxFin.mkCard <n : Numeral>).s ! Sg ! Nom)) ; ----
+ PGreeting g = mkPhrase g ;
+ PSentence s = s ;
+
+
+oper
+ mkPhrase : SS -> Utt = \s -> lin Utt s ;
+
+}
diff --git a/examples/phrasebook/PhrasebookRon.gf b/examples/phrasebook/PhrasebookRon.gf
new file mode 100644
index 000000000..5dd15b04b
--- /dev/null
+++ b/examples/phrasebook/PhrasebookRon.gf
@@ -0,0 +1,22 @@
+--# -path=.:present
+
+concrete PhrasebookRon of Phrasebook =
+ GreetingsRon,
+ FoodRon
+ ** open
+ SyntaxRon,
+ ResRon, ---- for Num to Utt
+ Prelude in {
+
+lincat
+ Phrase = Utt ;
+
+lin
+ PNumeral n = mkPhrase (ss ((mkCard <n : Numeral>).sp ! Masc)) ; ----
+ PGreeting g = mkPhrase g ;
+ PSentence s = s ;
+
+oper
+ mkPhrase : SS -> Utt = \s -> lin Utt s ;
+
+}
diff --git a/examples/phrasebook/Sentences.gf b/examples/phrasebook/Sentences.gf
new file mode 100644
index 000000000..0a9c7b57e
--- /dev/null
+++ b/examples/phrasebook/Sentences.gf
@@ -0,0 +1,20 @@
+abstract Sentences = Numeral ** {
+
+ cat
+ Sentence ; Object ; Item ; Kind ; Quality ;
+
+ fun
+ Is : Item -> Quality -> Sentence ;
+ IsNot : Item -> Quality -> Sentence ;
+
+ IWant : Object -> Sentence ;
+ DoYouHave : Kind -> Sentence ;
+ WhetherIs : Item -> Quality -> Sentence ;
+ ObjItem : Item -> Object ;
+ ObjNumber : Numeral -> Kind -> Object ;
+
+ This, That, These, Those : Kind -> Item ;
+ SuchKind : Quality -> Kind -> Kind ;
+ Very : Quality -> Quality ;
+
+}
diff --git a/examples/phrasebook/SentencesFin.gf b/examples/phrasebook/SentencesFin.gf
new file mode 100644
index 000000000..9c5cd6297
--- /dev/null
+++ b/examples/phrasebook/SentencesFin.gf
@@ -0,0 +1,2 @@
+concrete SentencesFin of Sentences = NumeralFin ** SentencesI with
+ (Syntax = SyntaxFin) ;
diff --git a/examples/phrasebook/SentencesI.gf b/examples/phrasebook/SentencesI.gf
new file mode 100644
index 000000000..b917d70c9
--- /dev/null
+++ b/examples/phrasebook/SentencesI.gf
@@ -0,0 +1,25 @@
+incomplete concrete SentencesI of Sentences = Numeral **
+ open Syntax in {
+ lincat
+ Sentence = Utt ;
+ Item = NP ;
+ Kind = CN ;
+ Quality = AP ;
+ Object = NP ;
+ lin
+ Is item quality = mkUtt (mkCl item quality) ;
+ IsNot item quality = mkUtt (mkS negativePol (mkCl item quality)) ;
+ WhetherIs item quality = mkUtt (mkQCl (mkCl item quality)) ;
+ IWant obj = mkUtt (mkCl (mkNP i_Pron) want_VV (mkVP have_V2 obj)) ;
+ DoYouHave kind =
+ mkUtt (mkQCl (mkCl (mkNP youPol_Pron) have_V2 (mkNP kind))) ;
+ ObjItem i = i ;
+ ObjNumber n k = mkNP <n : Numeral> k ;
+
+ This kind = mkNP this_Quant kind ;
+ That kind = mkNP that_Quant kind ;
+ These kind = mkNP this_Quant plNum kind ;
+ Those kind = mkNP that_Quant plNum kind ;
+ SuchKind quality kind = mkCN quality kind ;
+ Very quality = mkAP very_AdA quality ;
+}
diff --git a/examples/phrasebook/SentencesRon.gf b/examples/phrasebook/SentencesRon.gf
new file mode 100644
index 000000000..ab6b67585
--- /dev/null
+++ b/examples/phrasebook/SentencesRon.gf
@@ -0,0 +1,2 @@
+concrete SentencesRon of Sentences = NumeralRon ** SentencesI with
+ (Syntax = SyntaxRon) ;