the names API in more languages

This commit is contained in:
Krasimir Angelov
2023-08-16 19:39:22 +02:00
parent d25d648134
commit 6bc965f6c2
69 changed files with 1584 additions and 270 deletions

View File

@@ -56,9 +56,10 @@ lincat
N2 = {s : Case => Number => Str; g : AGender; c : Prep} ;
N3 = {s : Case => Number => Str; g : AGender; c : Prep} ;
GN = {s : Case => Str; g : Sex};
SN = {s : Sex => Case => Str};
LN, PN = {s : Case => Str; g : AGender; n : Number};
PN = {s : Case => Str; g : AGender; n : Number};
LN = {s : Case => Str; g : AGender; n : Number};
GN = {s : Case => Str; g : P.Sex};
SN = {s : P.Sex => Case => Str};
linref
V, VA, VS, V2, V3, V2A, V2S, V2Q, V2V = \v -> v.s ! VInf ++ v.refl ++ v.p;

View File

@@ -1,6 +1,6 @@
--# -path=.:../abstract:../common
concrete DocumentationSlv of Documentation = CatSlv ** open
ResSlv,
ResSlv, ParamX,
HTML in {
flags coding=utf8 ;
@@ -31,6 +31,74 @@ lin
)
} ;
InflectionPN = \n -> {
t = "li" ;
s1= heading1 ("Lastno Ime"++
case n.g of {
AMasc Animate => "(m.s.ž.)" ;
AMasc Inanimate => "(m.s.)" ;
AFem => "(ž.s.)" ;
ANeut => "(s.s.)"
}) ;
s2= frameTable (
tr (th "imen." ++ td (n.s!Nom))++
tr (th "rod." ++ td (n.s!Gen))++
tr (th "daj." ++ td (n.s!Dat))++
tr (th "tož." ++ td (n.s!Acc))++
tr (th "mest." ++ td (n.s!Loc))++
tr (th "orod."++td (n.s!Instr))
)
} ;
InflectionLN = \n -> {
t = "li" ;
s1= heading1 ("Ime Lokacije"++
case n.g of {
AMasc Animate => "(m.s.ž.)" ;
AMasc Inanimate => "(m.s.)" ;
AFem => "(ž.s.)" ;
ANeut => "(s.s.)"
}) ;
s2= frameTable (
tr (th "imen." ++ td (n.s!Nom))++
tr (th "rod." ++ td (n.s!Gen))++
tr (th "daj." ++ td (n.s!Dat))++
tr (th "tož." ++ td (n.s!Acc))++
tr (th "mest." ++ td (n.s!Loc))++
tr (th "orod."++td (n.s!Instr))
)
} ;
InflectionGN = \n -> {
t = "li" ;
s1= heading1 ("Dano Ime"++
case n.g of {
Male => "(moški)" ;
Female => "(ženski)"
}) ;
s2= frameTable (
tr (th "imen." ++ td (n.s!Nom))++
tr (th "rod." ++ td (n.s!Gen))++
tr (th "daj." ++ td (n.s!Dat))++
tr (th "tož." ++ td (n.s!Acc))++
tr (th "mest." ++ td (n.s!Loc))++
tr (th "orod."++td (n.s!Instr))
)
} ;
InflectionSN = \n -> {
t = "li" ;
s1= heading1 "Družinsko Ime" ;
s2= frameTable (
tr (th "imen." ++ td (n.s!Male!Nom))++
tr (th "rod." ++ td (n.s!Male!Gen))++
tr (th "daj." ++ td (n.s!Male!Dat))++
tr (th "tož." ++ td (n.s!Male!Acc))++
tr (th "mest." ++ td (n.s!Male!Loc))++
tr (th "orod."++td (n.s!Male!Instr))
)
} ;
InflectionA, InflectionA2 = \a -> {
t = "pr" ;
s1= heading1 ("Pridevnik") ;

View File

@@ -1,4 +1,4 @@
concrete NamesSlv of Names = CatSlv ** open ResSlv, Prelude in {
concrete NamesSlv of Names = CatSlv ** open ResSlv, ParamX, Prelude in {
lin GivenName = \n -> {
s = n.s;
@@ -21,10 +21,14 @@ lin FullName gn sn = {
isPron = False
} ;
lin UseLN pn = {
s = pn.s;
a = {g=agender2gender pn.g; n=pn.n; p=P3};
lin UseLN, PlainLN = \ln -> {
s = ln.s;
a = {g=agender2gender ln.g; n=ln.n; p=P3};
isPron = False
} ;
lin InLN ln = {
s = "v" ++ ln.s ! Loc
} ;
}

View File

@@ -1,4 +1,4 @@
resource ParadigmsSlv = open CatSlv, ResSlv, Prelude, Predef in {
resource ParadigmsSlv = open CatSlv, ResSlv, ParamX, Prelude, Predef in {
oper
nominative : Case = Nom ;
@@ -34,6 +34,10 @@ oper
mkN : (_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_ : Str) -> AGender -> N = worstN ;
} ;
compoundN = overload {
compoundN : N -> Str -> N = \noun,adv -> noun ** {s = \\c,n => noun.s ! c ! n ++ adv} ;
} ;
mkN2 : N -> Prep -> N2 = \n,c -> n ** {c=c} ;
--All masculine forms (except those with long pluralstem) are formed here.
@@ -241,6 +245,44 @@ oper
};
} ;
mkLN = overload {
mkLN : N -> LN = \noun -> lin LN {
s = \\c => noun.s ! c ! Sg ;
g = noun.g ;
n = Sg
};
mkLN : N -> Number -> LN = \noun,nr -> lin LN {
s = \\c => noun.s ! c ! nr ;
g = noun.g ;
n = nr
};
mkLN : Str -> LN =
\s -> lin LN {
s = \\_ => s ;
g = AMasc Inanimate ;
n = Sg
};
mkLN : Str -> AGender -> Number -> LN =
\s,g,n -> lin LN {
s = \\_ => s ;
g = g ;
n = n
};
mkLN : (_,_,_,_,_,_ : Str) -> AGender -> Number -> LN =
\nom,gen,dat,acc,loc,instr,g,n -> lin LN {
s = table {
Nom => nom;
Gen => gen;
Dat => dat;
Acc => acc;
Loc => loc;
Instr => instr
};
g = g ;
n = n
};
} ;
mkV = overload {
mkV : (inf : Str) -> V = \v -> regV v (dp 2 v) ;
mkV : (inf,stem : Str) -> V = regV ;

View File

@@ -4,7 +4,6 @@ param
Case = Nom | Gen | Dat | Acc | Loc | Instr;
Number = Sg | Dl | Pl ;
Gender = Masc | Fem | Neut ;
Sex = Male | Female ;
Person = P1 | P2 | P3 ;
Species = Indef | Def ;
Animacy = Animate | Inanimate ;