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

@@ -88,7 +88,7 @@ concrete CatBul of Cat = CommonX - [IAdv,AdV] ** open ResBul, Prelude, Predef, (
N3 = {s : NForm => Str; rel : AForm => Str; relType : NRelType; g : AGender} ** {c2,c3 : Preposition} ;
GN = {s : Str; g : Sex} ;
SN = {s : Sex => Str; pl : Str} ;
LN = {s : Species => Str; c : Preposition; gn : GenNum} ;
LN = {s : Species => Str; onPrep : Bool; gn : GenNum} ;
PN = {s : Str; gn : GenNum} ;
lindef

View File

@@ -103,7 +103,11 @@ lin
}) ;
s2 = paragraph (n.s ! Indef) ++
heading1 ("Наречие") ++
paragraph (n.c.s ++ linCase n.c.c Pos ++ n.s ! Def) ;
paragraph (case n.onPrep of {
True => linCase Dat Pos ;
False => vyv_Str
} ++
n.s ! Def) ;
s3 = ""
} ;
@@ -160,7 +164,7 @@ lin
} ;
InflectionPrep = \prep -> {
t = "пр" ;
t = "пред" ;
s1= heading1 ("Предлог") ;
s2= paragraph (prep.s) ;
s3= ""

View File

@@ -292,16 +292,16 @@ oper
} ;
mkLN = overload {
mkLN : Str -> LN = \s -> lin LN {s = \\_ => s; c = {s = vyv_Str; c = CPrep}; gn = GSg Masc} ;
mkLN : Str -> LN = \s -> lin LN {s = \\_ => s; onPrep = False; gn = GSg Masc} ;
mkLN : Str -> Gender -> LN =
\s,g -> lin LN {s = \\_ => s; c = {s = vyv_Str; c = CPrep}; gn = GSg g} ;
\s,g -> lin LN {s = \\_ => s; onPrep = False; gn = GSg g} ;
mkLN : Str -> GenNum -> LN =
\s,gn -> lin LN {s = \\_ => s; c = {s = vyv_Str; c = CPrep}; gn = gn} ;
\s,gn -> lin LN {s = \\_ => s; onPrep = False; gn = gn} ;
mkLN : Str -> Str -> GenNum -> LN =
\s1,s2,gn -> lin LN {s = table Species [s2; s1]; c = {s = vyv_Str; c = CPrep}; gn = gn} ;
\s1,s2,gn -> lin LN {s = table Species [s2; s1]; onPrep = False; gn = gn} ;
} ;
prepLN : LN -> Prep -> LN = \n,p -> n ** {c = p} ;
onLN : LN -> LN = \n -> n ** {onPrep = True} ;
--2 IAdv
--

View File

@@ -1,4 +1,4 @@
concrete NamesBul of Names = CatBul ** open ResBul in {
concrete NamesBul of Names = CatBul ** open ResBul, Prelude in {
lin GivenName = \n -> {
s = table { RObj c => linCase c Pos ++ n.s;
@@ -44,7 +44,13 @@ lin UseLN, PlainLN = \n -> {
p = NounP3 Pos
} ;
InLN n = {s = n.c.s ++ linCase n.c.c Pos ++ n.s ! Def} ;
InLN n = {
s = case n.onPrep of {
True => linCase Dat Pos ;
False => vyv_Str
} ++
n.s ! Def
} ;
AdjLN ap n = n ** {
s = \\sp => case ap.isPre of {

View File

@@ -47,7 +47,6 @@ resource ResBul = ParamX ** open Prelude, Predef in {
param
Gender = Masc | Fem | Neut ;
Sex = Male | Female ;
Species = Indef | Def ;