From 3c2f45da85504e0b411392670ddf8ce7b455d3f1 Mon Sep 17 00:00:00 2001 From: krasimir Date: Mon, 9 Jun 2008 07:11:32 +0000 Subject: [PATCH] simplify the determiners in bulgarian-1.4 --- lib/resource-1.4/bulgarian/CatBul.gf | 6 +-- lib/resource-1.4/bulgarian/MorphoBul.gf | 5 +- lib/resource-1.4/bulgarian/NounBul.gf | 67 ++++++++++++++----------- 3 files changed, 42 insertions(+), 36 deletions(-) diff --git a/lib/resource-1.4/bulgarian/CatBul.gf b/lib/resource-1.4/bulgarian/CatBul.gf index b483be0ae..3e12061f6 100644 --- a/lib/resource-1.4/bulgarian/CatBul.gf +++ b/lib/resource-1.4/bulgarian/CatBul.gf @@ -82,11 +82,11 @@ concrete CatBul of Cat = open ResBul, Prelude, (R = ParamX) in { Pron = {s : Role => Str; gen : AForm => Str; a : Agr} ; Det = {s : DGender => Role => Str ; n : Number; countable : Bool; spec : Species} ; Predet = {s : GenNum => Str} ; - Ord = {s : AForm => Str; nonEmpty : Bool} ; + Ord = {s : AForm => Str} ; Num = {s : DGenderSpecies => Str; n : Number; nonEmpty : Bool} ; Card = {s : DGenderSpecies => Str; n : Number} ; - Quant = {s : AForm => Str; spec : Species} ; - Art = {s : AForm => Str; spec : Species} ; + Quant = {s : AForm => Str} ; + Art = {s : Str; spec : Species} ; -- Numeral diff --git a/lib/resource-1.4/bulgarian/MorphoBul.gf b/lib/resource-1.4/bulgarian/MorphoBul.gf index 14dc61d5c..ed1ad0c18 100644 --- a/lib/resource-1.4/bulgarian/MorphoBul.gf +++ b/lib/resource-1.4/bulgarian/MorphoBul.gf @@ -24,15 +24,14 @@ oper mkDeterminerPl : Str -> {s : DGender => Role => Str ; n : Number; countable : Bool ; spec : Species} = \vsicki -> {s = \\_,_ => vsicki; n = Pl; countable = False; spec = Indef} ; - mkQuant : Str -> Str -> Str -> Str -> {s : AForm => Str; spec : Species} = \tozi,tazi,towa,tezi -> { + mkQuant : Str -> Str -> Str -> Str -> {s : AForm => Str} = \tozi,tazi,towa,tezi -> { s = \\aform => case aform of { ASg Masc _ => tozi ; ASgMascDefNom => tozi ; ASg Fem _ => tazi ; ASg Neut _ => towa ; APl _ => tezi - }; - spec = Indef + } } ; diff --git a/lib/resource-1.4/bulgarian/NounBul.gf b/lib/resource-1.4/bulgarian/NounBul.gf index ca8734dfe..a72446919 100644 --- a/lib/resource-1.4/bulgarian/NounBul.gf +++ b/lib/resource-1.4/bulgarian/NounBul.gf @@ -65,45 +65,52 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in { a = np.a } ; - DetQuantOrd, DetArtOrd = \quant, num, ord -> { - s = \\g,c => num.s ! dgenderSpecies g quant.spec c ++ - quant.s ! aform (gennum g num.n) Def c ++ - ord.s ! aform (gennum g num.n) (case num.nonEmpty of {False => quant.spec; _ => Indef}) c ; - n = num.n ; - countable = num.nonEmpty ; - spec=case of { => quant.spec; _ => Indef} - } ; - DetQuant quant num = { - s = \\g,c => num.s ! dgenderSpecies g quant.spec c ++ - quant.s ! aform (gennum g num.n) Def c ; + s = \\g,c => quant.s ! aform (gennum g num.n) Def c ++ + num.s ! dgenderSpecies g Indef c ; n = num.n ; countable = num.nonEmpty ; - spec=case num.nonEmpty of {False => quant.spec; _ => Indef} ---- FIXME AR + spec=Indef } ; - DetArtCard quant num = { - s = \\g,c => num.s ! dgenderSpecies g quant.spec c ++ - quant.s ! aform (gennum g num.n) Def c ; + DetQuantOrd = \quant, num, ord -> { + s = \\g,c => quant.s ! aform (gennum g num.n) Def c ++ + num.s ! dgenderSpecies g Indef c ++ + ord.s ! aform (gennum g num.n) Indef c ; n = num.n ; - countable = True ; - spec= Indef ---- FIXME AR + countable = num.nonEmpty ; + spec=Indef } ; - ---- FIXME AR - DetArtPl quant = detCN { - s = \\g,c => quant.s ! aform (gennum g Pl) Def c ; + DetArtCard art card = { + s = \\g,c => art.s ++ + card.s ! dgenderSpecies g art.spec c ; + n = card.n ; + countable = True ; + spec=Indef + } ; + + DetArtOrd = \art, num, ord -> { + s = \\g,c => art.s ++ + num.s ! dgenderSpecies g art.spec c ++ + ord.s ! aform (gennum g num.n) (case num.nonEmpty of {False => art.spec; _ => Indef}) c ; + n = num.n ; + countable = num.nonEmpty ; + spec=Indef + } ; + + DetArtPl art = detCN { + s = \\g,c => art.s ; n = Pl ; countable = False ; - spec=quant.spec; + spec=art.spec; } ; - ---- FIXME AR - DetArtSg quant = detCN { - s = \\g,c => quant.s ! aform (gennum g Sg) Def c ; + DetArtSg art = detCN { + s = \\g,c => art.s ; n = Sg ; countable = False ; - spec=quant.spec; + spec=art.spec; } ; PossPron p = { @@ -117,22 +124,22 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in { NumCard n = n ** {nonEmpty = True} ; NumDigits n = {s = \\gspec => n.s ! NCard gspec; n = n.n} ; - OrdDigits n = {s = \\aform => n.s ! NOrd aform; nonEmpty = True} ; + OrdDigits n = {s = \\aform => n.s ! NOrd aform} ; NumNumeral numeral = {s = \\gspec => numeral.s ! NCard gspec; n = numeral.n; nonEmpty = True} ; - OrdNumeral numeral = {s = \\aform => numeral.s ! NOrd aform; nonEmpty = True} ; + OrdNumeral numeral = {s = \\aform => numeral.s ! NOrd aform} ; AdNum adn num = {s = \\gspec => adn.s ++ num.s ! gspec; n = num.n; nonEmpty = num.nonEmpty} ; - OrdSuperl a = {s = \\aform => "най" ++ "-" ++ a.s ! aform; nonEmpty = True} ; + OrdSuperl a = {s = \\aform => "най" ++ "-" ++ a.s ! aform} ; DefArt = { - s = \\_ => [] ; + s = [] ; spec = ResBul.Def } ; IndefArt = { - s = \\_ => [] ; + s = [] ; spec = ResBul.Indef } ;