progress on the Names API

This commit is contained in:
Krasimir Angelov
2023-08-07 21:15:48 +02:00
parent 9fcee982e5
commit 531e2c2dd2
36 changed files with 220 additions and 22 deletions
+2 -1
View File
@@ -88,7 +88,8 @@ 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, PN = {s : Str; gn : GenNum} ;
LN = {s : Species => Str; c : Preposition; gn : GenNum} ;
PN = {s : Str; gn : GenNum} ;
lindef
SSlash = \s -> {s = \\_ => s; c2 = {s=""; c=Acc}};
+15
View File
@@ -92,6 +92,21 @@ lin
s3 = ""
} ;
InflectionLN = \n -> {
t = "същ.с." ;
s1= heading1 ("Име за Място"++
case n.gn of {
GSg Masc => "(м.р.)" ;
GSg Fem => "(ж.р.)" ;
GSg Neut => "(ср.р.)" ;
GPl => "(мн.ч.)"
}) ;
s2 = paragraph (n.s ! Indef) ++
heading1 ("Наречие") ++
paragraph (n.c.s ++ linCase n.c.c Pos ++ n.s ! Def) ;
s3 = ""
} ;
InflectionGN = \gn -> {
t = "същ.с.л." ;
s1= heading1 (case gn.g of {
+11
View File
@@ -291,6 +291,17 @@ oper
\s,gn -> {s = s; gn = gn ; lock_PN = <>} ;
} ;
mkLN = overload {
mkLN : Str -> LN = \s -> lin LN {s = \\_ => s; c = {s = vyv_Str; c = CPrep}; gn = GSg Masc} ;
mkLN : Str -> Gender -> LN =
\s,g -> lin LN {s = \\_ => s; c = {s = vyv_Str; c = CPrep}; gn = GSg g} ;
mkLN : Str -> GenNum -> LN =
\s,gn -> lin LN {s = \\_ => s; c = {s = vyv_Str; c = CPrep}; 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} ;
} ;
prepLN : LN -> Prep -> LN = \n,p -> n ** {c = p} ;
--2 IAdv
--
+17
View File
@@ -36,4 +36,21 @@ lin FullName gn sn = {
p = NounP3 Pos
} ;
lin UseLN, PlainLN = \n -> {
s = table { RObj c => linCase c Pos ++ n.s ! Def ;
_ => n.s ! Def
} ;
gn = n.gn ;
p = NounP3 Pos
} ;
InLN n = {s = n.c.s ++ linCase n.c.c Pos ++ n.s ! Def} ;
AdjLN ap n = n ** {
s = \\sp => case ap.isPre of {
True => ap.s ! aform n.gn sp RSubj ! P3 ++ n.s ! Indef ;
False => n.s ! sp ++ ap.s ! aform n.gn sp RSubj ! P3
}
} ;
}
+5
View File
@@ -859,4 +859,9 @@ resource ResBul = ParamX ** open Prelude, Predef in {
Female => Fem
} ;
vyv_Str : Str
= pre { "в" ;
"във" / strs {"в" ; "ф" ; "В" ; "Ф"}
} ;
}
+1 -3
View File
@@ -44,9 +44,7 @@ concrete StructuralBul of Structural = CatBul **
if_Subj = ss "ако" ;
in8front_Prep = mkPrep "пред" ;
i_Pron = mkPron "аз" "мой" "моя" "моят" "моя" "моята" "мое" "моето" "мои" "моите" (GSg Masc) PronP1 ;
in_Prep = mkPrep (pre { "в" ;
"във" / strs {"в" ; "ф" ; "В" ; "Ф"}
}) ;
in_Prep = mkPrep vyv_Str ;
it_Pron = mkPron "то" "негов" "неговия" "неговият" "негова" "неговата" "негово" "неговото" "негови" "неговите" (GSg Neut) PronP3 ;
less_CAdv = X.mkCAdv "по-малко" "от" ;
many_Det = mkDeterminerPl "много" ;