Add relative clauses

This commit is contained in:
krasimir
2008-02-27 13:29:05 +00:00
parent 0c8a84512e
commit 3fccfd4bef
6 changed files with 63 additions and 1 deletions

View File

@@ -23,6 +23,7 @@ concrete CatBul of Cat = open ResBul, Prelude, (R = ParamX) in {
S = {s : Str} ;
QS = {s : QForm => Str} ;
RS = {s : GenNum => Str} ;
SC = {s : Str} ;
-- Sentence
@@ -41,6 +42,11 @@ concrete CatBul of Cat = open ResBul, Prelude, (R = ParamX) in {
IComp = {s1,s2 : Str} ;
IDet = {s : GenNum => Str; n : Number} ;
-- Relative
RCl = {s : ResBul.Tense => Anteriority => Polarity => GenNum => Str} ;
RP = {s : GenNum => Str} ;
-- Verb
VP = {

View File

@@ -8,6 +8,7 @@ concrete GrammarBul of Grammar =
NumeralBul,
SentenceBul,
QuestionBul,
RelativeBul,
PhraseBul,
TextBul,
StructuralBul

View File

@@ -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)) ;
g = cn.g
} ;
RelCN cn rs = {
s = \\nf => cn.s ! nf ++ rs.s ! gennum cn.g (numNForm nf) ;
g = cn.g
} ;
AdvCN cn ad = {
s = \\nf => cn.s ! nf ++ ad.s ;
g = cn.g

View 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 ;
} ;
}

View File

@@ -162,9 +162,16 @@ resource ResBul = ParamX ** open Prelude in {
NFVocative => NFVocative
} ;
numNForm : NForm -> Number
= \nf -> case nf of {
NF n spec => n ;
NFSgDefNom => Sg ;
NFPlCount => Pl ;
NFVocative => Sg
} ;
oper
-- For $Verb$.
Verb : Type = {
s : VForm => Str ;
vtype : VType
@@ -545,4 +552,12 @@ resource ResBul = ParamX ** open Prelude in {
QIndir => wh.s2 ++ cls ! Main
}
} ;
whichRP : GenNum => Str
= table {
GSg Masc => "êîéòî" ;
GSg Fem => "êîÿòî" ;
GSg Neut => "êîåòî" ;
GPl => "êîèòî"
} ;
}

View File

@@ -33,6 +33,10 @@ concrete SentenceBul of Sentence = CatBul ** open Prelude, ResBul in {
UseQCl t a p cl = {
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 = {
s = t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! Main ;
c2 = cl.c2