summaryrefslogtreecommitdiff
path: root/examples/tutorial/foods/FoodsEng.gf
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2007-08-16 21:35:11 +0000
committeraarne <aarne@cs.chalmers.se>2007-08-16 21:35:11 +0000
commit599ddcfe91bd9d97f3726d6d2b9541582f33adad (patch)
tree0004f438b801838fb7663438d550c3fd95dd9b86 /examples/tutorial/foods/FoodsEng.gf
parent3737b9926696b70bdecdef3d38d1a1f9399c734a (diff)
section on agreement
Diffstat (limited to 'examples/tutorial/foods/FoodsEng.gf')
-rw-r--r--examples/tutorial/foods/FoodsEng.gf18
1 files changed, 10 insertions, 8 deletions
diff --git a/examples/tutorial/foods/FoodsEng.gf b/examples/tutorial/foods/FoodsEng.gf
index ba3502b39..8ea5e6079 100644
--- a/examples/tutorial/foods/FoodsEng.gf
+++ b/examples/tutorial/foods/FoodsEng.gf
@@ -1,23 +1,23 @@
---# -path=.:resource:prelude
+--# -path=.:prelude
concrete FoodsEng of Foods = open Prelude in {
lincat
- S, Quality = SS ;
+ Phr, Quality = SS ;
Kind = {s : Number => Str} ;
Item = {s : Str ; n : Number} ;
lin
- Is item quality = ss (item.s ++ copula item.n ++ quality.s) ;
+ Is item quality = ss (item.s ++ copula ! item.n ++ quality.s) ;
This = det Sg "this" ;
That = det Sg "that" ;
These = det Pl "these" ;
Those = det Pl "those" ;
QKind quality kind = {s = \\n => quality.s ++ kind.s ! n} ;
- Wine = noun "wine" "wines" ;
- Cheese = noun "cheese" "cheeses" ;
+ Wine = regNoun "wine" ;
+ Cheese = regNoun "cheese" ;
Fish = noun "fish" "fish" ;
- Pizza = noun "pizza" "pizzas" ;
+ Pizza = regNoun "pizza" ;
Very = prefixSS "very" ;
Fresh = ss "fresh" ;
Warm = ss "warm" ;
@@ -41,8 +41,10 @@ concrete FoodsEng of Foods = open Prelude in {
Pl => men
}
} ;
- copula : Number -> Str =
- \n -> case n of {
+ regNoun : Str -> {s : Number => Str} =
+ \car -> noun car (car + "s") ;
+ copula : Number => Str =
+ table {
Sg => "is" ;
Pl => "are"
} ;