forked from GitHub/gf-core
added VPI category and AdvVPSlash to the Bulgarian RGL
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
concrete CatBul of Cat = CommonX - [IAdv,CAdv] ** open ResBul, Prelude, (R = ParamX) in {
|
||||
concrete CatBul of Cat = CommonX - [IAdv,CAdv] ** open ResBul, Prelude, Predef, (R = ParamX) in {
|
||||
|
||||
flags
|
||||
coding=cp1251; optimize=all_subs;
|
||||
@@ -54,10 +54,10 @@ concrete CatBul of Cat = CommonX - [IAdv,CAdv] ** open ResBul, Prelude, (R = Par
|
||||
CN = {s : NForm => Str; g : AGender} ;
|
||||
NP = {s : Role => Str; a : Agr} ;
|
||||
Pron = {s : Role => Str; gen : AForm => Str; a : Agr} ;
|
||||
Det = {s : Bool => AGender => Role => Str; n : Number; countable : Bool; spec : Species} ;
|
||||
Det = {s : Bool => AGender => Role => Str; nn : NNumber; spec : Species} ;
|
||||
Predet = {s : GenNum => Str} ;
|
||||
Ord = {s : AForm => Str} ;
|
||||
Num = {s : CardForm => Str; n : Number; nonEmpty : Bool} ;
|
||||
Num = {s : CardForm => Str; nn : NNumber; nonEmpty : Bool} ;
|
||||
Card = {s : CardForm => Str; n : Number} ;
|
||||
Quant = {s : Bool => AForm => Str; nonEmpty : Bool; spec : Species} ;
|
||||
|
||||
@@ -68,7 +68,7 @@ concrete CatBul of Cat = CommonX - [IAdv,CAdv] ** open ResBul, Prelude, (R = Par
|
||||
|
||||
-- Structural
|
||||
|
||||
Conj = {s : Str; distr : Bool; conj : Bool; n : Number} ;
|
||||
Conj = {s : Str; distr : Bool; conj : Ints 2; n : Number} ;
|
||||
Subj = {s : Str} ;
|
||||
Prep = {s : Str; c : Case} ;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
concrete ConjunctionBul of Conjunction =
|
||||
CatBul ** open ResBul, Coordination, Prelude in {
|
||||
CatBul ** open ResBul, Coordination, Prelude, Predef in {
|
||||
flags coding=cp1251 ;
|
||||
|
||||
|
||||
@@ -59,9 +59,9 @@ concrete ConjunctionBul of Conjunction =
|
||||
isPre = andB x.isPre xs.isPre} ;
|
||||
|
||||
lincat
|
||||
[S] = {s : Bool => Bool => Str} ;
|
||||
[Adv] = {s : Bool => Bool => Str} ;
|
||||
[NP] = {s : Bool => Bool => Role => Str; a : Agr} ;
|
||||
[RS] = {s : Bool => Bool => Agr => Str} ;
|
||||
[AP] = {s : Bool => Bool => AForm => Str; adv : Bool => Bool => Str; isPre : Bool} ;
|
||||
[S] = {s : Bool => Ints 2 => Str} ;
|
||||
[Adv] = {s : Bool => Ints 2 => Str} ;
|
||||
[NP] = {s : Bool => Ints 2 => Role => Str; a : Agr} ;
|
||||
[RS] = {s : Bool => Ints 2 => Agr => Str} ;
|
||||
[AP] = {s : Bool => Ints 2 => AForm => Str; adv : Bool => Ints 2 => Str; isPre : Bool} ;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
concrete ExtraBul of ExtraBulAbs = CatBul **
|
||||
open ResBul, MorphoFunsBul, Coordination, Prelude in {
|
||||
open ResBul, MorphoFunsBul, Coordination, Prelude, Predef in {
|
||||
flags coding=cp1251 ;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ concrete ExtraBul of ExtraBulAbs = CatBul **
|
||||
CFMasc Indef _ | CFFem Indef | CFNeut Indef => "åäíè" ;
|
||||
CFMasc Def _ | CFMascDefNom _ | CFFem Def | CFNeut Def => "åäíèòå"
|
||||
} ;
|
||||
n = Pl;
|
||||
nn = NCountable;
|
||||
nonEmpty = True
|
||||
} ;
|
||||
|
||||
@@ -68,9 +68,24 @@ concrete ExtraBul of ExtraBulAbs = CatBul **
|
||||
APl _ => APl Indef
|
||||
} ;
|
||||
|
||||
lincat
|
||||
VPI = {s : Agr => Str} ;
|
||||
[VPI] = {s : Bool => Ints 2 => Agr => Str} ;
|
||||
|
||||
lin
|
||||
BaseVPI x y = {s = \\d,t,a=>x.s!a++linCoord!t++y.s!a} ;
|
||||
ConsVPI x xs = {s = \\d,t,a=>x.s!a++(linCoordSep comma)!d!t++xs.s!d!t!a} ;
|
||||
|
||||
MkVPI vp = {s = daComplex vp ! Perf} ;
|
||||
ConjVPI conj vpi = {
|
||||
s = \\a => conj.s++(linCoordSep [])!conj.distr!conj.conj++vpi.s!conj.distr!conj.conj!a;
|
||||
} ;
|
||||
ComplVPIVV vv vpi =
|
||||
insertObj (\\a => vpi.s ! a) (predV vv) ;
|
||||
|
||||
lincat
|
||||
VPS = {s : Agr => Str} ;
|
||||
[VPS] = {s : Bool => Bool => Agr => Str} ;
|
||||
[VPS] = {s : Bool => Ints 2 => Agr => Str} ;
|
||||
|
||||
lin
|
||||
BaseVPS x y = {s = \\d,t,a=>x.s!a++linCoord!t++y.s!a} ;
|
||||
@@ -86,7 +101,7 @@ concrete ExtraBul of ExtraBulAbs = CatBul **
|
||||
} ;
|
||||
|
||||
ConjVPS conj vps = {
|
||||
s = \\a => (linCoordSep [])!conj.distr!conj.conj++vps.s!conj.distr!conj.conj!a;
|
||||
s = \\a => conj.s++(linCoordSep [])!conj.distr!conj.conj++vps.s!conj.distr!conj.conj!a;
|
||||
} ;
|
||||
|
||||
PassVPSlash vp = insertObj (\\a => vp.s ! Perf ! VPassive (aform a.gn Indef (RObj Acc)) ++
|
||||
|
||||
@@ -21,10 +21,10 @@ resource MorphoBul = ResBul ** open
|
||||
oper
|
||||
--2 Determiners
|
||||
|
||||
mkDeterminerSg : Str -> Str -> Str -> {s : Bool => AGender => Role => Str; n : Number; countable : Bool ; spec : Species} = \vseki,vsiaka,vsiako ->
|
||||
{s = \\_,g,_ => table AGender [vseki;vseki;vsiaka;vsiako] ! g; n = Sg; countable = False; spec = Indef} ;
|
||||
mkDeterminerPl : Str -> {s : Bool => AGender => Role => Str ; n : Number; countable : Bool ; spec : Species} = \vsicki ->
|
||||
{s = \\_,_,_ => vsicki; sp = \\_,_ => vsicki; n = Pl; countable = False; spec = Indef} ;
|
||||
mkDeterminerSg : Str -> Str -> Str -> {s : Bool => AGender => Role => Str; nn : NNumber; spec : Species} = \vseki,vsiaka,vsiako ->
|
||||
{s = \\_,g,_ => table AGender [vseki;vseki;vsiaka;vsiako] ! g; nn = NNum Sg; spec = Indef} ;
|
||||
mkDeterminerPl : Str -> {s : Bool => AGender => Role => Str ; nn : NNumber ; spec : Species} = \vsicki ->
|
||||
{s = \\_,_,_ => vsicki; sp = \\_,_ => vsicki; nn = NNum Pl; spec = Indef} ;
|
||||
|
||||
mkQuant : Str -> Str -> Str -> Str -> {s : Bool => AForm => Str; nonEmpty : Bool; spec : Species} = \tozi,tazi,towa,tezi ->
|
||||
{ s = \\_ => table {
|
||||
|
||||
@@ -3,31 +3,30 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in {
|
||||
|
||||
lin
|
||||
DetCN det cn =
|
||||
{ s = \\role => let nf = case <det.n,det.spec> of {
|
||||
<Sg,Def> => case role of {
|
||||
RSubj => NFSgDefNom ;
|
||||
RVoc => NFVocative ;
|
||||
_ => NF Sg Def
|
||||
} ;
|
||||
<Sg,Indef> => case role of {
|
||||
RVoc => NFVocative ;
|
||||
_ => NF Sg Indef
|
||||
} ;
|
||||
<Pl,Def> => NF det.n det.spec ;
|
||||
<Pl,Indef> => case cn.g of {
|
||||
AMasc Human => NF Pl Indef;
|
||||
_ => case det.countable of {
|
||||
True => NFPlCount ;
|
||||
False => NF Pl Indef
|
||||
}
|
||||
}
|
||||
{ s = \\role => let nf = case <det.nn,det.spec> of {
|
||||
<NNum Sg,Def> => case role of {
|
||||
RSubj => NFSgDefNom ;
|
||||
RVoc => NFVocative ;
|
||||
_ => NF Sg Def
|
||||
} ;
|
||||
<NNum Sg,Indef> => case role of {
|
||||
RVoc => NFVocative ;
|
||||
_ => NF Sg Indef
|
||||
} ;
|
||||
<NNum Pl,Def> => NF Pl Def ;
|
||||
<NNum Pl,Indef> => NF Pl Indef;
|
||||
<NCountable,Def> => NF Pl det.spec ;
|
||||
<NCountable,Indef> => case cn.g of {
|
||||
AMasc Human => NF Pl Indef;
|
||||
_ => NFPlCount
|
||||
}
|
||||
} ;
|
||||
s = det.s ! True ! cn.g ! role ++ cn.s ! nf
|
||||
in case role of {
|
||||
RObj Dat => "íà" ++ s;
|
||||
_ => s
|
||||
} ;
|
||||
a = {gn = gennum cn.g det.n; p = P3} ;
|
||||
a = {gn = gennum cn.g (numnnum det.nn); p = P3} ;
|
||||
} ;
|
||||
|
||||
DetNP det =
|
||||
@@ -36,7 +35,7 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in {
|
||||
RObj Dat => "íà" ++ s;
|
||||
_ => s
|
||||
} ;
|
||||
a = {gn = gennum ANeut det.n; p = P3} ;
|
||||
a = {gn = gennum ANeut (numnnum det.nn); p = P3} ;
|
||||
} ;
|
||||
|
||||
UsePN pn = { s = table {
|
||||
@@ -65,19 +64,17 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in {
|
||||
DetQuant quant num = {
|
||||
s = \\sp,g,c => let sp' = case num.nonEmpty of { True => True ;
|
||||
False => sp }
|
||||
in quant.s ! sp' ! aform (gennum g num.n) (case c of {RVoc=>Indef; _=>Def}) c ++
|
||||
in quant.s ! sp' ! aform (gennum g (numnnum num.nn)) (case c of {RVoc=>Indef; _=>Def}) c ++
|
||||
num.s ! dgenderSpecies g quant.spec c ;
|
||||
n = num.n ;
|
||||
countable = num.nonEmpty ;
|
||||
nn = num.nn ;
|
||||
spec = case num.nonEmpty of {True=>Indef; _=>quant.spec}
|
||||
} ;
|
||||
|
||||
DetQuantOrd = \quant, num, ord -> {
|
||||
s = \\_,g,c => quant.s ! True ! aform (gennum g num.n) (case c of {RVoc=>Indef; _=>Def}) c ++
|
||||
s = \\_,g,c => quant.s ! True ! aform (gennum g (numnnum num.nn)) (case c of {RVoc=>Indef; _=>Def}) c ++
|
||||
num.s ! dgenderSpecies g quant.spec c ++
|
||||
ord.s ! aform (gennum g num.n) (case num.nonEmpty of {True=>Indef; _=>quant.spec}) c ;
|
||||
n = num.n ;
|
||||
countable = num.nonEmpty ;
|
||||
ord.s ! aform (gennum g (numnnum num.nn)) (case num.nonEmpty of {True=>Indef; _=>quant.spec}) c ;
|
||||
nn = num.nn ;
|
||||
spec=Indef
|
||||
} ;
|
||||
|
||||
@@ -87,10 +84,10 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in {
|
||||
spec = ResBul.Indef
|
||||
} ;
|
||||
|
||||
NumSg = {s = \\_ => []; n = Sg; nonEmpty = False} ;
|
||||
NumPl = {s = \\_ => []; n = Pl; nonEmpty = False} ;
|
||||
NumSg = {s = \\_ => []; nn = NNum Sg; nonEmpty = False} ;
|
||||
NumPl = {s = \\_ => []; nn = NNum Pl; nonEmpty = False} ;
|
||||
|
||||
NumCard n = n ** {nonEmpty = True} ;
|
||||
NumCard n = {s=n.s; nn=case n.n of {Sg => NNum Sg; Pl => NCountable}; nonEmpty = True} ;
|
||||
|
||||
NumDigits n = {s = \\gspec => n.s ! NCard gspec; n = n.n} ;
|
||||
OrdDigits n = {s = \\aform => n.s ! NOrd aform} ;
|
||||
|
||||
@@ -53,9 +53,9 @@ concrete QuestionBul of Question = CatBul ** open ResBul, Prelude in {
|
||||
} ;
|
||||
|
||||
IdetQuant iquant num = {
|
||||
s = \\g,qform => iquant.s ! gennum g num.n ! qform ++
|
||||
s = \\g,qform => iquant.s ! gennum g (numnnum num.nn) ! qform ++
|
||||
num.s ! dgenderSpecies g Indef RSubj ;
|
||||
n = num.n ;
|
||||
n = numnnum num.nn ;
|
||||
nonEmpty = num.nonEmpty
|
||||
} ;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
-- implement $Test$, it moreover contains regular lexical
|
||||
-- patterns needed for $Lex$.
|
||||
|
||||
resource ResBul = ParamX ** open Prelude in {
|
||||
resource ResBul = ParamX ** open Prelude, Predef in {
|
||||
|
||||
flags
|
||||
coding=cp1251 ; optimize=all ;
|
||||
@@ -29,6 +29,11 @@ resource ResBul = ParamX ** open Prelude in {
|
||||
| NFPlCount
|
||||
| NFVocative
|
||||
;
|
||||
|
||||
NNumber =
|
||||
NNum Number
|
||||
| NCountable
|
||||
;
|
||||
|
||||
GenNum = GSg Gender | GPl ;
|
||||
|
||||
@@ -133,6 +138,12 @@ resource ResBul = ParamX ** open Prelude in {
|
||||
GPl => Pl
|
||||
} ;
|
||||
|
||||
numnnum : NNumber -> Number = \nn ->
|
||||
case nn of {
|
||||
NNum n => n ;
|
||||
NCountable => Pl
|
||||
} ;
|
||||
|
||||
aform : GenNum -> Species -> Role -> AForm = \gn,spec,role ->
|
||||
case gn of {
|
||||
GSg g => case <g,spec,role> of {
|
||||
@@ -636,9 +647,9 @@ resource ResBul = ParamX ** open Prelude in {
|
||||
GPl => "òåçè"
|
||||
} ;
|
||||
|
||||
linCoord : Bool => Str ;
|
||||
linCoord = table {True => "è"; False=>"èëè"} ;
|
||||
linCoord : Ints 2 => Str ;
|
||||
linCoord = table {0 => "è"; 1=>"èëè"; 2=>"íèòî"} ;
|
||||
|
||||
linCoordSep : Str -> Bool => Bool => Str ;
|
||||
linCoordSep : Str -> Bool => Ints 2 => Str ;
|
||||
linCoordSep s = table {True => linCoord; False=> \\_ => s} ;
|
||||
}
|
||||
|
||||
@@ -12,23 +12,23 @@ concrete StructuralBul of Structural = CatBul **
|
||||
almost_AdA, almost_AdN = ss "ïî÷òè" ;
|
||||
although_Subj = ss ["âúïðåêè ÷å"] ;
|
||||
always_AdV = ss "âèíàãè" ;
|
||||
and_Conj = {s=[]; conj=True; distr=False; n = Pl} ;
|
||||
and_Conj = {s=[]; conj=0; distr=False; n = Pl} ;
|
||||
because_Subj = ss "çàùîòî" ;
|
||||
before_Prep = mkPrep "ïðåäè" Acc ;
|
||||
behind_Prep = mkPrep "çàä" Acc ;
|
||||
between_Prep = mkPrep "ìåæäó" Acc ;
|
||||
both7and_DConj = {s=[]; conj=True; distr=True; n = Pl} ;
|
||||
both7and_DConj = {s=[]; conj=0; distr=True; n = Pl} ;
|
||||
but_PConj = ss "íî" ;
|
||||
by8agent_Prep = mkPrep "÷ðåç" Acc ;
|
||||
by8means_Prep = mkPrep "÷ðåç" Acc ;
|
||||
can8know_VV, can_VV = mkVV (stateV (mkV166 "ìîãà")) ;
|
||||
during_Prep = mkPrep ["ïî âðåìå íà"] Acc ;
|
||||
either7or_DConj = {s=[]; conj=False; distr=True; n = Sg} ;
|
||||
either7or_DConj = {s=[]; conj=1; distr=True; n = Sg} ;
|
||||
everybody_NP = mkNP "âñåêè" (GSg Masc) P3 ;
|
||||
every_Det = mkDeterminerSg "âñåêè" "âñÿêà" "âñÿêî";
|
||||
everything_NP = mkNP "âñè÷êî" (GSg Neut) P3 ;
|
||||
everywhere_Adv = ss "íàâñÿêúäå" ;
|
||||
few_Det = {s = \\_,_,_ => "íÿêîëêî"; n = Pl; countable = True; spec = Indef} ;
|
||||
few_Det = {s = \\_,_,_ => "íÿêîëêî"; nn = NCountable; spec = Indef} ;
|
||||
--- first_Ord = ss "first" ; DEPRECATED
|
||||
for_Prep = mkPrep "çà" Acc ;
|
||||
from_Prep = mkPrep "îò" Acc ;
|
||||
@@ -73,7 +73,7 @@ concrete StructuralBul of Structural = CatBul **
|
||||
on_Prep = mkPrep "íà" Acc ;
|
||||
---- one_Quant = mkDeterminer Sg "one" ; -- DEPRECATED
|
||||
only_Predet = {s = \\_ => "ñàìî"} ;
|
||||
or_Conj = {s=[]; conj=False; distr=False; n = Sg} ;
|
||||
or_Conj = {s=[]; conj=1; distr=False; n = Sg} ;
|
||||
otherwise_PConj = ss "èíà÷å" ;
|
||||
part_Prep = mkPrep "îò" Acc ;
|
||||
please_Voc = ss "ìîëÿ" ;
|
||||
|
||||
@@ -15,8 +15,8 @@ lin
|
||||
a = agrP3 (gennum cn.g Sg)
|
||||
} ;
|
||||
CNSymbNP det cn xs = {
|
||||
s = \\c => det.s ! False ! cn.g ! RSubj ++ cn.s ! NF det.n Indef ++ xs.s ;
|
||||
a = agrP3 (gennum cn.g det.n)
|
||||
s = \\c => det.s ! False ! cn.g ! RSubj ++ cn.s ! NF (numnnum det.nn) Indef ++ xs.s ;
|
||||
a = agrP3 (gennum cn.g (numnnum det.nn))
|
||||
} ;
|
||||
CNNumNP cn i = {
|
||||
s = \\c => (cn.s ! NF Sg Indef ++ i.s ! CFNeut Indef) ;
|
||||
|
||||
@@ -69,6 +69,7 @@ concrete VerbBul of Verb = CatBul ** open Prelude, ResBul, ParadigmsBul in {
|
||||
UseComp comp = insertObj comp.s (predV verbBe) ;
|
||||
|
||||
AdvVP vp adv = insertObj (\\_ => adv.s) vp ;
|
||||
AdvVPSlash vp adv = insertSlashObj1 (\\_ => adv.s) vp ;
|
||||
|
||||
AdVVP adv vp = {
|
||||
s = vp.s ;
|
||||
|
||||
Reference in New Issue
Block a user