mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 11:19:32 -06:00
started a subdir for the book
This commit is contained in:
15
book/examples/chapter5/Foods.gf
Normal file
15
book/examples/chapter5/Foods.gf
Normal file
@@ -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 ;
|
||||
}
|
||||
7
book/examples/chapter5/FoodsCat.gf
Normal file
7
book/examples/chapter5/FoodsCat.gf
Normal file
@@ -0,0 +1,7 @@
|
||||
--# -path=.:present
|
||||
|
||||
-- (c) 2009 Jordi Saludes under LGPL
|
||||
|
||||
concrete FoodsCat of Foods = FoodsI with
|
||||
(Syntax = SyntaxCat),
|
||||
(LexFoods = LexFoodsCat) ;
|
||||
27
book/examples/chapter5/FoodsEng.gf
Normal file
27
book/examples/chapter5/FoodsEng.gf
Normal file
@@ -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") ;
|
||||
}
|
||||
7
book/examples/chapter5/FoodsFin.gf
Normal file
7
book/examples/chapter5/FoodsFin.gf
Normal file
@@ -0,0 +1,7 @@
|
||||
--# -path=.:present
|
||||
|
||||
-- (c) 2009 Aarne Ranta under LGPL
|
||||
|
||||
concrete FoodsFin of Foods = FoodsI with
|
||||
(Syntax = SyntaxFin),
|
||||
(LexFoods = LexFoodsFin) ;
|
||||
7
book/examples/chapter5/FoodsGer.gf
Normal file
7
book/examples/chapter5/FoodsGer.gf
Normal file
@@ -0,0 +1,7 @@
|
||||
--# -path=.:present
|
||||
|
||||
-- (c) 2009 Aarne Ranta under LGPL
|
||||
|
||||
concrete FoodsGer of Foods = FoodsI with
|
||||
(Syntax = SyntaxGer),
|
||||
(LexFoods = LexFoodsGer) ;
|
||||
29
book/examples/chapter5/FoodsI.gf
Normal file
29
book/examples/chapter5/FoodsI.gf
Normal file
@@ -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 ;
|
||||
}
|
||||
8
book/examples/chapter5/FoodsIta.gf
Normal file
8
book/examples/chapter5/FoodsIta.gf
Normal file
@@ -0,0 +1,8 @@
|
||||
--# -path=.:present
|
||||
|
||||
-- (c) 2009 Aarne Ranta under LGPL
|
||||
|
||||
concrete FoodsIta of Foods = FoodsI with
|
||||
(Syntax = SyntaxIta),
|
||||
(LexFoods = LexFoodsIta) ;
|
||||
|
||||
7
book/examples/chapter5/FoodsSwe.gf
Normal file
7
book/examples/chapter5/FoodsSwe.gf
Normal file
@@ -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;} ;
|
||||
15
book/examples/chapter5/LexFoods.gf
Normal file
15
book/examples/chapter5/LexFoods.gf
Normal file
@@ -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 ;
|
||||
}
|
||||
18
book/examples/chapter5/LexFoodsCat.gf
Normal file
18
book/examples/chapter5/LexFoodsCat.gf
Normal file
@@ -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" ;
|
||||
}
|
||||
20
book/examples/chapter5/LexFoodsEng.gf
Normal file
20
book/examples/chapter5/LexFoodsEng.gf
Normal file
@@ -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" ;
|
||||
|
||||
}
|
||||
20
book/examples/chapter5/LexFoodsFin.gf
Normal file
20
book/examples/chapter5/LexFoodsFin.gf
Normal file
@@ -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ä" ;
|
||||
}
|
||||
16
book/examples/chapter5/LexFoodsGer.gf
Normal file
16
book/examples/chapter5/LexFoodsGer.gf
Normal file
@@ -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" ;
|
||||
}
|
||||
16
book/examples/chapter5/LexFoodsIta.gf
Normal file
16
book/examples/chapter5/LexFoodsIta.gf
Normal file
@@ -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" ;
|
||||
}
|
||||
16
book/examples/chapter5/LexFoodsSwe.gf
Normal file
16
book/examples/chapter5/LexFoodsSwe.gf
Normal file
@@ -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" ;
|
||||
}
|
||||
Reference in New Issue
Block a user