mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
contents of new tutorial
This commit is contained in:
14
doc/tutorial-next/Food.gf
Normal file
14
doc/tutorial-next/Food.gf
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
abstract Food = {
|
||||||
|
|
||||||
|
cat
|
||||||
|
S ; Item ; Kind ; Quality ;
|
||||||
|
|
||||||
|
fun
|
||||||
|
Is : Item -> Quality -> S ;
|
||||||
|
This, That : Kind -> Item ;
|
||||||
|
QKind : Quality -> Kind -> Kind ;
|
||||||
|
Wine, Cheese, Fish : Kind ;
|
||||||
|
Very : Quality -> Quality ;
|
||||||
|
Fresh, Warm, Italian, Expensive, Delicious, Boring : Quality ;
|
||||||
|
|
||||||
|
}
|
||||||
23
doc/tutorial-next/FoodEng.gf
Normal file
23
doc/tutorial-next/FoodEng.gf
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
concrete FoodEng of Food = {
|
||||||
|
|
||||||
|
lincat
|
||||||
|
S, Item, Kind, Quality = {s : Str} ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
Is item quality = {s = item.s ++ "is" ++ quality.s} ;
|
||||||
|
This kind = {s = "this" ++ kind.s} ;
|
||||||
|
That kind = {s = "that" ++ kind.s} ;
|
||||||
|
QKind quality kind = {s = quality.s ++ kind.s} ;
|
||||||
|
Wine = {s = "wine"} ;
|
||||||
|
Cheese = {s = "cheese"} ;
|
||||||
|
Fish = {s = "fish"} ;
|
||||||
|
Very quality = {s = "very" ++ quality.s} ;
|
||||||
|
Fresh = {s = "fresh"} ;
|
||||||
|
Warm = {s = "warm"} ;
|
||||||
|
Italian = {s = "Italian"} ;
|
||||||
|
Expensive = {s = "expensive"} ;
|
||||||
|
Delicious = {s = "delicious"} ;
|
||||||
|
Boring = {s = "boring"} ;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
22
doc/tutorial-next/FoodIta.gf
Normal file
22
doc/tutorial-next/FoodIta.gf
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
concrete FoodIta of Food = {
|
||||||
|
|
||||||
|
lincat
|
||||||
|
S, Item, Kind, Quality = {s : Str} ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
Is item quality = {s = item.s ++ "è" ++ quality.s} ;
|
||||||
|
This kind = {s = "questo" ++ kind.s} ;
|
||||||
|
That kind = {s = "quello" ++ kind.s} ;
|
||||||
|
QKind quality kind = {s = kind.s ++ quality.s} ;
|
||||||
|
Wine = {s = "vino"} ;
|
||||||
|
Cheese = {s = "formaggio"} ;
|
||||||
|
Fish = {s = "pesce"} ;
|
||||||
|
Very quality = {s = "molto" ++ quality.s} ;
|
||||||
|
Fresh = {s = "fresco"} ;
|
||||||
|
Warm = {s = "caldo"} ;
|
||||||
|
Italian = {s = "italiano"} ;
|
||||||
|
Expensive = {s = "caro"} ;
|
||||||
|
Delicious = {s = "delizioso"} ;
|
||||||
|
Boring = {s = "noioso"} ;
|
||||||
|
|
||||||
|
}
|
||||||
6
doc/tutorial-next/Makefile
Normal file
6
doc/tutorial-next/Makefile
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
html:
|
||||||
|
txt2tags -thtml --toc gf-tutorial2.txt
|
||||||
|
tex:
|
||||||
|
txt2tags -ttex --toc gf-tutorial2.txt
|
||||||
|
pdflatex gf-tutorial2.tex
|
||||||
|
pdflatex gf-tutorial2.tex
|
||||||
BIN
doc/tutorial-next/Tree2.png
Normal file
BIN
doc/tutorial-next/Tree2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
15
doc/tutorial-next/food.cf
Normal file
15
doc/tutorial-next/food.cf
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
Is. S ::= Item "is" Quality ;
|
||||||
|
That. Item ::= "that" Kind ;
|
||||||
|
This. Item ::= "this" Kind ;
|
||||||
|
QKind. Kind ::= Quality Kind ;
|
||||||
|
Cheese. Kind ::= "cheese" ;
|
||||||
|
Fish. Kind ::= "fish" ;
|
||||||
|
Wine. Kind ::= "wine" ;
|
||||||
|
Italian. Quality ::= "Italian" ;
|
||||||
|
Boring. Quality ::= "boring" ;
|
||||||
|
Delicious. Quality ::= "delicious" ;
|
||||||
|
Expensive. Quality ::= "expensive" ;
|
||||||
|
Fresh. Quality ::= "fresh" ;
|
||||||
|
Very. Quality ::= "very" Quality ;
|
||||||
|
Warm. Quality ::= "warm" ;
|
||||||
|
|
||||||
2940
doc/tutorial-next/gf-tutorial2.txt
Normal file
2940
doc/tutorial-next/gf-tutorial2.txt
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user