summaryrefslogtreecommitdiff
path: root/book/examples/chapter5
diff options
context:
space:
mode:
authoraarne <aarne@chalmers.se>2010-11-22 12:55:37 +0000
committeraarne <aarne@chalmers.se>2010-11-22 12:55:37 +0000
commit76ba03b545600054176612201de78dca16eb65e1 (patch)
tree5615286b239bee637b32465e9cbf36807ab2c318 /book/examples/chapter5
parent0bf41793694e8b3101d09e34858eba8ab2c8c5b6 (diff)
started a subdir for the book
Diffstat (limited to 'book/examples/chapter5')
-rw-r--r--book/examples/chapter5/Foods.gf15
-rw-r--r--book/examples/chapter5/FoodsCat.gf7
-rw-r--r--book/examples/chapter5/FoodsEng.gf27
-rw-r--r--book/examples/chapter5/FoodsFin.gf7
-rw-r--r--book/examples/chapter5/FoodsGer.gf7
-rw-r--r--book/examples/chapter5/FoodsI.gf29
-rw-r--r--book/examples/chapter5/FoodsIta.gf8
-rw-r--r--book/examples/chapter5/FoodsSwe.gf7
-rw-r--r--book/examples/chapter5/LexFoods.gf15
-rw-r--r--book/examples/chapter5/LexFoodsCat.gf18
-rw-r--r--book/examples/chapter5/LexFoodsEng.gf20
-rw-r--r--book/examples/chapter5/LexFoodsFin.gf20
-rw-r--r--book/examples/chapter5/LexFoodsGer.gf16
-rw-r--r--book/examples/chapter5/LexFoodsIta.gf16
-rw-r--r--book/examples/chapter5/LexFoodsSwe.gf16
15 files changed, 228 insertions, 0 deletions
diff --git a/book/examples/chapter5/Foods.gf b/book/examples/chapter5/Foods.gf
new file mode 100644
index 000000000..8ea02f39d
--- /dev/null
+++ b/book/examples/chapter5/Foods.gf
@@ -0,0 +1,15 @@
+-- (c) 2009 Aarne Ranta under LGPL
+
+abstract Foods = {
+ flags startcat = Comment ;
+ cat
+ Comment ; Item ; Kind ; Quality ;
+ fun
+ Pred : Item -> Quality -> Comment ;
+ This, That, These, Those : Kind -> Item ;
+ Mod : Quality -> Kind -> Kind ;
+ Wine, Cheese, Fish, Pizza : Kind ;
+ Very : Quality -> Quality ;
+ Fresh, Warm, Italian,
+ Expensive, Delicious, Boring : Quality ;
+}
diff --git a/book/examples/chapter5/FoodsCat.gf b/book/examples/chapter5/FoodsCat.gf
new file mode 100644
index 000000000..5ad38d0dc
--- /dev/null
+++ b/book/examples/chapter5/FoodsCat.gf
@@ -0,0 +1,7 @@
+--# -path=.:present
+
+-- (c) 2009 Jordi Saludes under LGPL
+
+concrete FoodsCat of Foods = FoodsI with
+ (Syntax = SyntaxCat),
+ (LexFoods = LexFoodsCat) ;
diff --git a/book/examples/chapter5/FoodsEng.gf b/book/examples/chapter5/FoodsEng.gf
new file mode 100644
index 000000000..5c2158ce2
--- /dev/null
+++ b/book/examples/chapter5/FoodsEng.gf
@@ -0,0 +1,27 @@
+--# -path=.:../foods:minimal:present
+
+concrete FoodsEng of Foods = open SyntaxEng,ParadigmsEng in {
+ lincat
+ Phrase = Cl ;
+ Item = NP ;
+ Kind = CN ;
+ Quality = AP ;
+ lin
+ Is item quality = mkCl item quality ;
+ 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 ;
+ QKind quality kind = mkCN quality kind ;
+ Wine = mkCN (mkN "wine") ;
+ Pizza = mkCN (mkN "pizza") ;
+ Cheese = mkCN (mkN "cheese") ;
+ Fish = mkCN (mkN "fish" "fish") ;
+ Very quality = mkAP very_AdA quality ;
+ Fresh = mkAP (mkA "fresh") ;
+ Warm = mkAP (mkA "warm") ;
+ Italian = mkAP (mkA "Italian") ;
+ Expensive = mkAP (mkA "expensive") ;
+ Delicious = mkAP (mkA "delicious") ;
+ Boring = mkAP (mkA "boring") ;
+}
diff --git a/book/examples/chapter5/FoodsFin.gf b/book/examples/chapter5/FoodsFin.gf
new file mode 100644
index 000000000..34da5764b
--- /dev/null
+++ b/book/examples/chapter5/FoodsFin.gf
@@ -0,0 +1,7 @@
+--# -path=.:present
+
+-- (c) 2009 Aarne Ranta under LGPL
+
+concrete FoodsFin of Foods = FoodsI with
+ (Syntax = SyntaxFin),
+ (LexFoods = LexFoodsFin) ;
diff --git a/book/examples/chapter5/FoodsGer.gf b/book/examples/chapter5/FoodsGer.gf
new file mode 100644
index 000000000..934cefb9c
--- /dev/null
+++ b/book/examples/chapter5/FoodsGer.gf
@@ -0,0 +1,7 @@
+--# -path=.:present
+
+-- (c) 2009 Aarne Ranta under LGPL
+
+concrete FoodsGer of Foods = FoodsI with
+ (Syntax = SyntaxGer),
+ (LexFoods = LexFoodsGer) ;
diff --git a/book/examples/chapter5/FoodsI.gf b/book/examples/chapter5/FoodsI.gf
new file mode 100644
index 000000000..f4113b724
--- /dev/null
+++ b/book/examples/chapter5/FoodsI.gf
@@ -0,0 +1,29 @@
+-- (c) 2009 Aarne Ranta under LGPL
+
+incomplete concrete FoodsI of Foods =
+ open Syntax, LexFoods in {
+ lincat
+ Comment = Utt ;
+ Item = NP ;
+ Kind = CN ;
+ Quality = AP ;
+ lin
+ Pred item quality = mkUtt (mkCl item quality) ;
+ This kind = mkNP this_Det kind ;
+ That kind = mkNP that_Det kind ;
+ These kind = mkNP these_Det kind ;
+ Those kind = mkNP those_Det kind ;
+ Mod quality kind = mkCN quality kind ;
+ Very quality = mkAP very_AdA quality ;
+
+ Wine = mkCN wine_N ;
+ Pizza = mkCN pizza_N ;
+ Cheese = mkCN cheese_N ;
+ Fish = mkCN fish_N ;
+ Fresh = mkAP fresh_A ;
+ Warm = mkAP warm_A ;
+ Italian = mkAP italian_A ;
+ Expensive = mkAP expensive_A ;
+ Delicious = mkAP delicious_A ;
+ Boring = mkAP boring_A ;
+}
diff --git a/book/examples/chapter5/FoodsIta.gf b/book/examples/chapter5/FoodsIta.gf
new file mode 100644
index 000000000..51baf9d70
--- /dev/null
+++ b/book/examples/chapter5/FoodsIta.gf
@@ -0,0 +1,8 @@
+--# -path=.:present
+
+-- (c) 2009 Aarne Ranta under LGPL
+
+concrete FoodsIta of Foods = FoodsI with
+ (Syntax = SyntaxIta),
+ (LexFoods = LexFoodsIta) ;
+
diff --git a/book/examples/chapter5/FoodsSwe.gf b/book/examples/chapter5/FoodsSwe.gf
new file mode 100644
index 000000000..cbb35fb98
--- /dev/null
+++ b/book/examples/chapter5/FoodsSwe.gf
@@ -0,0 +1,7 @@
+--# -path=.:present
+
+-- (c) 2009 Aarne Ranta under LGPL
+
+concrete FoodsSwe of Foods = FoodsI with
+ (Syntax = SyntaxSwe),
+ (LexFoods = LexFoodsSwe) ** {flags language = sv_SE;} ;
diff --git a/book/examples/chapter5/LexFoods.gf b/book/examples/chapter5/LexFoods.gf
new file mode 100644
index 000000000..12ace208c
--- /dev/null
+++ b/book/examples/chapter5/LexFoods.gf
@@ -0,0 +1,15 @@
+-- (c) 2009 Aarne Ranta under LGPL
+
+interface LexFoods = open Syntax in {
+ oper
+ wine_N : N ;
+ pizza_N : N ;
+ cheese_N : N ;
+ fish_N : N ;
+ fresh_A : A ;
+ warm_A : A ;
+ italian_A : A ;
+ expensive_A : A ;
+ delicious_A : A ;
+ boring_A : A ;
+}
diff --git a/book/examples/chapter5/LexFoodsCat.gf b/book/examples/chapter5/LexFoodsCat.gf
new file mode 100644
index 000000000..624fc98c8
--- /dev/null
+++ b/book/examples/chapter5/LexFoodsCat.gf
@@ -0,0 +1,18 @@
+-- (c) 2009 Jordi Saludes under LGPL
+
+instance LexFoodsCat of LexFoods =
+ open SyntaxCat, ParadigmsCat, (M = MorphoCat) in {
+ flags
+ coding = utf8 ;
+ oper
+ wine_N = mkN "vi" "vins" M.Masc ;
+ pizza_N = mkN "pizza" ;
+ cheese_N = mkN "formatge" ;
+ fish_N = mkN "peix" "peixos" M.Masc;
+ fresh_A = mkA "fresc" "fresca" "frescos" "fresques" "frescament";
+ warm_A = mkA "calent" ;
+ italian_A = mkA "italià" "italiana" "italians" "italianes" "italianament" ;
+ expensive_A = mkA "car" ;
+ delicious_A = mkA "deliciós" "deliciosa" "deliciosos" "delicioses" "deliciosament";
+ boring_A = mkA "aburrit" "aburrida" "aburrits" "aburrides" "aburridament" ;
+}
diff --git a/book/examples/chapter5/LexFoodsEng.gf b/book/examples/chapter5/LexFoodsEng.gf
new file mode 100644
index 000000000..01024b356
--- /dev/null
+++ b/book/examples/chapter5/LexFoodsEng.gf
@@ -0,0 +1,20 @@
+instance LexFoodsEng of LexFoods = open SyntaxEng, ParadigmsEng, IrregEng in {
+ oper
+ wine_N = mkN "wine" ;
+ pizza_N = mkN "pizza" ;
+ cheese_N = mkN "cheese" ;
+ fish_N = mkN "fish" "fish" ;
+ fresh_A = mkA "fresh" ;
+ warm_A = mkA "warm" ;
+ italian_A = mkA "Italian" ;
+ expensive_A = mkA "expensive" ;
+ delicious_A = mkA "delicious" ;
+ boring_A = mkA "boring" ;
+
+ eat_V2 = mkV2 eat_V ;
+ drink_V2 = mkV2 drink_V ;
+ pay_V2 = mkV2 pay_V ;
+ lady_N = mkN "lady" ;
+ gentleman_N = mkN "gentleman" "gentlemen" ;
+
+}
diff --git a/book/examples/chapter5/LexFoodsFin.gf b/book/examples/chapter5/LexFoodsFin.gf
new file mode 100644
index 000000000..4cf26511a
--- /dev/null
+++ b/book/examples/chapter5/LexFoodsFin.gf
@@ -0,0 +1,20 @@
+-- (c) 2009 Aarne Ranta under LGPL
+
+instance LexFoodsFin of LexFoods =
+ open SyntaxFin, ParadigmsFin in {
+ oper
+ wine_N = mkN "viini" ;
+ pizza_N = mkN "pizza" ;
+ cheese_N = mkN "juusto" ;
+ fish_N = mkN "kala" ;
+ fresh_A = mkA "tuore" ;
+ warm_A = 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_A = mkA "italialainen" ;
+ expensive_A = mkA "kallis" ;
+ delicious_A = mkA "herkullinen" ;
+ boring_A = mkA "tylsä" ;
+}
diff --git a/book/examples/chapter5/LexFoodsGer.gf b/book/examples/chapter5/LexFoodsGer.gf
new file mode 100644
index 000000000..a420e22d3
--- /dev/null
+++ b/book/examples/chapter5/LexFoodsGer.gf
@@ -0,0 +1,16 @@
+-- (c) 2009 Aarne Ranta under LGPL
+
+instance LexFoodsGer of LexFoods =
+ open SyntaxGer, ParadigmsGer in {
+ oper
+ wine_N = mkN "Wein" ;
+ pizza_N = mkN "Pizza" "Pizzen" feminine ;
+ cheese_N = mkN "Käse" "Käse" masculine ;
+ fish_N = mkN "Fisch" ;
+ fresh_A = mkA "frisch" ;
+ warm_A = mkA "warm" "wärmer" "wärmste" ;
+ italian_A = mkA "italienisch" ;
+ expensive_A = mkA "teuer" ;
+ delicious_A = mkA "köstlich" ;
+ boring_A = mkA "langweilig" ;
+}
diff --git a/book/examples/chapter5/LexFoodsIta.gf b/book/examples/chapter5/LexFoodsIta.gf
new file mode 100644
index 000000000..11de5fcda
--- /dev/null
+++ b/book/examples/chapter5/LexFoodsIta.gf
@@ -0,0 +1,16 @@
+-- (c) 2009 Aarne Ranta under LGPL
+
+instance LexFoodsIta of LexFoods =
+ open SyntaxIta, ParadigmsIta in {
+ oper
+ wine_N = mkN "vino" ;
+ pizza_N = mkN "pizza" ;
+ cheese_N = mkN "formaggio" ;
+ fish_N = mkN "pesce" ;
+ fresh_A = mkA "fresco" ;
+ warm_A = mkA "caldo" ;
+ italian_A = mkA "italiano" ;
+ expensive_A = mkA "caro" ;
+ delicious_A = mkA "delizioso" ;
+ boring_A = mkA "noioso" ;
+}
diff --git a/book/examples/chapter5/LexFoodsSwe.gf b/book/examples/chapter5/LexFoodsSwe.gf
new file mode 100644
index 000000000..72e7e3e86
--- /dev/null
+++ b/book/examples/chapter5/LexFoodsSwe.gf
@@ -0,0 +1,16 @@
+-- (c) 2009 Aarne Ranta under LGPL
+
+instance LexFoodsSwe of LexFoods =
+ open SyntaxSwe, ParadigmsSwe in {
+ oper
+ wine_N = mkN "vin" "vinet" "viner" "vinerna" ;
+ pizza_N = mkN "pizza" ;
+ cheese_N = mkN "ost" ;
+ fish_N = mkN "fisk" ;
+ fresh_A = mkA "färsk" ;
+ warm_A = mkA "varm" ;
+ italian_A = mkA "italiensk" ;
+ expensive_A = mkA "dyr" ;
+ delicious_A = mkA "läcker" ;
+ boring_A = mkA "tråkig" ;
+}