1
0
forked from GitHub/gf-core

added VPI category and AdvVPSlash to the Bulgarian RGL

This commit is contained in:
kr.angelov
2012-06-26 09:54:06 +00:00
parent 0b1a963d7a
commit 852d923786
10 changed files with 85 additions and 61 deletions

View File

@@ -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 flags
coding=cp1251; optimize=all_subs; 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} ; CN = {s : NForm => Str; g : AGender} ;
NP = {s : Role => Str; a : Agr} ; NP = {s : Role => Str; a : Agr} ;
Pron = {s : Role => Str; gen : AForm => 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} ; Predet = {s : GenNum => Str} ;
Ord = {s : AForm => 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} ; Card = {s : CardForm => Str; n : Number} ;
Quant = {s : Bool => AForm => Str; nonEmpty : Bool; spec : Species} ; 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 -- Structural
Conj = {s : Str; distr : Bool; conj : Bool; n : Number} ; Conj = {s : Str; distr : Bool; conj : Ints 2; n : Number} ;
Subj = {s : Str} ; Subj = {s : Str} ;
Prep = {s : Str; c : Case} ; Prep = {s : Str; c : Case} ;

View File

@@ -1,5 +1,5 @@
concrete ConjunctionBul of Conjunction = concrete ConjunctionBul of Conjunction =
CatBul ** open ResBul, Coordination, Prelude in { CatBul ** open ResBul, Coordination, Prelude, Predef in {
flags coding=cp1251 ; flags coding=cp1251 ;
@@ -59,9 +59,9 @@ concrete ConjunctionBul of Conjunction =
isPre = andB x.isPre xs.isPre} ; isPre = andB x.isPre xs.isPre} ;
lincat lincat
[S] = {s : Bool => Bool => Str} ; [S] = {s : Bool => Ints 2 => Str} ;
[Adv] = {s : Bool => Bool => Str} ; [Adv] = {s : Bool => Ints 2 => Str} ;
[NP] = {s : Bool => Bool => Role => Str; a : Agr} ; [NP] = {s : Bool => Ints 2 => Role => Str; a : Agr} ;
[RS] = {s : Bool => Bool => Agr => Str} ; [RS] = {s : Bool => Ints 2 => Agr => Str} ;
[AP] = {s : Bool => Bool => AForm => Str; adv : Bool => Bool => Str; isPre : Bool} ; [AP] = {s : Bool => Ints 2 => AForm => Str; adv : Bool => Ints 2 => Str; isPre : Bool} ;
} }

View File

