avoid name clases and make number feature accessible

This commit is contained in:
Herbert Lange
2019-06-24 18:19:54 +02:00
parent 4df898a038
commit 0f174af5b4
2 changed files with 33 additions and 11 deletions

View File

@@ -34,6 +34,10 @@ oper
abl : Case = Abl ; abl : Case = Abl ;
voc : Case = ResLat.Voc ; voc : Case = ResLat.Voc ;
plural : Number = Pl ;
singular : Number = Sg ;
missing : Coordinator = Missing ;
mkN = overload { mkN = overload {
mkN : (verbum : Str) -> N mkN : (verbum : Str) -> N
= \n -> lin N ( noun n ) ; = \n -> lin N ( noun n ) ;
@@ -41,9 +45,10 @@ oper
= \x,y,z -> lin N ( noun_ngg x y z ) ; = \x,y,z -> lin N ( noun_ngg x y z ) ;
} ; } ;
pluralN = ResLat.pluralN ; pluralN : N -> N = \n -> lin N (ResLat.pluralNoun n) ;
singularN = ResLat.singularN ; singularN : N -> N = \n -> lin N (ResLat.singularNoun n) ;
constN = ResLat.constN ; constN : Str -> Gender-> N = \s,g -> lin N (ResLat.constNoun s g);
mkA = overload { mkA = overload {
mkA : (verbum : Str) -> A -- Nominative masculine mkA : (verbum : Str) -> A -- Nominative masculine
= \n -> lin A ( adj n ** {isPre = False } ) ; = \n -> lin A ( adj n ** {isPre = False } ) ;
@@ -68,7 +73,7 @@ oper
False => let a = adj n in { s = table { Posit => a.s ! Posit ; _ => \\_ => nonExist } ; adv = a.adv } False => let a = adj n in { s = table { Posit => a.s ! Posit ; _ => \\_ => nonExist } ; adv = a.adv }
} ** { isPre = False } ) } ** { isPre = False } )
} ; } ;
constA : Str -> A = \s -> lin A (ResLat.constAdj s) ;
mkV = overload { mkV = overload {
mkV : (tacere : Str) -> V mkV : (tacere : Str) -> V
@@ -82,7 +87,7 @@ oper
V0 : Type = V; V0 : Type = V;
mkV0 = overload { mkV0 = overload {
mkV0 : V -> V0 = \v -> lin V0 v ; -- Same as in english, don't know if it's working mkV0 : V -> V0 = \v -> lin V0 v ; -- Same as in english, don't know if it's working
mkV0 : Str -> V0 = \v -> lin V0 (mkImpersonal v) ; mkV0 : Str -> V0 = \v -> lin V0 (impersonalVerb v) ;
} ; } ;
mkV2 = overload { mkV2 = overload {
@@ -94,6 +99,7 @@ oper
= \v,p -> lin V2 ( v ** { c = p } ) ; = \v,p -> lin V2 ( v ** { c = p } ) ;
} ; } ;
constV : Str -> Verb = \s -> lin V (ResLat.constVerb s) ;
mkAdv = overload { mkAdv = overload {
mkAdv : Str -> Adv mkAdv : Str -> Adv

View File

@@ -56,7 +56,7 @@ param
-- massable = cn.massable; -- massable = cn.massable;
} ; } ;
pluralN : Noun -> Noun = \n -> pluralNoun : Noun -> Noun = \n ->
{ {
s = table { s = table {
Pl => n.s ! Pl ; Pl => n.s ! Pl ;
@@ -68,7 +68,7 @@ param
-- massable = n.massable ; -- massable = n.massable ;
}; };
singularN : Noun -> Noun = \n -> singularNoun : Noun -> Noun = \n ->
lin N { lin N {
s = table { s = table {
Sg => n.s ! Sg ; Sg => n.s ! Sg ;
@@ -79,7 +79,7 @@ param
postap = n.postap postap = n.postap
-- massable = n.massable ; -- massable = n.massable ;
}; };
constN : Str -> Gender -> Noun = \s,g -> constNoun : Str -> Gender -> Noun = \s,g ->
{ s = \\_,_ => s ; g = g } ; { s = \\_,_ => s ; g = g } ;
param param
@@ -194,6 +194,9 @@ param
emptyAdj : Adjective = emptyAdj : Adjective =
{ s = \\_,_ => "" ; comp_adv = "" ; super_adv = "" ; adv = { s = \\_ => "" } } ; { s = \\_,_ => "" ; comp_adv = "" ; super_adv = "" ; adv = { s = \\_ => "" } } ;
constAdj : Str -> Adjective = \a ->
{ s = \\_,_ => a ; comp_adv = "" ; super_adv = "" ; adv = { s = \\_ => "" } } ;
-- verbs -- verbs
param param
@@ -750,7 +753,7 @@ param
} ; } ;
-- at the moment only fills present tense -- at the moment only fills present tense
mkImpersonal : Str -> Verb = \s -> impersonalVerb : Str -> Verb = \s ->
{ {
act = table { act = table {
VAct VSim (VPres VInd) Sg P1 => s ; VAct VSim (VPres VInd) Sg P1 => s ;
@@ -765,6 +768,19 @@ param
sup = \\_ => nonExist ; sup = \\_ => nonExist ;
} ; } ;
constVerb : Str -> Verb = \s ->
{
act = table {
_ => s
} ;
pass = \\_ => nonExist ;
imp = \\_ => nonExist ;
inf = \\_ => nonExist ;
ger = \\_ => nonExist ;
geriv = \\_ => nonExist ;
part = \\_,_ => nonExist ;
sup = \\_ => nonExist ;
} ;
actPresEnding : Number -> Person -> Str = actPresEnding : Number -> Person -> Str =
useEndingTable <"m", "s", "t", "mus", "tis", "nt"> ; useEndingTable <"m", "s", "t", "mus", "tis", "nt"> ;