mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 19:22:50 -06:00
started a subdir for the book
This commit is contained in:
5
book/examples/chapter4/Clothes.gf
Normal file
5
book/examples/chapter4/Clothes.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
abstract Clothes = Comments ** {
|
||||
fun
|
||||
Shirt, Jacket : Kind ;
|
||||
Comfortable, Elegant : Quality ;
|
||||
}
|
||||
10
book/examples/chapter4/ClothesEng.gf
Normal file
10
book/examples/chapter4/ClothesEng.gf
Normal file
@@ -0,0 +1,10 @@
|
||||
--# -path=.:present
|
||||
|
||||
concrete ClothesEng of Clothes = CommentsEng **
|
||||
open SyntaxEng, ParadigmsEng in {
|
||||
lin
|
||||
Shirt = mkCN (mkN "shirt") ;
|
||||
Jacket = mkCN (mkN "jacket") ;
|
||||
Comfortable = mkAP (mkA "comfortable") ;
|
||||
Elegant = mkAP (mkA "elega") ;
|
||||
}
|
||||
8
book/examples/chapter4/ClothesIta.gf
Normal file
8
book/examples/chapter4/ClothesIta.gf
Normal file
@@ -0,0 +1,8 @@
|
||||
concrete ClothesIta of Clothes = CommentsIta **
|
||||
open SyntaxIta, ParadigmsIta in {
|
||||
lin
|
||||
Shirt = mkCN (mkN "camicia") ;
|
||||
Jacket = mkCN (mkN "giacca") ;
|
||||
Comfortable = mkAP (mkA "comodo") ;
|
||||
Elegant = mkAP (mkA "elegante") ;
|
||||
}
|
||||
13
book/examples/chapter4/Comment.gf
Normal file
13
book/examples/chapter4/Comment.gf
Normal file
@@ -0,0 +1,13 @@
|
||||
abstract Comment = {
|
||||
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 ;
|
||||
}
|
||||
10
book/examples/chapter4/Comments.gf
Normal file
10
book/examples/chapter4/Comments.gf
Normal file
@@ -0,0 +1,10 @@
|
||||
abstract Comments = {
|
||||
flags startcat = Comment ;
|
||||
cat
|
||||
Comment ; Item ; Kind ; Quality ;
|
||||
fun
|
||||
Pred : Item -> Quality -> Comment ;
|
||||
This, That, These, Those : Kind -> Item ;
|
||||
Mod : Quality -> Kind -> Kind ;
|
||||
Very : Quality -> Quality ;
|
||||
}
|
||||
4
book/examples/chapter4/CommentsEng.gf
Normal file
4
book/examples/chapter4/CommentsEng.gf
Normal file
@@ -0,0 +1,4 @@
|
||||
--# -path=.:present
|
||||
|
||||
concrete CommentsEng of Comments = CommentsI with
|
||||
(Syntax = SyntaxEng) ;
|
||||
15
book/examples/chapter4/CommentsI.gf
Normal file
15
book/examples/chapter4/CommentsI.gf
Normal file
@@ -0,0 +1,15 @@
|
||||
incomplete concrete CommentsI of Comments = open Syntax in {
|
||||
lincat
|
||||
Comment = Cl ;
|
||||
Item = NP ;
|
||||
Kind = CN ;
|
||||
Quality = AP ;
|
||||
lin
|
||||
Pred item quality = mkCl item quality ;
|
||||
This kind = mkNP this_QuantSg kind ;
|
||||
That kind = mkNP that_QuantSg kind ;
|
||||
These kind = mkNP these_QuantPl kind ;
|
||||
Those kind = mkNP those_QuantPl kind ;
|
||||
Mod quality kind = mkCN quality kind ;
|
||||
Very quality = mkAP very_AdA quality ;
|
||||
}
|
||||
4
book/examples/chapter4/CommentsIta.gf
Normal file
4
book/examples/chapter4/CommentsIta.gf
Normal file
@@ -0,0 +1,4 @@
|
||||
--# -path=.:present
|
||||
|
||||
concrete CommentsIta of Comments = CommentsI with
|
||||
(Syntax = SyntaxIta) ;
|
||||
5
book/examples/chapter4/Computers.gf
Normal file
5
book/examples/chapter4/Computers.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
abstract Computers = Comments ** {
|
||||
fun
|
||||
Computer, HardDisk : Kind ;
|
||||
Efficient, Slow : Quality ;
|
||||
}
|
||||
10
book/examples/chapter4/ComputersEng.gf
Normal file
10
book/examples/chapter4/ComputersEng.gf
Normal file
@@ -0,0 +1,10 @@
|
||||
--# -path=.:present
|
||||
|
||||
concrete ComputersEng of Computers = CommentsEng **
|
||||
open SyntaxEng, ParadigmsEng in {
|
||||
lin
|
||||
Computer = mkCN (mkN "computer") ;
|
||||
HardDisk = mkCN (mkA "hard") (mkN "disk") ;
|
||||
Efficient = mkAP (mkA "efficient") ;
|
||||
Slow = mkAP (mkA "slow") ;
|
||||
}
|
||||
9
book/examples/chapter4/ComputersIta.gf
Normal file
9
book/examples/chapter4/ComputersIta.gf
Normal file
@@ -0,0 +1,9 @@
|
||||
concrete ComputersIta of Computers =
|
||||
CommentsIta ** open ResIta in {
|
||||
lin
|
||||
Computer = noun "computer" "computer" Masc ;
|
||||
HardDisk = noun "disco rigido" "dischi rigidi" Masc ;
|
||||
Efficient = adjective "efficiente" "efficiente"
|
||||
"efficienti" "efficienti" ;
|
||||
Slow = regAdj "lento" ;
|
||||
}
|
||||
16
book/examples/chapter4/Exx.gf
Normal file
16
book/examples/chapter4/Exx.gf
Normal file
@@ -0,0 +1,16 @@
|
||||
resource Exx = {
|
||||
|
||||
param DetForm = DSg Gender Case | DPl Case ;
|
||||
param Gender = Masc | Fem | Neutr ;
|
||||
param Case = Nom | Acc | Dat | Gen ;
|
||||
|
||||
oper artDef : DetForm => Str = table {
|
||||
DSg Masc Acc | DPl Dat => "den" ;
|
||||
DSg (Masc | Neutr) Dat => "dem" ;
|
||||
DSg (Masc | Neutr) Gen => "des" ;
|
||||
DSg Neutr _ => "das" ;
|
||||
DSg Fem (Nom | Acc) | DPl (Nom | Acc) => "die" ;
|
||||
_ => "der"
|
||||
} ;
|
||||
|
||||
}
|
||||
6
book/examples/chapter4/Foods.gf
Normal file
6
book/examples/chapter4/Foods.gf
Normal file
@@ -0,0 +1,6 @@
|
||||
abstract Foods = Comments ** {
|
||||
fun
|
||||
Wine, Cheese, Fish, Pizza : Kind ;
|
||||
Fresh, Warm, Italian,
|
||||
Expensive, Delicious, Boring : Quality ;
|
||||
}
|
||||
16
book/examples/chapter4/FoodsEng.gf
Normal file
16
book/examples/chapter4/FoodsEng.gf
Normal file
@@ -0,0 +1,16 @@
|
||||
--# -path=.:present
|
||||
|
||||
concrete FoodsEng of Foods = CommentsEng **
|
||||
open SyntaxEng, ParadigmsEng in {
|
||||
lin
|
||||
Wine = mkCN (mkN "wine") ;
|
||||
Pizza = mkCN (mkN "pizza") ;
|
||||
Cheese = mkCN (mkN "cheese") ;
|
||||
Fish = mkCN (mkN "fish" "fish") ;
|
||||
Fresh = mkAP (mkA "fresh") ;
|
||||
Warm = mkAP (mkA "warm") ;
|
||||
Italian = mkAP (mkA "Italian") ;
|
||||
Expensive = mkAP (mkA "expensive") ;
|
||||
Delicious = mkAP (mkA "delicious") ;
|
||||
Boring = mkAP (mkA "boring") ;
|
||||
}
|
||||
16
book/examples/chapter4/FoodsIta.gf
Normal file
16
book/examples/chapter4/FoodsIta.gf
Normal file
@@ -0,0 +1,16 @@
|
||||
--# -path=.:present
|
||||
|
||||
concrete FoodsIta of Foods = CommentsIta **
|
||||
open SyntaxIta, ParadigmsIta in {
|
||||
lin
|
||||
Wine = mkCN (mkN "vino") ;
|
||||
Pizza = mkCN (mkN "pizza") ;
|
||||
Cheese = mkCN (mkN "formaggio") ;
|
||||
Fish = mkCN (mkN "pesce") ;
|
||||
Fresh = mkAP (mkA "fresco") ;
|
||||
Warm = mkAP (mkA "caldo") ;
|
||||
Italian = mkAP (mkA "italiano") ;
|
||||
Expensive = mkAP (mkA "caro") ;
|
||||
Delicious = mkAP (mkA "delizioso") ;
|
||||
Boring = mkAP (mkA "noioso") ;
|
||||
}
|
||||
2
book/examples/chapter4/Shopping.gf
Normal file
2
book/examples/chapter4/Shopping.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
abstract Shopping = Foods, Clothes ;
|
||||
|
||||
4
book/examples/chapter4/ShoppingEng.gf
Normal file
4
book/examples/chapter4/ShoppingEng.gf
Normal file
@@ -0,0 +1,4 @@
|
||||
--# -path=.:present
|
||||
|
||||
concrete ShoppingEng of Shopping = FoodsEng, ClothesEng ;
|
||||
|
||||
4
book/examples/chapter4/ShoppingIta.gf
Normal file
4
book/examples/chapter4/ShoppingIta.gf
Normal file
@@ -0,0 +1,4 @@
|
||||
--# -path=.:present
|
||||
|
||||
concrete ShoppingIta of Shopping = FoodsIta, ClothesIta ;
|
||||
|
||||
3
book/examples/chapter4/SmallShopping.gf
Normal file
3
book/examples/chapter4/SmallShopping.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
abstract SmallShopping =
|
||||
Foods - [Wine],
|
||||
Clothes [Kind,Quality,Shirt,Elegant] ;
|
||||
Reference in New Issue
Block a user