diff options
Diffstat (limited to 'examples/tutorial/foods')
| -rw-r--r-- | examples/tutorial/foods/Foods.gf | 8 | ||||
| -rw-r--r-- | examples/tutorial/foods/FoodsEng.gf | 18 | ||||
| -rw-r--r-- | examples/tutorial/foods/FoodsIta.gf | 5 |
3 files changed, 17 insertions, 14 deletions
diff --git a/examples/tutorial/foods/Foods.gf b/examples/tutorial/foods/Foods.gf index 9337e234a..210db69d4 100644 --- a/examples/tutorial/foods/Foods.gf +++ b/examples/tutorial/foods/Foods.gf @@ -1,14 +1,16 @@ abstract Foods = { + flags startcat=Phr ; + cat - S ; Item ; Kind ; Quality ; + Phr ; Item ; Kind ; Quality ; fun - Is : Item -> Quality -> S ; + Is : Item -> Quality -> Phr ; This, That, These, Those : Kind -> Item ; QKind : Quality -> Kind -> Kind ; Wine, Cheese, Fish, Pizza : Kind ; Very : Quality -> Quality ; Fresh, Warm, Italian, Expensive, Delicious, Boring : Quality ; -}
\ No newline at end of file +} 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" } ; diff --git a/examples/tutorial/foods/FoodsIta.gf b/examples/tutorial/foods/FoodsIta.gf index 89635eab4..d46bf469d 100644 --- a/examples/tutorial/foods/FoodsIta.gf +++ b/examples/tutorial/foods/FoodsIta.gf @@ -1,9 +1,9 @@ ---# -path=.:resource:prelude +--# -path=.:prelude concrete FoodsIta of Foods = open Prelude in { lincat - S = SS ; + Phr = SS ; Quality = {s : Gender => Number => Str} ; Kind = {s : Number => Str ; g : Gender} ; Item = {s : Str ; g : Gender ; n : Number} ; @@ -74,4 +74,3 @@ concrete FoodsIta of Foods = open Prelude in { Pl => "sono" } ; } - |
