More work on params: pass all tests except params1 (!)

This commit is contained in:
John J. Camilleri
2021-02-27 23:13:02 +01:00
parent f42b5ec9ef
commit 83bc3c9c6e
10 changed files with 144 additions and 70 deletions

View File

@@ -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 ->

View File

@@ -1,5 +0,0 @@
Params: FtoS f1
ParamsCnc: PRQ _ Q3
Params: FtoS f2
ParamsCnc: PRQ (RT _) Q1

View File

@@ -1,4 +1,4 @@
abstract Params = {
abstract Params1 = {
cat S ; F ;
fun
FtoS : F -> S ;

View File

@@ -0,0 +1,5 @@
Params1: FtoS f1
Params1Cnc: PRQ _ Q3
Params1: FtoS f2
Params1Cnc: PRQ (RT _) Q1

View File

@@ -1,4 +1,4 @@
concrete ParamsCnc of Params = {
concrete Params1Cnc of Params1 = {
param
P = Px | PRQ R Q | Py ;
R = R0 | RT T ;

View File

@@ -1,4 +1,5 @@
abstract Params2 = {
flags startcat = MassKind ;
cat Quality ; MassKind ;
fun
Good : Quality;

View 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 ;
}

View 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

View 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"
} ;
}