summaryrefslogtreecommitdiff
path: root/book/examples/chapter4
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/chapter4
parent0bf41793694e8b3101d09e34858eba8ab2c8c5b6 (diff)
started a subdir for the book
Diffstat (limited to 'book/examples/chapter4')
-rw-r--r--book/examples/chapter4/Clothes.gf5
-rw-r--r--book/examples/chapter4/ClothesEng.gf10
-rw-r--r--book/examples/chapter4/ClothesIta.gf8
-rw-r--r--book/examples/chapter4/Comment.gf13
-rw-r--r--book/examples/chapter4/Comments.gf10
-rw-r--r--book/examples/chapter4/CommentsEng.gf4
-rw-r--r--book/examples/chapter4/CommentsI.gf15
-rw-r--r--book/examples/chapter4/CommentsIta.gf4
-rw-r--r--book/examples/chapter4/Computers.gf5
-rw-r--r--book/examples/chapter4/ComputersEng.gf10
-rw-r--r--book/examples/chapter4/ComputersIta.gf9
-rw-r--r--book/examples/chapter4/Exx.gf16
-rw-r--r--book/examples/chapter4/Foods.gf6
-rw-r--r--book/examples/chapter4/FoodsEng.gf16
-rw-r--r--book/examples/chapter4/FoodsIta.gf16
-rw-r--r--book/examples/chapter4/Shopping.gf2
-rw-r--r--book/examples/chapter4/ShoppingEng.gf4
-rw-r--r--book/examples/chapter4/ShoppingIta.gf4
-rw-r--r--book/examples/chapter4/SmallShopping.gf3
19 files changed, 160 insertions, 0 deletions
diff --git a/book/examples/chapter4/Clothes.gf b/book/examples/chapter4/Clothes.gf
new file mode 100644
index 000000000..e17400a27
--- /dev/null
+++ b/book/examples/chapter4/Clothes.gf
@@ -0,0 +1,5 @@
+abstract Clothes = Comments ** {
+ fun
+ Shirt, Jacket : Kind ;
+ Comfortable, Elegant : Quality ;
+}
diff --git a/book/examples/chapter4/ClothesEng.gf b/book/examples/chapter4/ClothesEng.gf
new file mode 100644
index 000000000..d45a8ce30
--- /dev/null
+++ b/book/examples/chapter4/ClothesEng.gf
@@ -0,0 +1,10 @@
+--# -path=.:present
+
+concrete ClothesEng of Clothes = CommentsEng **
+ open SyntaxEng, ParadigmsEng in {
+ lin
+ Shirt = mkCN (mkN "shirt") ;
+ Jacket = mkCN (mkN "jacket") ;
+ Comfortable = mkAP (mkA "comfortable") ;
+ Elegant = mkAP (mkA "elega") ;
+}
diff --git a/book/examples/chapter4/ClothesIta.gf b/book/examples/chapter4/ClothesIta.gf
new file mode 100644
index 000000000..fc4415b07
--- /dev/null
+++ b/book/examples/chapter4/ClothesIta.gf
@@ -0,0 +1,8 @@
+concrete ClothesIta of Clothes = CommentsIta **
+ open SyntaxIta, ParadigmsIta in {
+ lin
+ Shirt = mkCN (mkN "camicia") ;
+ Jacket = mkCN (mkN "giacca") ;
+ Comfortable = mkAP (mkA "comodo") ;
+ Elegant = mkAP (mkA "elegante") ;
+}
diff --git a/book/examples/chapter4/Comment.gf b/book/examples/chapter4/Comment.gf
new file mode 100644
index 000000000..0a812c6ef
--- /dev/null
+++ b/book/examples/chapter4/Comment.gf
@@ -0,0 +1,13 @@
+abstract Comment = {
+ 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/chapter4/Comments.gf b/book/examples/chapter4/Comments.gf
new file mode 100644
index 000000000..ba36024f3
--- /dev/null
+++ b/book/examples/chapter4/Comments.gf
@@ -0,0 +1,10 @@
+abstract Comments = {
+ flags startcat = Comment ;
+ cat
+ Comment ; Item ; Kind ; Quality ;
+ fun
+ Pred : Item -> Quality -> Comment ;
+ This, That, These, Those : Kind -> Item ;
+ Mod : Quality -> Kind -> Kind ;
+ Very : Quality -> Quality ;
+}
diff --git a/book/examples/chapter4/CommentsEng.gf b/book/examples/chapter4/CommentsEng.gf
new file mode 100644
index 000000000..8fe3ed965
--- /dev/null
+++ b/book/examples/chapter4/CommentsEng.gf
@@ -0,0 +1,4 @@
+--# -path=.:present
+
+concrete CommentsEng of Comments = CommentsI with
+ (Syntax = SyntaxEng) ;
diff --git a/book/examples/chapter4/CommentsI.gf b/book/examples/chapter4/CommentsI.gf
new file mode 100644
index 000000000..b7cf0e8f7
--- /dev/null
+++ b/book/examples/chapter4/CommentsI.gf
@@ -0,0 +1,15 @@
+incomplete concrete CommentsI of Comments = open Syntax in {
+ lincat
+ Comment = Cl ;
+ Item = NP ;
+ Kind = CN ;
+ Quality = AP ;
+ lin
+ Pred item quality = mkCl item quality ;
+ This kind = mkNP this_QuantSg kind ;
+ That kind = mkNP that_QuantSg kind ;
+ These kind = mkNP these_QuantPl kind ;
+ Those kind = mkNP those_QuantPl kind ;
+ Mod quality kind = mkCN quality kind ;
+ Very quality = mkAP very_AdA quality ;
+}
diff --git a/book/examples/chapter4/CommentsIta.gf b/book/examples/chapter4/CommentsIta.gf
new file mode 100644
index 000000000..c9010c939
--- /dev/null
+++ b/book/examples/chapter4/CommentsIta.gf
@@ -0,0 +1,4 @@
+--# -path=.:present
+
+concrete CommentsIta of Comments = CommentsI with
+ (Syntax = SyntaxIta) ;
diff --git a/book/examples/chapter4/Computers.gf b/book/examples/chapter4/Computers.gf
new file mode 100644
index 000000000..6bbafd215
--- /dev/null
+++ b/book/examples/chapter4/Computers.gf
@@ -0,0 +1,5 @@
+abstract Computers = Comments ** {
+ fun
+ Computer, HardDisk : Kind ;
+ Efficient, Slow : Quality ;
+}
diff --git a/book/examples/chapter4/ComputersEng.gf b/book/examples/chapter4/ComputersEng.gf
new file mode 100644
index 000000000..c902be7a7
--- /dev/null
+++ b/book/examples/chapter4/ComputersEng.gf
@@ -0,0 +1,10 @@
+--# -path=.:present
+
+concrete ComputersEng of Computers = CommentsEng **
+ open SyntaxEng, ParadigmsEng in {
+ lin
+ Computer = mkCN (mkN "computer") ;
+ HardDisk = mkCN (mkA "hard") (mkN "disk") ;
+ Efficient = mkAP (mkA "efficient") ;
+ Slow = mkAP (mkA "slow") ;
+}
diff --git a/book/examples/chapter4/ComputersIta.gf b/book/examples/chapter4/ComputersIta.gf
new file mode 100644
index 000000000..274bf6089
--- /dev/null
+++ b/book/examples/chapter4/ComputersIta.gf
@@ -0,0 +1,9 @@
+concrete ComputersIta of Computers =
+ CommentsIta ** open ResIta in {
+ lin
+ Computer = noun "computer" "computer" Masc ;
+ HardDisk = noun "disco rigido" "dischi rigidi" Masc ;
+ Efficient = adjective "efficiente" "efficiente"
+ "efficienti" "efficienti" ;
+ Slow = regAdj "lento" ;
+}
diff --git a/book/examples/chapter4/Exx.gf b/book/examples/chapter4/Exx.gf
new file mode 100644
index 000000000..e7df70595
--- /dev/null
+++ b/book/examples/chapter4/Exx.gf
@@ -0,0 +1,16 @@
+resource Exx = {
+
+ param DetForm = DSg Gender Case | DPl Case ;
+ param Gender = Masc | Fem | Neutr ;
+ param Case = Nom | Acc | Dat | Gen ;
+
+ oper artDef : DetForm => Str = table {
+ DSg Masc Acc | DPl Dat => "den" ;
+ DSg (Masc | Neutr) Dat => "dem" ;
+ DSg (Masc | Neutr) Gen => "des" ;
+ DSg Neutr _ => "das" ;
+ DSg Fem (Nom | Acc) | DPl (Nom | Acc) => "die" ;
+ _ => "der"
+ } ;
+
+}
diff --git a/book/examples/chapter4/Foods.gf b/book/examples/chapter4/Foods.gf
new file mode 100644
index 000000000..d09135421
--- /dev/null
+++ b/book/examples/chapter4/Foods.gf
@@ -0,0 +1,6 @@
+abstract Foods = Comments ** {
+ fun
+ Wine, Cheese, Fish, Pizza : Kind ;
+ Fresh, Warm, Italian,
+ Expensive, Delicious, Boring : Quality ;
+}
diff --git a/book/examples/chapter4/FoodsEng.gf b/book/examples/chapter4/FoodsEng.gf
new file mode 100644
index 000000000..39711d908
--- /dev/null
+++ b/book/examples/chapter4/FoodsEng.gf
@@ -0,0 +1,16 @@
+--# -path=.:present
+
+concrete FoodsEng of Foods = CommentsEng **
+ open SyntaxEng, ParadigmsEng in {
+ lin
+ Wine = mkCN (mkN "wine") ;
+ Pizza = mkCN (mkN "pizza") ;
+ Cheese = mkCN (mkN "cheese") ;
+ Fish = mkCN (mkN "fish" "fish") ;
+ 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/chapter4/FoodsIta.gf b/book/examples/chapter4/FoodsIta.gf
new file mode 100644
index 000000000..502a29cc2
--- /dev/null
+++ b/book/examples/chapter4/FoodsIta.gf
@@ -0,0 +1,16 @@
+--# -path=.:present
+
+concrete FoodsIta of Foods = CommentsIta **
+ open SyntaxIta, ParadigmsIta in {
+ lin
+ Wine = mkCN (mkN "vino") ;
+ Pizza = mkCN (mkN "pizza") ;
+ Cheese = mkCN (mkN "formaggio") ;
+ Fish = mkCN (mkN "pesce") ;
+ Fresh = mkAP (mkA "fresco") ;
+ Warm = mkAP (mkA "caldo") ;
+ Italian = mkAP (mkA "italiano") ;
+ Expensive = mkAP (mkA "caro") ;
+ Delicious = mkAP (mkA "delizioso") ;
+ Boring = mkAP (mkA "noioso") ;
+}
diff --git a/book/examples/chapter4/Shopping.gf b/book/examples/chapter4/Shopping.gf
new file mode 100644
index 000000000..99deb46d9
--- /dev/null
+++ b/book/examples/chapter4/Shopping.gf
@@ -0,0 +1,2 @@
+abstract Shopping = Foods, Clothes ;
+
diff --git a/book/examples/chapter4/ShoppingEng.gf b/book/examples/chapter4/ShoppingEng.gf
new file mode 100644
index 000000000..9233a00af
--- /dev/null
+++ b/book/examples/chapter4/ShoppingEng.gf
@@ -0,0 +1,4 @@
+--# -path=.:present
+
+concrete ShoppingEng of Shopping = FoodsEng, ClothesEng ;
+
diff --git a/book/examples/chapter4/ShoppingIta.gf b/book/examples/chapter4/ShoppingIta.gf
new file mode 100644
index 000000000..5abae2674
--- /dev/null
+++ b/book/examples/chapter4/ShoppingIta.gf
@@ -0,0 +1,4 @@
+--# -path=.:present
+
+concrete ShoppingIta of Shopping = FoodsIta, ClothesIta ;
+
diff --git a/book/examples/chapter4/SmallShopping.gf b/book/examples/chapter4/SmallShopping.gf
new file mode 100644
index 000000000..10c7c1a17
--- /dev/null
+++ b/book/examples/chapter4/SmallShopping.gf
@@ -0,0 +1,3 @@
+abstract SmallShopping =
+ Foods - [Wine],
+ Clothes [Kind,Quality,Shirt,Elegant] ;