1. Created Linearization types for V2V as Res.Verb ** {comp,c3 : Str ; typ : Res.VVType} ; but however I have eerors with mkV2 overload methods and lock_C fields. I cannot seem to find out the reason for the error.

This commit is contained in:
David Bamutura
2020-10-12 17:31:40 +03:00
parent 7a07513f8e
commit 7c997ea280
5 changed files with 408 additions and 400 deletions
+95 -72
View File
@@ -40,6 +40,8 @@ param
ImpPol = ImpPos | ImpNeg;
INumber = ISg | IPl | INeut;
-- copied from the English Resource Grammar
VVType = VVAux | VVInf | VVPresPart ; -- can do / try to do / start doing
{-
--there are several and i.e.
-- na (two nouns, 2 Noun Phrases, 2 Pronouns, 2 relative subject clauses, )
@@ -54,7 +56,7 @@ param
AgrExist = AgrNo | AgrYes Agreement;
--Position = PostDeterminer | PreDeterminer ;
Position = Post | Pre;
Variants = V1|V2;
--Variants = V1|V2;
--Functional forms of the regular verb
Mood = Infinitive | Imperative | Subjunctive | Perfective;
VerbCat = Simple | Prepositional | Causative;
@@ -115,7 +117,22 @@ oper
isPerfBlank = False;
--morphs = mkVerbMorphs;
isRegular = False;
p = [];
isRefl = False
};
-- creates a verb of type that has particles (prepositions or
--adverbials. this is for phrasal verbs)
mkVerbV2X : Str ->Str ->Str ->Str -> Bool->Verb = \rad, end1,end2, p, bool ->{
s = rad;
pres = end1;
perf = end2;
isPresBlank = False;
isPerfBlank = False;
--morphs = mkVerbMorphs;
isRegular = False;
p = p;
isRefl = bool
};
--These are regular verbs with {a-ire} entry in the dictionary
smartVerb : Str ->Verb = \rad ->{
s = rad;
@@ -125,6 +142,8 @@ oper
isPresBlank = False;
isPerfBlank = False;
isRegular = True;
p = [];
isRefl = False
};
{- Smart paradigm
@@ -915,69 +934,69 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of {
_ => mkClitic "XX" -- error checking for any case not catered for
};
-- Genetive Preposition: simple "of" without Initila vowel
mkGenPrepNoIVClitic : Agreement -> Str = \a -> case a of {
AgMUBAP1 n => mkClitics "wa" "ba" n;
--AgMUBAP1 Pl => "aba" ;
AgMUBAP2 n => mkClitics "wa" "ba" n; --probably an error check your grammar book
--AgMUBAP2 Pl => "aba" ;
AgP3 n MU_BA => mkClitics "wa" "ba" n;
--AgP3 Pl MU_BA => "aba" ;
AgP3 Pl ZERO_BU => mkClitic "bwa" ;
AgP3 Sg BU_MA => mkClitic "bwa" ;
AgP3 Pl (KA_BU | RU_BU) => mkClitic "bwa" ;
AgP3 Pl (KI_BI | ZERO_BI) => mkClitic "bya" ;
AgP3 Pl (ZERO_MA | KU_MA | RI_MA | I_MA | BU_MA) => mkClitic "ga";
AgP3 (Sg | Pl) HA => mkClitic "ha" ; -- of place HA
AgP3 (Sg | Pl) MU => mkClitic "mwa" ; -- of place MU
AgP3 (Sg | Pl) KU => mkClitic "ya" ; -- of place KU
AgP3 Sg (I_ZERO | I_MA | RI_MA) =>mkClitic "rya" ;
AgP3 Sg (KA_ZERO | KA_BU) =>mkClitic "ka" ;
AgP3 Sg KI_BI => mkClitic "kya" ;
AgP3 Sg (KU_ZERO | KU_MA) => mkClitic "kwa" ;
AgP3 Sg (MU_MI | MU_ZERO) => mkClitic "gwa" ;
AgP3 Sg (RU_ZERO | RU_BU | RU_MA| RU_N) => mkClitic "rwa" ;
AgP3 Pl (ZERO_TU | KA_TU) =>mkClitic "twa" ;
AgP3 Sg (ZERO_ZERO | N_N) =>mkClitic "ya" ;
AgP3 Pl ZERO_MI =>mkClitic "ya" ;
AgP3 Pl MU_MI => mkClitic "emi";
AgP3 Pl (ZERO_ZERO | ZERO_N | N_N | RU_N) =>mkClitic "za" ;
AgP3 Sg GU_GA => mkClitic "gwa" ;
AgP3 Pl GU_GA => mkClitic "ga" ;
_ => mkClitic "Error mkGenPrepNoIVClitic" -- error checking for any case not catered for
-- Genetive Preposition: simple "of" without Initila vowel. It does not combine
mkGenPrepNoIV : Agreement -> Str = \a -> case a of {
AgMUBAP1 Sg => "wa";
AgMUBAP1 Pl => "ba" ;
AgMUBAP2 Sg => "wa" ; --probably an error check your grammar book
AgMUBAP2 Pl => "ba" ;
AgP3 Sg MU_BA => "wa" ;
AgP3 Pl MU_BA => "ba" ;
AgP3 Pl ZERO_BU => "bwa" ;
AgP3 Sg BU_MA => "bwa" ;
AgP3 Pl (KA_BU | RU_BU) => "bwa" ;
AgP3 Pl (KI_BI | ZERO_BI) => "bya" ;
AgP3 Pl (ZERO_MA | KU_MA | RI_MA | I_MA | BU_MA) => "ga";
AgP3 (Sg | Pl) HA => "ha" ; -- of place HA
AgP3 (Sg | Pl) MU => "mwa" ; -- of place MU
AgP3 (Sg | Pl) KU => "ya" ; -- of place KU
AgP3 Sg (I_ZERO | I_MA | RI_MA) => "rya" ;
AgP3 Sg (KA_ZERO | KA_BU) => "ka" ;
AgP3 Sg KI_BI => "kya" ;
AgP3 Sg (KU_ZERO | KU_MA) => "kwa" ;
AgP3 Sg (MU_MI | MU_ZERO) => "gwa" ;
AgP3 Sg (RU_ZERO | RU_BU | RU_MA| RU_N) => "rwa" ;
AgP3 Pl (ZERO_TU | KA_TU) => "twa" ;
AgP3 Sg (ZERO_ZERO | N_N) => "ya" ;
AgP3 Pl ZERO_MI => "ya" ;
AgP3 Pl MU_MI => "emi";
AgP3 Pl (ZERO_ZERO | ZERO_N | N_N | RU_N) => "za" ;
AgP3 Sg GU_GA => "gwa" ;
AgP3 Pl GU_GA => "ga" ;
_ => Predef.error "Error mkGenPrepNoIV" -- error checking for any case not catered for
};
-- Genetive Preposition: simple "of" with Initil vowel
mkGenPrepWithIVClitic : Agreement => Str = table {
AgMUBAP1 n => mkClitics "owa" "aba" n;
--AgMUBAP1 Pl => "aba" ;
AgMUBAP2 n => mkClitics "owa" "aba" n; --probably an error check your grammar book
--AgMUBAP2 Pl => "aba" ;
AgP3 n MU_BA => mkClitics "owa" "aba" n;
--AgP3 Pl MU_BA => "aba" ;
AgP3 Pl ZERO_BU => mkClitic "obwa" ;
AgP3 Sg BU_MA => mkClitic "obwa" ;
AgP3 Pl (KA_BU | RU_BU) => mkClitic "obwa" ;
AgP3 Pl (KI_BI | ZERO_BI) => mkClitic "ebya" ;
AgP3 Pl (ZERO_MA | KU_MA | RI_MA | I_MA | BU_MA) => mkClitic "aga";
AgP3 (Sg | Pl) HA => mkClitic "aha" ; -- of place HA
AgP3 (Sg | Pl) MU => mkClitic "amwa" ; -- of place MU
AgP3 (Sg | Pl) KU => mkClitic "aya" ; -- of place KU
AgP3 Sg (I_ZERO | I_MA | RI_MA) =>mkClitic "arya" ;
AgP3 Sg (KA_ZERO | KA_BU) =>mkClitic "aka" ;
AgP3 Sg KI_BI => mkClitic "ekya" ;
AgP3 Sg (KU_ZERO | KU_MA) => mkClitic "okwa" ;
AgP3 Sg (MU_MI | MU_ZERO) => mkClitic "ogwa" ;
AgP3 Sg (RU_ZERO | RU_BU | RU_MA| RU_N) => mkClitic "orwa" ;
AgP3 Pl (ZERO_TU | KA_TU) =>mkClitic "otwa" ;
AgP3 Sg (ZERO_ZERO | N_N) =>mkClitic "eya" ;
AgP3 Pl ZERO_MI =>mkClitic "eya" ;
AgP3 Pl MU_MI => mkClitic "emi";
AgP3 Pl (ZERO_ZERO | ZERO_N | N_N | RU_N) =>mkClitic "eza" ;
AgP3 Sg GU_GA => mkClitic "ogwa" ;
AgP3 Pl GU_GA => mkClitic "aga" ;
_ => mkClitic "Error mkGenPrepWithIVClitic" -- error checking for any case not catered for
mkGenPrepWithIV : Agreement => Str = table {
AgMUBAP1 Sg => "owa" ;
AgMUBAP1 Pl => "aba" ;
AgMUBAP2 Sg => "owa" ; --probably an error check your grammar book
AgMUBAP2 Pl => "aba" ;
AgP3 Sg MU_BA => "owa" ;
AgP3 Pl MU_BA => "aba" ;
AgP3 Pl ZERO_BU => "obwa" ;
AgP3 Sg BU_MA => "obwa" ;
AgP3 Pl (KA_BU | RU_BU) => "obwa" ;
AgP3 Pl (KI_BI | ZERO_BI) => "ebya" ;
AgP3 Pl (ZERO_MA | KU_MA | RI_MA | I_MA | BU_MA) => "aga";
AgP3 (Sg | Pl) HA => "aha" ; -- of place HA
AgP3 (Sg | Pl) MU => "amwa" ; -- of place MU
AgP3 (Sg | Pl) KU => "aya" ; -- of place KU
AgP3 Sg (I_ZERO | I_MA | RI_MA) => "arya" ;
AgP3 Sg (KA_ZERO | KA_BU) => "aka" ;
AgP3 Sg KI_BI => "ekya" ;
AgP3 Sg (KU_ZERO | KU_MA) => "okwa" ;
AgP3 Sg (MU_MI | MU_ZERO) => "ogwa" ;
AgP3 Sg (RU_ZERO | RU_BU | RU_MA| RU_N) => "orwa" ;
AgP3 Pl (ZERO_TU | KA_TU) => "otwa" ;
AgP3 Sg (ZERO_ZERO | N_N) => "eya" ;
AgP3 Pl ZERO_MI => "eya" ;
AgP3 Pl MU_MI => "emi";
AgP3 Pl (ZERO_ZERO | ZERO_N | N_N | RU_N) => "eza" ;
AgP3 Sg GU_GA => "ogwa" ;
AgP3 Pl GU_GA => "aga" ;
_ => Predef.error "Error in mkGenPrepWithIVClitic : no pattern matched" -- error checking for any case not catered for
};
@@ -1253,13 +1272,11 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of {
-- Structural
-- prepositions sometimes have two kinds, near or far i.e omu or omuri
-- ho
Preposition = {s,other : Str; isGenPrep : Bool};
mkPrep : Str -> Str ->Bool -> Preposition = \ first, other, isGenPrep -> {
s = first ;
other = other;
isGenPrep = isGenPrep
};
-- We ignore the distal dexis to be entered as a separate lemma
-- Instead str for positional arguments 1 & 2 cater for prepositions that inflect with Number
-- while str for positional argument 3 caters for those that do not inflect with Number
Preposition : Type = {s : Str; other : Str; isGenPrep : Bool};
NounPhrase : Type = {s :Case => Str; agr : Agreement};
{-
Operation to create Noun Phrases from a Determiner and Nouns.
@@ -1308,7 +1325,9 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of {
--morphs: VFormMini => VerbMorphPos=> Str;
isPresBlank : Bool;
isPerfBlank : Bool;
isRegular:Bool
isRegular: Bool;
p : Str; -- some verbs have particles such as prepositions and adverbial that give the verb a meaning different from what would be automatically deduced
isRefl : Bool
};
GVerb : Type = {
@@ -1327,7 +1346,7 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of {
Because of the fusion, I have deffered including this in
the compPrep. Actually, it is going to be empty in the next version
-}
Verb2 : Type = Verb ** {comp:Str};
Verb2 : Type = Verb ** {comp: Str; isCompN2: Bool};
Verb3 : Type = Verb2 ** {comp2 : Str} ;
{-
Given a root, can you form the different verbforms?
@@ -1385,7 +1404,9 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of {
--morphs= mkVerbMorphs;
isPresBlank = True;
isPerfBlank = True;
isRegular=False
isRegular=False;
p = [];
isRefl = False
};
mkBecome : Verb ={
s = "b" ;
@@ -1394,7 +1415,9 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of {
isPresBlank = False;
isPerfBlank = False;
--morphs= mkVerbMorphs;
isRegular=False
isRegular=False;
p = [];
isRefl = False
};
@@ -1538,7 +1561,7 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of {
glue: Str -> Str ->Str =\ x, y -> x ++ BIND ++ y;
--Concatenates two strings for the genetive case
glueGen: Agreement ->Str = \ a -> mkGenPrepNoIVClitic a ++ BIND ++ mkGenAdjSuffix a;
glueGen: Agreement ->Str = \ a -> mkGenPrepNoIV a ++ BIND ++ mkGenAdjSuffix a;
--Number determining element
Numer : Type = { s: Agreement => Str ; n : Number; numeralExists:Bool};