mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
new tutorial almost finished
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
|
||||
|
||||
==Coverage==
|
||||
|
||||
The GF Resource Grammar Library contains grammar rules for
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
9
doc/tutorial/resource-food/FoodEng.gf
Normal file
9
doc/tutorial/resource-food/FoodEng.gf
Normal file
@@ -0,0 +1,9 @@
|
||||
--# -path=.:present:prelude
|
||||
|
||||
concrete FoodEng of Food = FoodI - [Pizza] with
|
||||
(Syntax = SyntaxEng),
|
||||
(LexFood = LexFoodEng) **
|
||||
open SyntaxEng, ParadigmsEng in {
|
||||
|
||||
lin Pizza = mkCN (mkA "Italian") (mkN "pie") ;
|
||||
}
|
||||
@@ -10,9 +10,9 @@ concrete FoodFre of Food = open SyntaxFre,ParadigmsFre in {
|
||||
|
||||
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) ;
|
||||
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 (mkN "vin") ;
|
||||
Beer = mkCN (mkN "bière") ;
|
||||
|
||||
17
doc/tutorial/smarthouse/Smart.gf
Normal file
17
doc/tutorial/smarthouse/Smart.gf
Normal file
@@ -0,0 +1,17 @@
|
||||
abstract Smart = {
|
||||
|
||||
flags startcat = Command ;
|
||||
|
||||
cat
|
||||
Command ;
|
||||
Kind ;
|
||||
Action Kind ;
|
||||
Device Kind ;
|
||||
fun
|
||||
CAction : (k : Kind) -> Action k -> Device k -> Command ;
|
||||
DKindOne : (k : Kind) -> Device k ;
|
||||
light, fan : Kind ;
|
||||
switchOn, switchOff : (k : Kind) -> Action k ;
|
||||
dim : Action light ;
|
||||
}
|
||||
|
||||
19
doc/tutorial/smarthouse/SmartEng.gf
Normal file
19
doc/tutorial/smarthouse/SmartEng.gf
Normal file
@@ -0,0 +1,19 @@
|
||||
--# -path=.:prelude
|
||||
|
||||
concrete SmartEng of Smart = open Prelude in {
|
||||
|
||||
-- part of grammar Toy1 from the Regulus book
|
||||
|
||||
lincat
|
||||
Command, Kind, Action, Device = SS ;
|
||||
lin
|
||||
CAction _ act dev = ss (act.s ++ dev.s) ;
|
||||
DKindOne k = ss ("the" ++ k.s) ;
|
||||
|
||||
light = ss "light" ;
|
||||
fan = ss "fan" ;
|
||||
switchOn _ = ss ["switch on"] ;
|
||||
switchOff _ = ss ["switch off"] ;
|
||||
dim = ss "dim" ;
|
||||
}
|
||||
|
||||
@@ -72,16 +72,16 @@ abstract Cat = Common ** {
|
||||
-- ``` Predet (QuantSg | QuantPl Num) Ord
|
||||
-- as defined in [Noun Noun.html].
|
||||
|
||||
CN ; -- common noun (without determiner) e.g. "red house"
|
||||
NP ; -- noun phrase (subject or object) e.g. "the red house"
|
||||
Pron ; -- personal pronoun e.g. "she"
|
||||
Det ; -- determiner phrase e.g. "those seven"
|
||||
Predet; -- predeterminer (prefixed Quant) e.g. "all"
|
||||
QuantSg;-- quantifier ('nucleus' of sing. Det) e.g. "every"
|
||||
QuantPl;-- quantifier ('nucleus' of plur. Det) e.g. "many"
|
||||
Quant ; -- quantifier with both sg and pl e.g. "this/these"
|
||||
Num ; -- cardinal number (used with QuantPl) e.g. "seven"
|
||||
Ord ; -- ordinal number (used in Det) e.g. "seventh"
|
||||
CN ; -- common noun (without determiner) e.g. "red house"
|
||||
NP ; -- noun phrase (subject or object) e.g. "the red house"
|
||||
Pron ; -- personal pronoun e.g. "she"
|
||||
Det ; -- determiner phrase e.g. "those seven"
|
||||
Predet ; -- predeterminer (prefixed Quant) e.g. "all"
|
||||
QuantSg ;-- quantifier ('nucleus' of sing. Det) e.g. "every"
|
||||
QuantPl ;-- quantifier ('nucleus' of plur. Det) e.g. "many"
|
||||
Quant ; -- quantifier with both sg and pl e.g. "this/these"
|
||||
Num ; -- cardinal number (used with QuantPl) e.g. "seven"
|
||||
Ord ; -- ordinal number (used in Det) e.g. "seventh"
|
||||
|
||||
--2 Numerals
|
||||
|
||||
|
||||
@@ -40,6 +40,11 @@ to the relevant source files, which give more information. Some of the files hav
|
||||
not yet been prepared so that the machine generated documentation has the right format.
|
||||
</P>
|
||||
<P>
|
||||
Since the character encoding is UTF-8 for Russian and Latin-1 for other languages, you
|
||||
may have to change the encoding preference of your browser when reading different
|
||||
parts of the document.
|
||||
</P>
|
||||
<P>
|
||||
The second-last chapter gives instructions on how to "browse" the library by
|
||||
loading the grammars into the <CODE>gf</CODE> command editor.
|
||||
</P>
|
||||
@@ -233,6 +238,11 @@ Source 2: <A HREF="../abstract/Cat.gf"><CODE>http://www.cs.chalmers.se/~aarne/GF
|
||||
<TD>"those seven"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>Predet</CODE></TD>
|
||||
<TD>predeterminer (prefixed Quant)</TD>
|
||||
<TD>"all"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>Quant</CODE></TD>
|
||||
<TD>quantifier with both sg and pl</TD>
|
||||
<TD>"this/these"</TD>
|
||||
|
||||
Reference in New Issue
Block a user