mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 11:19:32 -06:00
More work on params: pass all tests except params1 (!)
This commit is contained in:
@@ -22,12 +22,17 @@ main = do
|
||||
case args of
|
||||
[] -> do
|
||||
doGrammar "unittests" "Bind"
|
||||
doGrammar "unittests" "Tables"
|
||||
doGrammar "unittests" "Params"
|
||||
doGrammar "unittests" "Missing"
|
||||
doGrammar "unittests" "Params1"
|
||||
doGrammar "unittests" "Params2"
|
||||
doGrammar "unittests" "Params3"
|
||||
doGrammar "unittests" "Pre"
|
||||
doGrammar "unittests" "Projection"
|
||||
doGrammar "unittests" "Tables"
|
||||
|
||||
doGrammar "walking" "Walking"
|
||||
doGrammar "foods" "Foods"
|
||||
-- doGrammar "phrasebook" "Phrasebook"
|
||||
[absname] ->
|
||||
doGrammar (takeDirectory absname) (takeBaseName absname)
|
||||
absname:langs ->
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
Params: FtoS f1
|
||||
ParamsCnc: PRQ _ Q3
|
||||
|
||||
Params: FtoS f2
|
||||
ParamsCnc: PRQ (RT _) Q1
|
||||
@@ -1,4 +1,4 @@
|
||||
abstract Params = {
|
||||
abstract Params1 = {
|
||||
cat S ; F ;
|
||||
fun
|
||||
FtoS : F -> S ;
|
||||
5
testsuite/lpgf/unittests/Params1.treebank
Normal file
5
testsuite/lpgf/unittests/Params1.treebank
Normal file
@@ -0,0 +1,5 @@
|
||||
Params1: FtoS f1
|
||||
Params1Cnc: PRQ _ Q3
|
||||
|
||||
Params1: FtoS f2
|
||||
Params1Cnc: PRQ (RT _) Q1
|
||||
@@ -1,4 +1,4 @@
|
||||
concrete ParamsCnc of Params = {
|
||||
concrete Params1Cnc of Params1 = {
|
||||
param
|
||||
P = Px | PRQ R Q | Py ;
|
||||
R = R0 | RT T ;
|
||||
@@ -1,4 +1,5 @@
|
||||
abstract Params2 = {
|
||||
flags startcat = MassKind ;
|
||||
cat Quality ; MassKind ;
|
||||
fun
|
||||
Good : Quality;
|
||||
|
||||
14
testsuite/lpgf/unittests/Params3.gf
Normal file
14
testsuite/lpgf/unittests/Params3.gf
Normal file
@@ -0,0 +1,14 @@
|
||||
abstract Params3 = {
|
||||
cat G ; S ;
|
||||
fun
|
||||
mkPred : S ;
|
||||
mkModSgHumanTrue : G -> S ;
|
||||
mkModSgHumanFalse : G -> S ;
|
||||
mkModSgNonTrue : S ;
|
||||
mkModSgNonFalse : S ;
|
||||
mkModPl : S ;
|
||||
|
||||
GMasc : G ;
|
||||
GFem : G ;
|
||||
GNeutr : G ;
|
||||
}
|
||||
29
testsuite/lpgf/unittests/Params3.treebank
Normal file
29
testsuite/lpgf/unittests/Params3.treebank
Normal file
@@ -0,0 +1,29 @@
|
||||
Params3: mkModPl
|
||||
Params3Cnc: mod pl
|
||||
|
||||
Params3: mkModSgHumanFalse GFem
|
||||
Params3Cnc: mod sg human fem f
|
||||
|
||||
Params3: mkModSgHumanFalse GMasc
|
||||
Params3Cnc: mod sg human masc f
|
||||
|
||||
Params3: mkModSgHumanFalse GNeutr
|
||||
Params3Cnc: mod sg human neutr f
|
||||
|
||||
Params3: mkModSgHumanTrue GFem
|
||||
Params3Cnc: mod sg human fem t
|
||||
|
||||
Params3: mkModSgHumanTrue GMasc
|
||||
Params3Cnc: mod sg human masc t
|
||||
|
||||
Params3: mkModSgHumanTrue GNeutr
|
||||
Params3Cnc: mod sg human neutr t
|
||||
|
||||
Params3: mkModSgNonFalse
|
||||
Params3Cnc: mod sg nonhuman f
|
||||
|
||||
Params3: mkModSgNonTrue
|
||||
Params3Cnc: mod sg nonhuman f
|
||||
|
||||
Params3: mkPred
|
||||
Params3Cnc: pred
|
||||
38
testsuite/lpgf/unittests/Params3Cnc.gf
Normal file
38
testsuite/lpgf/unittests/Params3Cnc.gf
Normal file
@@ -0,0 +1,38 @@
|
||||
concrete Params3Cnc of Params3 = {
|
||||
|
||||
param
|
||||
Boolean = True | False;
|
||||
AForm = APred | AMod GenNum;
|
||||
GenNum = GSg Animacy Boolean | GPl;
|
||||
Animacy = Human Gender | Nonhuman ;
|
||||
Gender = Masc | Fem | Neutr;
|
||||
lincat
|
||||
S = Str ;
|
||||
G = { gen : Gender } ;
|
||||
T = AForm => Str ;
|
||||
lin
|
||||
mkPred = tbl ! APred ;
|
||||
mkModSgHumanTrue g = tbl ! AMod (GSg (Human g.gen) True) ;
|
||||
mkModSgHumanFalse g = tbl ! AMod (GSg (Human g.gen) False) ;
|
||||
mkModSgNonTrue = tbl ! AMod (GSg Nonhuman False) ;
|
||||
mkModSgNonFalse = tbl ! AMod (GSg Nonhuman False) ;
|
||||
mkModPl = tbl ! AMod GPl ;
|
||||
|
||||
GMasc = { gen = Masc } ;
|
||||
GFem = { gen = Fem } ;
|
||||
GNeutr = { gen = Neutr } ;
|
||||
|
||||
oper
|
||||
tbl = table {
|
||||
APred => "pred";
|
||||
AMod (GSg (Human Masc) True) => "mod sg human masc t";
|
||||
AMod (GSg (Human Masc) False) => "mod sg human masc f";
|
||||
AMod (GSg (Human Fem) True) => "mod sg human fem t";
|
||||
AMod (GSg (Human Fem) False) => "mod sg human fem f";
|
||||
AMod (GSg (Human Neutr) True) => "mod sg human neutr t";
|
||||
AMod (GSg (Human Neutr) False) => "mod sg human neutr f";
|
||||
AMod (GSg Nonhuman True) => "mod sg nonhuman t";
|
||||
AMod (GSg Nonhuman False) => "mod sg nonhuman f";
|
||||
AMod GPl => "mod pl"
|
||||
} ;
|
||||
}
|
||||
Reference in New Issue
Block a user