From b72ea1e2f1dcdafacfd61aa7e6acb1c2008dcea9 Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Tue, 29 Aug 2023 15:08:45 +0200 Subject: [PATCH] handle the full definitive article with Masc nouns --- src/bulgarian/CatBul.gf | 2 +- src/bulgarian/DocumentationBul.gf | 16 ++++++++++++++-- src/bulgarian/MorphoFunsBul.gf | 10 ++++++---- src/bulgarian/NamesBul.gf | 29 ++++++++++++++++++++++------- 4 files changed, 43 insertions(+), 14 deletions(-) diff --git a/src/bulgarian/CatBul.gf b/src/bulgarian/CatBul.gf index 08d922b9..9e9c9407 100644 --- a/src/bulgarian/CatBul.gf +++ b/src/bulgarian/CatBul.gf @@ -89,7 +89,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; onPrep : Bool; gn : GenNum} ; + LN = {s : Species => Str; defNom: Str; onPrep : Bool; hasArt : Bool; gn : GenNum} ; PN = {s : Str; gn : GenNum} ; lindef diff --git a/src/bulgarian/DocumentationBul.gf b/src/bulgarian/DocumentationBul.gf index 9f3c82c1..7b253ecc 100644 --- a/src/bulgarian/DocumentationBul.gf +++ b/src/bulgarian/DocumentationBul.gf @@ -69,7 +69,10 @@ lin tr (intagAttr "th" "rowspan=\"3\"" "ед.ч." ++ th "нечленувано" ++ td (n.s ! (NF Sg Indef))) ++ tr (th "членувано" ++ td (n.s ! (NF Sg Def))) ++ - tr (th "пълен член" ++ td (n.s ! NFSgDefNom)) ++ + (case n.g of { + AMasc _ => tr (th "пълен член" ++ td (n.s ! NFSgDefNom)) ; + _ => "" + }) ++ tr (intagAttr "th" "rowspan=\"2\"" "мн.ч." ++ th "нечленувано" ++ td (n.s ! (NF Pl Indef))) ++ tr (th "членувано" ++ td (n.s ! (NF Pl Def))) ++ @@ -101,7 +104,16 @@ lin GSg Neut => "(ср.р.)" ; GPl => "(мн.ч.)" }) ; - s2 = paragraph (n.s ! Indef) ++ + s2 = paragraph (case n.hasArt of { + True => frameTable ( + tr (th "нечленувано" ++ td (n.s ! Indef)) ++ + tr (th "членувано" ++ td (n.s ! Def)) ++ + (case n.gn of { + GSg Masc => tr (th "пълен член" ++ td n.defNom) ; + _ => "" + })) ; + False => n.s ! Indef + }) ++ heading1 ("Наречие") ++ paragraph (case n.onPrep of { True => linCase Dat Pos ; diff --git a/src/bulgarian/MorphoFunsBul.gf b/src/bulgarian/MorphoFunsBul.gf index 5aa59c45..fe1f077d 100644 --- a/src/bulgarian/MorphoFunsBul.gf +++ b/src/bulgarian/MorphoFunsBul.gf @@ -292,13 +292,15 @@ oper } ; mkLN = overload { - mkLN : Str -> LN = \s -> lin LN {s = \\_ => s; onPrep = False; gn = GSg Masc} ; + mkLN : Str -> LN = \s -> lin LN {s = \\_ => s; defNom=s; onPrep = False; hasArt = False; gn = GSg Masc} ; mkLN : Str -> Gender -> LN = - \s,g -> lin LN {s = \\_ => s; onPrep = False; gn = GSg g} ; + \s,g -> lin LN {s = \\_ => s; defNom=s; onPrep = False; hasArt = False; gn = GSg g} ; mkLN : Str -> GenNum -> LN = - \s,gn -> lin LN {s = \\_ => s; onPrep = False; gn = gn} ; + \s,gn -> lin LN {s = \\_ => s; defNom=s; onPrep = False; hasArt = False; gn = gn} ; mkLN : Str -> Str -> GenNum -> LN = - \s1,s2,gn -> lin LN {s = table Species [s2; s1]; onPrep = False; gn = gn} ; + \s1,s2,gn -> lin LN {s = table Species [s2; s1]; defNom=s2; onPrep = False; hasArt = True; gn = gn} ; + mkLN : Str -> Str -> Str -> LN = + \s1,s2,s3 -> lin LN {s = table Species [s3; s2]; defNom=s1; onPrep = False; hasArt = True; gn = GSg Masc} ; } ; onLN : LN -> LN = \n -> n ** {onPrep = True} ; diff --git a/src/bulgarian/NamesBul.gf b/src/bulgarian/NamesBul.gf index ea5c5901..d15a0950 100644 --- a/src/bulgarian/NamesBul.gf +++ b/src/bulgarian/NamesBul.gf @@ -36,9 +36,18 @@ lin FullName gn sn = { p = NounP3 Pos } ; -lin UseLN, PlainLN = \n -> { - s = table { RObj c => linCase c Pos ++ n.s ! Def ; - _ => n.s ! Def +lin UseLN = \n -> { + s = table { RSubj => n.defNom ; + RObj c => linCase c Pos ++ n.s ! Def ; + RVoc => n.s ! Indef + } ; + gn = n.gn ; + p = NounP3 Pos + } ; + +lin PlainLN = \n -> { + s = table { RObj c => linCase c Pos ++ n.s ! Indef ; + _ => n.s ! Indef } ; gn = n.gn ; p = NounP3 Pos @@ -53,10 +62,16 @@ lin UseLN, PlainLN = \n -> { } ; 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 - } + s = \\sp => case of { + => ap.s ! aform n.gn sp RSubj ! P3 ++ n.s ! Indef ; + => ap.s ! aform n.gn Indef RSubj ! P3 ++ n.s ! Indef ; + => n.s ! sp ++ ap.s ! aform n.gn Indef RSubj ! P3 + } ; + defNom = case of { + => ap.s ! ASgMascDefNom ! P3 ++ n.s ! Indef ; + => ap.s ! aform n.gn Indef RSubj ! P3 ++ n.s ! Indef ; + => n.defNom ++ ap.s ! aform n.gn Indef RSubj ! P3 + } ; } ; }