mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 19:22:50 -06:00
Add support for pre
This commit is contained in:
7
testsuite/lpgf/Pre.gf
Normal file
7
testsuite/lpgf/Pre.gf
Normal file
@@ -0,0 +1,7 @@
|
||||
abstract Pre = {
|
||||
cat S; N; Det;
|
||||
fun
|
||||
ant, dog: N ;
|
||||
a, the: Det ;
|
||||
mkS : Det -> N -> S;
|
||||
}
|
||||
12
testsuite/lpgf/Pre.treebank
Normal file
12
testsuite/lpgf/Pre.treebank
Normal file
@@ -0,0 +1,12 @@
|
||||
Pre: mkS a ant
|
||||
PreCnc: an ant
|
||||
|
||||
Pre: mkS the ant
|
||||
PreCnc: the ant
|
||||
|
||||
Pre: mkS a dog
|
||||
PreCnc: a dog
|
||||
|
||||
Pre: mkS the dog
|
||||
PreCnc: the dog
|
||||
|
||||
4
testsuite/lpgf/Pre.trees
Normal file
4
testsuite/lpgf/Pre.trees
Normal file
@@ -0,0 +1,4 @@
|
||||
mkS a ant
|
||||
mkS the ant
|
||||
mkS a dog
|
||||
mkS the dog
|
||||
15
testsuite/lpgf/PreCnc.gf
Normal file
15
testsuite/lpgf/PreCnc.gf
Normal file
@@ -0,0 +1,15 @@
|
||||
concrete PreCnc of Pre = {
|
||||
lincat
|
||||
S = { s : Str } ;
|
||||
N = { s : Str } ;
|
||||
Det = { s : Str } ;
|
||||
lin
|
||||
ant = { s = "ant" } ;
|
||||
dog = { s = "dog" } ;
|
||||
a = { s = pre {
|
||||
"a"|"e"|"i"|"o"|"u" => "an" ;
|
||||
_ => "a"
|
||||
} } ;
|
||||
the = { s = "the" } ;
|
||||
mkS det n = { s = det.s ++ n.s } ;
|
||||
}
|
||||
@@ -18,6 +18,7 @@ main = do
|
||||
doGrammar "Bind"
|
||||
doGrammar "Tables"
|
||||
doGrammar "Params"
|
||||
doGrammar "Pre"
|
||||
doGrammar "Walking"
|
||||
doGrammar "Foods"
|
||||
-- doGrammar' "Foods" ["Fre"]
|
||||
|
||||
Reference in New Issue
Block a user