@@ -1,5 +1,5 @@
concrete ExtraBul of ExtraBulAbs = CatBul ** concrete ExtraBul of ExtraBulAbs = CatBul **
open ResBul, MorphoFunsBul, Coordination, Prelude in { open ResBul, MorphoFunsBul, Coordination, Prelude, Predef in {
flags coding=cp1251 ; flags coding=cp1251 ;
@@ -38,7 +38,7 @@ concrete ExtraBul of ExtraBulAbs = CatBul **
CFMasc Indef _ | CFFem Indef | CFNeut Indef => "åäíè" ; CFMasc Indef _ | CFFem Indef | CFNeut Indef => "åäíè" ;
CFMasc Def _ | CFMascDefNom _ | CFFem Def | CFNeut Def => "åäíèòå" CFMasc Def _ | CFMascDefNom _ | CFFem Def | CFNeut Def => "åäíèòå"
} ; } ;
n = Pl; nn = NCountable;
nonEmpty = True nonEmpty = True
} ; } ;
@@ -68,9 +68,24 @@ concrete ExtraBul of ExtraBulAbs = CatBul **
APl _ => APl Indef 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 lincat
VPS = {s : Agr => Str} ; VPS = {s : Agr => Str} ;
[VPS] = {s : Bool => Bool => Agr => Str} ; [VPS] = {s : Bool => Ints 2 => Agr => Str} ;
lin lin
BaseVPS x y = {s = \\d,t,a=>x.s!a++linCoord!t++y.s!a} ; 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 = { 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)) ++ PassVPSlash vp = insertObj (\\a => vp.s ! Perf ! VPassive (aform a.gn Indef (RObj Acc)) ++

View File

@@ -21,10 +21,10 @@ resource MorphoBul = ResBul ** open
oper oper
--2 Determiners --2 Determiners
mkDeterminerSg : Str -> Str -> Str -> {s : Bool => AGender => Role => Str; n : Number; countable : Bool ; spec : Species} = \vseki,vsiaka,vsiako -> 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; n = Sg; countable = False; spec = Indef} ; {s = \\_,g,_ => table AGender [vseki;vseki;vsiaka;vsiako] ! g; nn = NNum Sg; spec = Indef} ;
mkDeterminerPl : Str -> {s : Bool => AGender => Role => Str ; n : Number; countable : Bool ; spec : Species} = \vsicki -> mkDeterminerPl : Str -> {s : Bool => AGender => Role => Str ; nn : NNumber ; spec : Species} = \vsicki ->
{s = \\_,_,_ => vsicki; sp = \\_,_ => vsicki; n = Pl; countable = False; spec = Indef} ; {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 -> mkQuant : Str -> Str -> Str -> Str -> {s : Bool => AForm => Str; nonEmpty : Bool; spec : Species} = \tozi,tazi,towa,tezi ->
{ s = \\_ => table { { s = \\_ => table {

View File

@@ -3,31 +3,30 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in {
lin lin
DetCN det cn = DetCN det cn =
{ s = \\role => let nf = case <det.n,det.spec> of { { s = \\role => let nf = case <det.nn,det.spec> of {
<Sg,Def> => case role of { <NNum Sg,Def> => case role of {
RSubj => NFSgDefNom ; RSubj => NFSgDefNom ;
RVoc => NFVocative ; RVoc => NFVocative ;
_ => NF Sg Def _ => NF Sg Def
} ; } ;
<Sg,Indef> => case role of { <NNum Sg,Indef> => case role of {
RVoc => NFVocative ; RVoc => NFVocative ;
_ => NF Sg Indef _ => NF Sg Indef
} ; } ;
<Pl,Def> => NF det.n det.spec ; <NNum Pl,Def> => NF Pl Def ;
<Pl,Indef> => case cn.g of { <NNum Pl,Indef> => NF Pl Indef;
AMasc Human => NF Pl Indef; <NCountable,Def> => NF Pl det.spec ;
_ => case det.countable of { <NCountable,Indef> => case cn.g of {
True => NFPlCount ; AMasc Human => NF Pl Indef;
False => NF Pl Indef _ => NFPlCount
} }
}
} ; } ;
s = det.s ! True ! cn.g ! role ++ cn.s ! nf s = det.s ! True ! cn.g ! role ++ cn.s ! nf
in case role of { in case role of {
RObj Dat => "íà" ++ s; RObj Dat => "íà" ++ s;
_ => s _ => s
} ; } ;
a = {gn = gennum cn.g det.n; p = P3} ; a = {gn = gennum cn.g (numnnum det.nn); p = P3} ;
} ; } ;
DetNP det = DetNP det =
@@ -36,7 +35,7 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in {
RObj Dat => "íà" ++ s; RObj Dat => "íà" ++ s;
_ => s _ => s
} ; } ;
a = {gn = gennum ANeut det.n; p = P3} ; a = {gn = gennum ANeut (numnnum det.nn); p = P3} ;
} ; } ;
UsePN pn = { s = table { UsePN pn = { s = table {
@@ -65,19 +64,17 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in {
DetQuant quant num = { DetQuant quant num = {
s = \\sp,g,c => let sp' = case num.nonEmpty of { True => True ; s = \\sp,g,c => let sp' = case num.nonEmpty of { True => True ;
False => sp } 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 ; num.s ! dgenderSpecies g quant.spec c ;
n = num.n ; nn = num.nn ;
countable = num.nonEmpty ;
spec = case num.nonEmpty of {True=>Indef; _=>quant.spec} spec = case num.nonEmpty of {True=>Indef; _=>quant.spec}
} ; } ;
DetQuantOrd = \quant, num, ord -> { 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 ++ num.s ! dgenderSpecies g quant.spec c ++
ord.s ! aform (gennum g num.n) (case num.nonEmpty of {True=>Indef; _=>quant.spec}) c ; ord.s ! aform (gennum g (numnnum num.nn)) (case num.nonEmpty of {True=>Indef; _=>quant.spec}) c ;
n = num.n ; nn = num.nn ;
countable = num.nonEmpty ;
spec=Indef spec=Indef
} ; } ;
@@ -87,10 +84,10 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in {
spec = ResBul.Indef spec = ResBul.Indef
} ; } ;
NumSg = {s = \\_ => []; n = Sg; nonEmpty = False} ; NumSg = {s = \\_ => []; nn = NNum Sg; nonEmpty = False} ;
NumPl = {s = \\_ => []; n = Pl; 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} ; NumDigits n = {s = \\gspec => n.s ! NCard gspec; n = n.n} ;
OrdDigits n = {s = \\aform => n.s ! NOrd aform} ; OrdDigits n = {s = \\aform => n.s ! NOrd aform} ;

View File

@@ -53,9 +53,9 @@ concrete QuestionBul of Question = CatBul ** open ResBul, Prelude in {
} ; } ;
IdetQuant iquant num = { 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 ; num.s ! dgenderSpecies g Indef RSubj ;
n = num.n ; n = numnnum num.nn ;
nonEmpty = num.nonEmpty nonEmpty = num.nonEmpty
} ; } ;

View File

@@ -7,7 +7,7 @@
-- implement $Test$, it moreover contains regular lexical -- implement $Test$, it moreover contains regular lexical
-- patterns needed for $Lex$. -- patterns needed for $Lex$.
resource ResBul = ParamX ** open Prelude in { resource ResBul = ParamX ** open Prelude, Predef in {
flags flags
coding=cp1251 ; optimize=all ; coding=cp1251 ; optimize=all ;
@@ -30,6 +30,11 @@ resource ResBul = ParamX ** open Prelude in {
| NFVocative | NFVocative
; ;
NNumber =
NNum Number
| NCountable
;
GenNum = GSg Gender | GPl ; GenNum = GSg Gender | GPl ;
-- Agreement of $NP$ is a record. We'll add $Gender$ later. -- Agreement of $NP$ is a record. We'll add $Gender$ later.
@@ -133,6 +138,12 @@ resource ResBul = ParamX ** open Prelude in {
GPl => Pl GPl => Pl
} ; } ;
numnnum : NNumber -> Number = \nn ->
case nn of {
NNum n => n ;
NCountable => Pl
} ;
aform : GenNum -> Species -> Role -> AForm = \gn,spec,role -> aform : GenNum -> Species -> Role -> AForm = \gn,spec,role ->
case gn of { case gn of {
GSg g => case <g,spec,role> of { GSg g => case <g,spec,role> of {
@@ -636,9 +647,9 @@ resource ResBul = ParamX ** open Prelude in {
GPl => "òåçè" GPl => "òåçè"
} ; } ;
linCoord : Bool => Str ; linCoord : Ints 2 => Str ;
linCoord = table {True => "è"; False=>"èëè"} ; linCoord = table {0 => "è"; 1=>"èëè"; 2=>"íèòî"} ;
linCoordSep : Str -> Bool => Bool => Str ; linCoordSep : Str -> Bool => Ints 2 => Str ;
linCoordSep s = table {True => linCoord; False=> \\_ => s} ; linCoordSep s = table {True => linCoord; False=> \\_ => s} ;
} }

View File

@@ -12,23 +12,23 @@ concrete StructuralBul of Structural = CatBul **
almost_AdA, almost_AdN = ss "ïî÷òè" ; almost_AdA, almost_AdN = ss "ïî÷òè" ;
although_Subj = ss ["âúïðåêè ÷å"] ; although_Subj = ss ["âúïðåêè ÷å"] ;
always_AdV = 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 "çàùîòî" ; because_Subj = ss "çàùîòî" ;
before_Prep = mkPrep "ïðåäè" Acc ; before_Prep = mkPrep "ïðåäè" Acc ;
behind_Prep = mkPrep "çàä" Acc ; behind_Prep = mkPrep "çàä" Acc ;
between_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 "íî" ; but_PConj = ss "íî" ;
by8agent_Prep = mkPrep "÷ðåç" Acc ; by8agent_Prep = mkPrep "÷ðåç" Acc ;
by8means_Prep = mkPrep "÷ðåç" Acc ; by8means_Prep = mkPrep "÷ðåç" Acc ;
can8know_VV, can_VV = mkVV (stateV (mkV166 "ìîãà")) ; can8know_VV, can_VV = mkVV (stateV (mkV166 "ìîãà")) ;
during_Prep = mkPrep ["ïî âðåìå íà"] Acc ; 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 ; everybody_NP = mkNP "âñåêè" (GSg Masc) P3 ;
every_Det = mkDeterminerSg "âñåêè" "âñÿêà" "âñÿêî"; every_Det = mkDeterminerSg "âñåêè" "âñÿêà" "âñÿêî";
everything_NP = mkNP "âñè÷êî" (GSg Neut) P3 ; everything_NP = mkNP "âñè÷êî" (GSg Neut) P3 ;
everywhere_Adv = ss "íàâñÿêúäå" ; everywhere_Adv = ss "íàâñÿêúäå" ;
few_Det = {s = \\_,_,_ => "íÿêîëêî"; n = Pl; countable = True; spec = Indef} ; few_Det = {s = \\_,_,_ => "íÿêîëêî"; nn = NCountable; spec = Indef} ;
--- first_Ord = ss "first" ; DEPRECATED --- first_Ord = ss "first" ; DEPRECATED
for_Prep = mkPrep "çà" Acc ; for_Prep = mkPrep "çà" Acc ;
from_Prep = mkPrep "îò" Acc ; from_Prep = mkPrep "îò" Acc ;
@@ -73,7 +73,7 @@ concrete StructuralBul of Structural = CatBul **
on_Prep = mkPrep "íà" Acc ; on_Prep = mkPrep "íà" Acc ;
---- one_Quant = mkDeterminer Sg "one" ; -- DEPRECATED ---- one_Quant = mkDeterminer Sg "one" ; -- DEPRECATED
only_Predet = {s = \\_ => "ñàìî"} ; only_Predet = {s = \\_ => "ñàìî"} ;
or_Conj = {s=[]; conj=False; distr=False; n = Sg} ; or_Conj = {s=[]; conj=1; distr=False; n = Sg} ;
otherwise_PConj = ss "èíà÷å" ; otherwise_PConj = ss "èíà÷å" ;
part_Prep = mkPrep "îò" Acc ; part_Prep = mkPrep "îò" Acc ;
please_Voc = ss "ìîëÿ" ; please_Voc = ss "ìîëÿ" ;

View File

@@ -15,8 +15,8 @@ lin
a = agrP3 (gennum cn.g Sg) a = agrP3 (gennum cn.g Sg)
} ; } ;
CNSymbNP det cn xs = { CNSymbNP det cn xs = {
s = \\c => det.s ! False ! cn.g ! RSubj ++ cn.s ! NF det.n Indef ++ xs.s ; s = \\c => det.s ! False ! cn.g ! RSubj ++ cn.s ! NF (numnnum det.nn) Indef ++ xs.s ;
a = agrP3 (gennum cn.g det.n) a = agrP3 (gennum cn.g (numnnum det.nn))
} ; } ;
CNNumNP cn i = { CNNumNP cn i = {
s = \\c => (cn.s ! NF Sg Indef ++ i.s ! CFNeut Indef) ; s = \\c => (cn.s ! NF Sg Indef ++ i.s ! CFNeut Indef) ;

View File

@@ -69,6 +69,7 @@ concrete VerbBul of Verb = CatBul ** open Prelude, ResBul, ParadigmsBul in {
UseComp comp = insertObj comp.s (predV verbBe) ; UseComp comp = insertObj comp.s (predV verbBe) ;
AdvVP vp adv = insertObj (\\_ => adv.s) vp ; AdvVP vp adv = insertObj (\\_ => adv.s) vp ;
AdvVPSlash vp adv = insertSlashObj1 (\\_ => adv.s) vp ;
AdVVP adv vp = { AdVVP adv vp = {
s = vp.s ; s = vp.s ;