1
0
forked from GitHub/gf-rgl

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 ;
voc : Case = ResLat.Voc ;
plural : Number = Pl ;
singular : Number = Sg ;
missing : Coordinator = Missing ;
mkN = overload {
mkN : (verbum : Str) -> N
= \n -> lin N ( noun n ) ;
@@ -41,9 +45,10 @@ oper
= \x,y,z -> lin N ( noun_ngg x y z ) ;
} ;
pluralN = ResLat.pluralN ;
singularN = ResLat.singularN ;
constN = ResLat.constN ;
pluralN : N -> N = \n -> lin N (ResLat.pluralNoun n) ;
singularN : N -> N = \n -> lin N (ResLat.singularNoun n) ;
constN : Str -> Gender-> N = \s,g -> lin N (ResLat.constNoun s g);
mkA = overload {
mkA : (verbum : Str) -> A -- Nominative masculine
= \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 }
} ** { isPre = False } )
} ;
constA : Str -> A = \s -> lin A (ResLat.constAdj s) ;
mkV = overload {
mkV : (tacere : Str) -> V
@@ -82,7 +87,7 @@ oper
V0 : Type = V;
mkV0 = overload {
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 {
@@ -94,6 +99,7 @@ oper
= \v,p -> lin V2 ( v ** { c = p } ) ;
} ;
constV : Str -> Verb = \s -> lin V (ResLat.constVerb s) ;
mkAdv = overload {
mkAdv : Str -> Adv

View File

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