mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
Add unit test for missing lins
This commit is contained in:
7
testsuite/lpgf/unittests/Missing.gf
Normal file
7
testsuite/lpgf/unittests/Missing.gf
Normal file
@@ -0,0 +1,7 @@
|
||||
abstract Missing = {
|
||||
cat S; NP; V2;
|
||||
fun
|
||||
Pred: NP -> V2 -> NP -> S;
|
||||
John, Dogs, Fish: NP ;
|
||||
Love, Eat: V2 ;
|
||||
}
|
||||
12
testsuite/lpgf/unittests/Missing.treebank
Normal file
12
testsuite/lpgf/unittests/Missing.treebank
Normal file
@@ -0,0 +1,12 @@
|
||||
Missing: Pred John Love Fish
|
||||
MissingCnc: John loves fish a lot
|
||||
|
||||
Missing: Pred John Eat Fish
|
||||
MissingCnc: John [Eat] fish [Eat]
|
||||
|
||||
Missing: Pred Fish Love Dogs
|
||||
MissingCnc: fish love [Dogs] a lot
|
||||
|
||||
Missing: Pred Dogs Eat Fish
|
||||
MissingCnc: [Dogs] [Eat] fish [Eat]
|
||||
|
||||
4
testsuite/lpgf/unittests/Missing.trees
Normal file
4
testsuite/lpgf/unittests/Missing.trees
Normal file
@@ -0,0 +1,4 @@
|
||||
Pred John Love Fish
|
||||
Pred John Eat Fish
|
||||
Pred Fish Love Dogs
|
||||
Pred Dogs Eat Fish
|
||||
25
testsuite/lpgf/unittests/MissingCnc.gf
Normal file
25
testsuite/lpgf/unittests/MissingCnc.gf
Normal file
@@ -0,0 +1,25 @@
|
||||
concrete MissingCnc of Missing = open Prelude, ParamX in {
|
||||
lincat
|
||||
S = SS ;
|
||||
NP = { s : Str ; n : Number } ;
|
||||
V2 = { s : Number => Str; s2 : Str } ;
|
||||
lin
|
||||
Pred subj verb obj = ss (subj.s ++ verb.s ! subj.n ++ obj.s ++ verb.s2) ;
|
||||
John = { s = "John" ; n = Sg } ;
|
||||
-- Dogs = { s = "dogs" ; n = Pl } ;
|
||||
Fish = { s = "fish" ; n = Pl } ;
|
||||
Love = {
|
||||
s = table {
|
||||
Sg => "loves" ;
|
||||
Pl => "love"
|
||||
} ;
|
||||
s2 = "a lot"
|
||||
} ;
|
||||
-- Eat = {
|
||||
-- s = table {
|
||||
-- Sg => "eats" ;
|
||||
-- Pl => "eat"
|
||||
-- } ;
|
||||
-- s2 = "often"
|
||||
-- } ;
|
||||
}
|
||||
Reference in New Issue
Block a user