forked from GitHub/gf-core
Add relative clauses
This commit is contained in:
@@ -23,6 +23,7 @@ concrete CatBul of Cat = open ResBul, Prelude, (R = ParamX) in {
|
|||||||
|
|
||||||
S = {s : Str} ;
|
S = {s : Str} ;
|
||||||
QS = {s : QForm => Str} ;
|
QS = {s : QForm => Str} ;
|
||||||
|
RS = {s : GenNum => Str} ;
|
||||||
SC = {s : Str} ;
|
SC = {s : Str} ;
|
||||||
|
|
||||||
-- Sentence
|
-- Sentence
|
||||||
@@ -41,6 +42,11 @@ concrete CatBul of Cat = open ResBul, Prelude, (R = ParamX) in {
|
|||||||
IComp = {s1,s2 : Str} ;
|
IComp = {s1,s2 : Str} ;
|
||||||
IDet = {s : GenNum => Str; n : Number} ;
|
IDet = {s : GenNum => Str; n : Number} ;
|
||||||
|
|
||||||
|
-- Relative
|
||||||
|
|
||||||
|
RCl = {s : ResBul.Tense => Anteriority => Polarity => GenNum => Str} ;
|
||||||
|
RP = {s : GenNum => Str} ;
|
||||||
|
|
||||||
-- Verb
|
-- Verb
|
||||||
|
|
||||||
VP = {
|
VP = {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ concrete GrammarBul of Grammar =
|
|||||||
NumeralBul,
|
NumeralBul,
|
||||||
SentenceBul,
|
SentenceBul,
|
||||||
QuestionBul,
|
QuestionBul,
|
||||||
|
RelativeBul,
|
||||||
PhraseBul,
|
PhraseBul,
|
||||||
TextBul,
|
TextBul,
|
||||||
StructuralBul
|
StructuralBul
|
||||||
|
|||||||
@@ -109,6 +109,10 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in {
|
|||||||
s = \\nf => preOrPost ap.isPre (ap.s ! nform2aform nf cn.g) (cn.s ! (indefNForm nf)) ;
|
s = \\nf => preOrPost ap.isPre (ap.s ! nform2aform nf cn.g) (cn.s ! (indefNForm nf)) ;
|
||||||
g = cn.g
|
g = cn.g
|
||||||
} ;
|
} ;
|
||||||
|
RelCN cn rs = {
|
||||||
|
s = \\nf => cn.s ! nf ++ rs.s ! gennum cn.g (numNForm nf) ;
|
||||||
|
g = cn.g
|
||||||
|
} ;
|
||||||
AdvCN cn ad = {
|
AdvCN cn ad = {
|
||||||
s = \\nf => cn.s ! nf ++ ad.s ;
|
s = \\nf => cn.s ! nf ++ ad.s ;
|
||||||
g = cn.g
|
g = cn.g
|
||||||
|
|||||||
32
lib/resource/bulgarian/RelativeBul.gf
Normal file
32
lib/resource/bulgarian/RelativeBul.gf
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
concrete RelativeBul of Relative = CatBul ** open ResBul in {
|
||||||
|
|
||||||
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
RelCl cl = {
|
||||||
|
s = \\t,a,p,gn => whichRP ! gn ++ cl.s ! t ! a ! p ! Main ;
|
||||||
|
role = RSubj
|
||||||
|
} ;
|
||||||
|
|
||||||
|
RelVP rp vp = {
|
||||||
|
s = \\t,a,p,gn =>
|
||||||
|
let
|
||||||
|
cl = mkClause (rp.s ! gn) {gn=gn; p=P3} vp
|
||||||
|
in
|
||||||
|
cl.s ! t ! a ! p ! Main ;
|
||||||
|
role = RSubj
|
||||||
|
} ;
|
||||||
|
|
||||||
|
RelSlash rp slash = {
|
||||||
|
s = \\t,a,p,gn => slash.c2.s ++ (rp.s ! gn) ++ slash.s ! t ! a ! p ! Main ;
|
||||||
|
role = RObj Acc
|
||||||
|
} ;
|
||||||
|
|
||||||
|
FunRP p np rp = {
|
||||||
|
s = \\gn => np.s ! RObj Acc ++ p.s ++ rp.s ! gn ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
IdRP = {
|
||||||
|
s = whichRP ;
|
||||||
|
} ;
|
||||||
|
}
|
||||||
@@ -162,9 +162,16 @@ resource ResBul = ParamX ** open Prelude in {
|
|||||||
NFVocative => NFVocative
|
NFVocative => NFVocative
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
numNForm : NForm -> Number
|
||||||
|
= \nf -> case nf of {
|
||||||
|
NF n spec => n ;
|
||||||
|
NFSgDefNom => Sg ;
|
||||||
|
NFPlCount => Pl ;
|
||||||
|
NFVocative => Sg
|
||||||
|
} ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
-- For $Verb$.
|
-- For $Verb$.
|
||||||
|
|
||||||
Verb : Type = {
|
Verb : Type = {
|
||||||
s : VForm => Str ;
|
s : VForm => Str ;
|
||||||
vtype : VType
|
vtype : VType
|
||||||
@@ -545,4 +552,12 @@ resource ResBul = ParamX ** open Prelude in {
|
|||||||
QIndir => wh.s2 ++ cls ! Main
|
QIndir => wh.s2 ++ cls ! Main
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
whichRP : GenNum => Str
|
||||||
|
= table {
|
||||||
|
GSg Masc => "êîéòî" ;
|
||||||
|
GSg Fem => "êîÿòî" ;
|
||||||
|
GSg Neut => "êîåòî" ;
|
||||||
|
GPl => "êîèòî"
|
||||||
|
} ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,10 @@ concrete SentenceBul of Sentence = CatBul ** open Prelude, ResBul in {
|
|||||||
UseQCl t a p cl = {
|
UseQCl t a p cl = {
|
||||||
s = \\q => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! q
|
s = \\q => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! q
|
||||||
} ;
|
} ;
|
||||||
|
UseRCl t a p cl = {
|
||||||
|
s = \\r => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! r ;
|
||||||
|
role = cl.role
|
||||||
|
} ;
|
||||||
UseSlash t a p cl = {
|
UseSlash t a p cl = {
|
||||||
s = t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! Main ;
|
s = t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! Main ;
|
||||||
c2 = cl.c2
|
c2 = cl.c2
|
||||||
|
|||||||
Reference in New Issue
Block a user