mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
resource-food example in tutorial
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
html:
|
||||
txt2tags -thtml --toc gf-tutorial2.txt
|
||||
txt2tags -thtml --toc gf-tutorial2_8.txt
|
||||
tex:
|
||||
txt2tags -ttex --toc gf-tutorial2.txt
|
||||
pdflatex gf-tutorial2.tex
|
||||
|
||||
14
doc/tutorial/resource-food/Food.gf
Normal file
14
doc/tutorial/resource-food/Food.gf
Normal file
@@ -0,0 +1,14 @@
|
||||
abstract Food = {
|
||||
|
||||
cat
|
||||
S ; Item ; Kind ; Quality ;
|
||||
|
||||
fun
|
||||
Is : Item -> Quality -> S ;
|
||||
This, That, All : Kind -> Item ;
|
||||
QKind : Quality -> Kind -> Kind ;
|
||||
Wine, Cheese, Fish, Beer, Pizza : Kind ;
|
||||
Very : Quality -> Quality ;
|
||||
Fresh, Warm, Italian, Expensive, Delicious, Boring : Quality ;
|
||||
|
||||
}
|
||||
5
doc/tutorial/resource-food/FoodFin.gf
Normal file
5
doc/tutorial/resource-food/FoodFin.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:prelude
|
||||
|
||||
concrete FoodFin of Food = FoodI with
|
||||
(Syntax = SyntaxFin),
|
||||
(LexFood = LexFoodFin) ;
|
||||
30
doc/tutorial/resource-food/FoodFre.gf
Normal file
30
doc/tutorial/resource-food/FoodFre.gf
Normal file
@@ -0,0 +1,30 @@
|
||||
--# -path=present:prelude
|
||||
|
||||
concrete FoodFre of Food = open SyntaxFre,ParadigmsFre in {
|
||||
|
||||
lincat
|
||||
S = Utt ;
|
||||
Item = NP ;
|
||||
Kind = CN ;
|
||||
Quality = AP ;
|
||||
|
||||
lin
|
||||
Is item quality = mkUtt (mkCl item quality) ;
|
||||
This kind = SyntaxFre.mkNP (mkDet this_Quant) kind ;
|
||||
That kind = SyntaxFre.mkNP (mkDet that_Quant) kind ;
|
||||
All kind = SyntaxFre.mkNP all_Predet (SyntaxFre.mkNP defPlDet kind) ;
|
||||
QKind quality kind = mkCN quality kind ;
|
||||
Wine = mkCN (mkN "vin") ;
|
||||
Beer = mkCN (mkN "bière") ;
|
||||
Pizza = mkCN (mkN "pizza" feminine) ;
|
||||
Cheese = mkCN (mkN "fromage" masculine) ;
|
||||
Fish = mkCN (mkN "poisson") ;
|
||||
Very quality = mkAP very_AdA quality ;
|
||||
Fresh = mkAP (mkA "frais" "fraîche") ;
|
||||
Warm = mkAP (mkA "chaud") ;
|
||||
Italian = mkAP (mkA "italien") ;
|
||||
Expensive = mkAP (mkA "cher") ;
|
||||
Delicious = mkAP (mkA "délicieux") ;
|
||||
Boring = mkAP (mkA "ennuyeux") ;
|
||||
|
||||
}
|
||||
5
doc/tutorial/resource-food/FoodGer.gf
Normal file
5
doc/tutorial/resource-food/FoodGer.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:prelude
|
||||
|
||||
concrete FoodGer of Food = FoodI with
|
||||
(Syntax = SyntaxGer),
|
||||
(LexFood = LexFoodGer) ;
|
||||
28
doc/tutorial/resource-food/FoodI.gf
Normal file
28
doc/tutorial/resource-food/FoodI.gf
Normal file
@@ -0,0 +1,28 @@
|
||||
incomplete concrete FoodI of Food = open Syntax, LexFood in {
|
||||
|
||||
lincat
|
||||
S = Utt ;
|
||||
Item = NP ;
|
||||
Kind = CN ;
|
||||
Quality = AP ;
|
||||
|
||||
lin
|
||||
Is item quality = mkUtt (mkCl item quality) ;
|
||||
This kind = mkNP (mkDet this_Quant) kind ;
|
||||
That kind = mkNP (mkDet that_Quant) kind ;
|
||||
All kind = mkNP all_Predet (mkNP defPlDet kind) ;
|
||||
QKind quality kind = mkCN quality kind ;
|
||||
Wine = mkCN wine_N ;
|
||||
Beer = mkCN beer_N ;
|
||||
Pizza = mkCN pizza_N ;
|
||||
Cheese = mkCN cheese_N ;
|
||||
Fish = mkCN fish_N ;
|
||||
Very quality = mkAP very_AdA quality ;
|
||||
Fresh = mkAP fresh_A ;
|
||||
Warm = mkAP warm_A ;
|
||||
Italian = mkAP italian_A ;
|
||||
Expensive = mkAP expensive_A ;
|
||||
Delicious = mkAP delicious_A ;
|
||||
Boring = mkAP boring_A ;
|
||||
|
||||
}
|
||||
16
doc/tutorial/resource-food/LexFood.gf
Normal file
16
doc/tutorial/resource-food/LexFood.gf
Normal file
@@ -0,0 +1,16 @@
|
||||
interface LexFood = open Syntax in {
|
||||
|
||||
oper
|
||||
wine_N : N ;
|
||||
beer_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 ;
|
||||
|
||||
}
|
||||
16
doc/tutorial/resource-food/LexFoodFin.gf
Normal file
16
doc/tutorial/resource-food/LexFoodFin.gf
Normal file
@@ -0,0 +1,16 @@
|
||||
instance LexFoodFin of LexFood = open SyntaxFin, ParadigmsFin in {
|
||||
|
||||
oper
|
||||
wine_N = mkN "viini" ;
|
||||
beer_N = mkN "olut" ;
|
||||
pizza_N = mkN "pizza" ;
|
||||
cheese_N = mkN "juusto" ;
|
||||
fish_N = mkN "kala" ;
|
||||
fresh_A = mkA "tuore" ;
|
||||
warm_A = mkA "lämmin" ;
|
||||
italian_A = mkA "italialainen" ;
|
||||
expensive_A = mkA "kallis" ;
|
||||
delicious_A = mkA "herkullinen" ;
|
||||
boring_A = mkA "tylsä" ;
|
||||
|
||||
}
|
||||
16
doc/tutorial/resource-food/LexFoodGer.gf
Normal file
16
doc/tutorial/resource-food/LexFoodGer.gf
Normal file
@@ -0,0 +1,16 @@
|
||||
instance LexFoodGer of LexFood = open SyntaxGer, ParadigmsGer in {
|
||||
|
||||
oper
|
||||
wine_N = mkN "Wein" ;
|
||||
beer_N = mkN "Bier" "Biere" neuter ;
|
||||
pizza_N = mkN "Pizza" "Pizzen" feminine ;
|
||||
cheese_N = mkN "Käse" "Käsen" 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" ;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user