mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-28 05:52:51 -06:00
shrank example
This commit is contained in:
@@ -85,8 +85,8 @@ understand. Type (or copy) the following lines in a file named
|
|||||||
VP ::= V | TV NP | "is" A ;
|
VP ::= V | TV NP | "is" A ;
|
||||||
NP ::= ("this" | "that" | "the" | "a") CN ;
|
NP ::= ("this" | "that" | "the" | "a") CN ;
|
||||||
CN ::= A CN ;
|
CN ::= A CN ;
|
||||||
CN ::= "bird" | "boy" | "man" | "louse" | "snake" | "worm" ;
|
CN ::= "boy" | "louse" | "snake" | "worm" ;
|
||||||
A ::= "big" | "green" | "rotten" | "thick" | "warm" ;
|
A ::= "green" | "rotten" | "thick" | "warm" ;
|
||||||
V ::= "laughs" | "sleeps" | "swims" ;
|
V ::= "laughs" | "sleeps" | "swims" ;
|
||||||
TV ::= "eats" | "kills" | "washes" ;
|
TV ::= "eats" | "kills" | "washes" ;
|
||||||
</pre>
|
</pre>
|
||||||
@@ -186,11 +186,10 @@ can generate, use the command <tt>generate_trees = gt</tt>.
|
|||||||
this boy laughs
|
this boy laughs
|
||||||
this boy sleeps
|
this boy sleeps
|
||||||
this boy swims
|
this boy swims
|
||||||
this boy is big
|
|
||||||
...
|
...
|
||||||
a bird is rotten
|
a worm is rotten
|
||||||
a bird is thick
|
a worm is thick
|
||||||
a bird is warm
|
a worm is warm
|
||||||
</pre>
|
</pre>
|
||||||
You get quite a few trees but not all of them: only up to a given
|
You get quite a few trees but not all of them: only up to a given
|
||||||
<b>depth</b> of trees. To see how you can get more, use the
|
<b>depth</b> of trees. To see how you can get more, use the
|
||||||
@@ -295,13 +294,10 @@ labels to each rule. GF recognizes files of this format by the suffix
|
|||||||
Def. NP ::= "the" CN ;
|
Def. NP ::= "the" CN ;
|
||||||
Indef. NP ::= "a" CN ;
|
Indef. NP ::= "a" CN ;
|
||||||
ModA. CN ::= A CN ;
|
ModA. CN ::= A CN ;
|
||||||
Bird. CN ::= "bird" ;
|
|
||||||
Boy. CN ::= "boy" ;
|
Boy. CN ::= "boy" ;
|
||||||
Man. CN ::= "man" ;
|
|
||||||
Louse. CN ::= "louse" ;
|
Louse. CN ::= "louse" ;
|
||||||
Snake. CN ::= "snake" ;
|
Snake. CN ::= "snake" ;
|
||||||
Worm. CN ::= "worm" ;
|
Worm. CN ::= "worm" ;
|
||||||
Big. A ::= "big" ;
|
|
||||||
Green. A ::= "green" ;
|
Green. A ::= "green" ;
|
||||||
Rotten. A ::= "rotten" ;
|
Rotten. A ::= "rotten" ;
|
||||||
Thick. A ::= "thick" ;
|
Thick. A ::= "thick" ;
|
||||||
@@ -334,8 +330,8 @@ old grammar from the GF shell state.
|
|||||||
PredVP (Def Boy) (ComplTV Eat (Indef Snake))
|
PredVP (Def Boy) (ComplTV Eat (Indef Snake))
|
||||||
|
|
||||||
> gr -tr | l
|
> gr -tr | l
|
||||||
PredVP (Indef Louse) (UseA Big)
|
PredVP (Indef Louse) (UseA Thick)
|
||||||
a louse is big
|
a louse is thick
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
@@ -448,8 +444,8 @@ fun
|
|||||||
UseA : A -> VP ;
|
UseA : A -> VP ;
|
||||||
ModA : A -> CN -> CN ;
|
ModA : A -> CN -> CN ;
|
||||||
This, That, Def, Indef : CN -> NP ;
|
This, That, Def, Indef : CN -> NP ;
|
||||||
Bird, Boy, Man, Louse, Snake, Worm : CN ;
|
Boy, Louse, Snake, Worm : CN ;
|
||||||
Big, Green, Rotten, Thick, Warm : A ;
|
Green, Rotten, Thick, Warm : A ;
|
||||||
Laugh, Sleep, Swim : V ;
|
Laugh, Sleep, Swim : V ;
|
||||||
Eat, Kill, Wash : TV ;
|
Eat, Kill, Wash : TV ;
|
||||||
}
|
}
|
||||||
@@ -480,13 +476,10 @@ lin
|
|||||||
Def cn = {s = "the" ++ cn.s} ;
|
Def cn = {s = "the" ++ cn.s} ;
|
||||||
Indef cn = {s = "a" ++ cn.s} ;
|
Indef cn = {s = "a" ++ cn.s} ;
|
||||||
ModA a cn = {s = a.s ++ cn.s} ;
|
ModA a cn = {s = a.s ++ cn.s} ;
|
||||||
Bird = {s = "bird"} ;
|
|
||||||
Boy = {s = "boy"} ;
|
Boy = {s = "boy"} ;
|
||||||
Louse = {s = "louse"} ;
|
Louse = {s = "louse"} ;
|
||||||
Man = {s = "man"} ;
|
|
||||||
Snake = {s = "snake"} ;
|
Snake = {s = "snake"} ;
|
||||||
Worm = {s = "worm"} ;
|
Worm = {s = "worm"} ;
|
||||||
Big = {s = "big"} ;
|
|
||||||
Green = {s = "green"} ;
|
Green = {s = "green"} ;
|
||||||
Rotten = {s = "rotten"} ;
|
Rotten = {s = "rotten"} ;
|
||||||
Thick = {s = "thick"} ;
|
Thick = {s = "thick"} ;
|
||||||
@@ -537,13 +530,10 @@ lin
|
|||||||
Def cn = {s = "il" ++ cn.s} ;
|
Def cn = {s = "il" ++ cn.s} ;
|
||||||
Indef cn = {s = "un" ++ cn.s} ;
|
Indef cn = {s = "un" ++ cn.s} ;
|
||||||
ModA a cn = {s = cn.s ++ a.s} ;
|
ModA a cn = {s = cn.s ++ a.s} ;
|
||||||
Bird = {s = "uccello"} ;
|
|
||||||
Boy = {s = "ragazzo"} ;
|
Boy = {s = "ragazzo"} ;
|
||||||
Louse = {s = "pidocchio"} ;
|
Louse = {s = "pidocchio"} ;
|
||||||
Man = {s = "uomo"} ;
|
|
||||||
Snake = {s = "serpente"} ;
|
Snake = {s = "serpente"} ;
|
||||||
Worm = {s = "verme"} ;
|
Worm = {s = "verme"} ;
|
||||||
Big = {s = "grande"} ;
|
|
||||||
Green = {s = "verde"} ;
|
Green = {s = "verde"} ;
|
||||||
Rotten = {s = "marcio"} ;
|
Rotten = {s = "marcio"} ;
|
||||||
Thick = {s = "grosso"} ;
|
Thick = {s = "grosso"} ;
|
||||||
|
|||||||
Reference in New Issue
Block a user