forked from GitHub/gf-rgl
changes in conjunction and sentences
to accomodate if _ then conjuction with jiu "就"
This commit is contained in:
@@ -8,11 +8,11 @@ concrete AdverbChi of Adverb = CatChi **
|
|||||||
|
|
||||||
ComparAdvAdj cadv a np = ss (a.s!Attr ++ cadv.s ++ cadv.p ++ np.s) ** {advType = ATManner ; hasDe = False} ;
|
ComparAdvAdj cadv a np = ss (a.s!Attr ++ cadv.s ++ cadv.p ++ np.s) ** {advType = ATManner ; hasDe = False} ;
|
||||||
|
|
||||||
ComparAdvAdjS cadv a s = ss (a.s!Attr ++ cadv.s ++ cadv.p ++ s.s) ** {advType = ATManner ; hasDe = False} ;
|
ComparAdvAdjS cadv a s = ss (a.s!Attr ++ cadv.s ++ cadv.p ++ linS s) ** {advType = ATManner ; hasDe = False} ;
|
||||||
|
|
||||||
AdAdv ad adv = adv ** {s = ad.s ++ adv.s} ;
|
AdAdv ad adv = adv ** {s = ad.s ++ adv.s} ;
|
||||||
|
|
||||||
SubjS subj s = ss (subj.prePart ++ s.s ++ subj.sufPart) ** {advType = ATTime ; hasDe = False} ;
|
SubjS subj s = ss (subj.prePart ++ linS s ++ subj.sufPart) ** {advType = ATTime ; hasDe = False} ;
|
||||||
|
|
||||||
AdnCAdv cadv = ss (cadv.s ++ conjThat) ** {advType = ATManner ; hasDe = False} ; -----
|
AdnCAdv cadv = ss (cadv.s ++ conjThat) ** {advType = ATManner ; hasDe = False} ; -----
|
||||||
|
|
||||||
|
|||||||
@@ -4,14 +4,14 @@ concrete CatChi of Cat = CommonX - [Tense, Temp, Ant, Adv] ** open ResChi, Prelu
|
|||||||
|
|
||||||
-- Tensed/Untensed
|
-- Tensed/Untensed
|
||||||
|
|
||||||
S = {s : Str} ;
|
S = Sentence ;
|
||||||
QS = {s : Bool => Str} ; -- True = direct question (with ma for sentential questions)
|
QS = {s : Bool => Str} ; -- True = direct question (with ma for sentential questions)
|
||||||
RS = {s : Str} ;
|
RS = {s : Str} ;
|
||||||
SSlash = {s : Str ; c2 : Preposition} ;
|
SSlash = {s : Str ; c2 : Preposition} ;
|
||||||
|
|
||||||
-- Sentence
|
-- Sentence
|
||||||
|
|
||||||
Cl = Clause ; -- {s : Polarity => Aspect => Str ; np: Str ; vp: Polarity => Aspect => Str} ;
|
Cl = Clause ; -- {s : Polarity => Aspect => Str ; np: Str ; vp: Polarity => Aspect => Str} ;
|
||||||
|
|
||||||
ClSlash = Clause ** {c2 : Preposition} ;
|
ClSlash = Clause ** {c2 : Preposition} ;
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ concrete CatChi of Cat = CommonX - [Tense, Temp, Ant, Adv] ** open ResChi, Prelu
|
|||||||
|
|
||||||
QCl = {s : Bool => Polarity => Aspect => Str} ; -- True = direct question
|
QCl = {s : Bool => Polarity => Aspect => Str} ; -- True = direct question
|
||||||
IP = {s : Str} ;
|
IP = {s : Str} ;
|
||||||
IComp = {s : Str} ;
|
IComp = {s : Str} ;
|
||||||
IDet = {s : Str ; detType : DetType} ;
|
IDet = {s : Str ; detType : DetType} ;
|
||||||
IQuant = {s : Str} ;
|
IQuant = {s : Str} ;
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ concrete CatChi of Cat = CommonX - [Tense, Temp, Ant, Adv] ** open ResChi, Prelu
|
|||||||
|
|
||||||
-- Verb
|
-- Verb
|
||||||
|
|
||||||
VP = ResChi.VP ;
|
VP = ResChi.VP ;
|
||||||
Comp = ResChi.VP ;
|
Comp = ResChi.VP ;
|
||||||
VPSlash = ResChi.VP ** {c2 : Preposition ; isPre : Bool} ; -- whether the missing arg is before verb
|
VPSlash = ResChi.VP ** {c2 : Preposition ; isPre : Bool} ; -- whether the missing arg is before verb
|
||||||
|
|
||||||
@@ -59,13 +59,16 @@ concrete CatChi of Cat = CommonX - [Tense, Temp, Ant, Adv] ** open ResChi, Prelu
|
|||||||
|
|
||||||
-- Structural
|
-- Structural
|
||||||
|
|
||||||
Conj = {s : ConjForm => {s1,s2 : Str}} ;
|
Conj = {
|
||||||
|
s : ConjForm => {s1,s2 : Str} ; -- different form whether it's used for S, A, N, ...
|
||||||
|
conjType : ConjType -- different placement whether it's and,or,... or if-then
|
||||||
|
} ;
|
||||||
Subj = {prePart : Str ; sufPart : Str} ;
|
Subj = {prePart : Str ; sufPart : Str} ;
|
||||||
Prep = Preposition ;
|
Prep = Preposition ;
|
||||||
|
|
||||||
-- Open lexical classes, e.g. Lexicon
|
-- Open lexical classes, e.g. Lexicon
|
||||||
|
|
||||||
V, VS, VQ, VA = Verb ;
|
V, VS, VQ, VA = Verb ;
|
||||||
V2, V2Q, V2S = Verb ** {c2 : Preposition ; hasPrep : Bool ; part : Str} ;
|
V2, V2Q, V2S = Verb ** {c2 : Preposition ; hasPrep : Bool ; part : Str} ;
|
||||||
V3, V2A, V2V = Verb ** {c2, c3 : Preposition ; hasPrep : Bool ; part : Str} ;
|
V3, V2A, V2V = Verb ** {c2, c3 : Preposition ; hasPrep : Bool ; part : Str} ;
|
||||||
VV = Verb ;
|
VV = Verb ;
|
||||||
@@ -84,4 +87,6 @@ concrete CatChi of Cat = CommonX - [Tense, Temp, Ant, Adv] ** open ResChi, Prelu
|
|||||||
Tense = {s : Str ; t : Aspect} ;
|
Tense = {s : Str ; t : Aspect} ;
|
||||||
Ant = {s : Str ; t : Aspect} ;
|
Ant = {s : Str ; t : Aspect} ;
|
||||||
|
|
||||||
|
linref
|
||||||
|
S = linS ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,14 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin
|
|||||||
|
|
||||||
lin
|
lin
|
||||||
|
|
||||||
ConjS c = conjunctDistrSS (c.s ! CSent) ;
|
ConjS c ss =
|
||||||
|
let conj = c.s ! CSent
|
||||||
|
in case c.conjType of {
|
||||||
|
Jiu => {preJiu = conj.s1 ++ ss.s1 ++ comma ++ ss.preJiu ;
|
||||||
|
postJiu = conj.s2 ++ ss.postJiu} ;
|
||||||
|
NotJiu => {preJiu = conj.s1 ++ ss.s1 ++ conj.s2 ++ ss.preJiu ;
|
||||||
|
postJiu = ss.postJiu}
|
||||||
|
} ;
|
||||||
ConjAdv c as = conjunctDistrSS (c.s ! CSent) as ** {advType = as.advType ; hasDe = as.hasDe} ; ---- ??
|
ConjAdv c as = conjunctDistrSS (c.s ! CSent) as ** {advType = as.advType ; hasDe = as.hasDe} ; ---- ??
|
||||||
ConjNP c = conjunctDistrSS (c.s ! CPhr CNPhrase) ;
|
ConjNP c = conjunctDistrSS (c.s ! CPhr CNPhrase) ;
|
||||||
ConjAP c as = conjunctDistrTable AdjPlace (c.s ! CPhr CAPhrase) as ** {monoSyl = notB as.monoSyl ; hasAdA = True} ; ---- add de iff as doesn't
|
ConjAP c as = conjunctDistrTable AdjPlace (c.s ! CPhr CAPhrase) as ** {monoSyl = notB as.monoSyl ; hasAdA = True} ; ---- add de iff as doesn't
|
||||||
@@ -11,8 +18,14 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin
|
|||||||
|
|
||||||
-- These fun's are generated from the list cat's.
|
-- These fun's are generated from the list cat's.
|
||||||
|
|
||||||
BaseS = twoSS ;
|
BaseS s t = t ** {
|
||||||
ConsS = consrSS duncomma ;
|
s1 = linS s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ConsS s ss = -- here we do the same thing actually, the crucial split has happened in BaseS
|
||||||
|
ss ** {s1 = linS s ++ comma ++ ss.s1};
|
||||||
|
|
||||||
|
|
||||||
BaseAdv x y = twoSS x y ** {advType = x.advType ; hasDe = y.hasDe} ; ---- ??
|
BaseAdv x y = twoSS x y ** {advType = x.advType ; hasDe = y.hasDe} ; ---- ??
|
||||||
ConsAdv x xs = consrSS duncomma x xs ** {advType = x.advType ; hasDe = xs.hasDe} ; ---- ??
|
ConsAdv x xs = consrSS duncomma x xs ** {advType = x.advType ; hasDe = xs.hasDe} ; ---- ??
|
||||||
BaseNP = twoSS ;
|
BaseNP = twoSS ;
|
||||||
@@ -25,7 +38,8 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin
|
|||||||
ConsCN x xs = consrSS duncomma x xs ** {c = x.c} ;
|
ConsCN x xs = consrSS duncomma x xs ** {c = x.c} ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
[S] = {s1,s2 : Str} ;
|
--[S] = ConjType => {s1,s2 : Str} ;
|
||||||
|
[S] = {s1,preJiu,postJiu : Str} ;
|
||||||
[Adv] = {s1,s2 : Str ; advType : AdvType ; hasDe : Bool} ;
|
[Adv] = {s1,s2 : Str ; advType : AdvType ; hasDe : Bool} ;
|
||||||
[NP] = {s1,s2 : Str} ;
|
[NP] = {s1,s2 : Str} ;
|
||||||
[AP] = {s1,s2 : AdjPlace => Str ; monoSyl : Bool} ;
|
[AP] = {s1,s2 : AdjPlace => Str ; monoSyl : Bool} ;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ concrete ExtraChi of ExtraChiAbs = CatChi **
|
|||||||
BaseVPS = twoSS ;
|
BaseVPS = twoSS ;
|
||||||
ConsVPS = consrSS duncomma ;
|
ConsVPS = consrSS duncomma ;
|
||||||
|
|
||||||
PredVPS np vps = {s = np.s ++ vps.s} ;
|
PredVPS np vps = {preJiu = np.s ; postJiu = vps.s} ;
|
||||||
|
|
||||||
MkVPI vp = {s = (mkClause [] vp).s ! Pos ! APlain} ; --- ?? almost just a copy of VPS
|
MkVPI vp = {s = (mkClause [] vp).s ! Pos ! APlain} ; --- ?? almost just a copy of VPS
|
||||||
ConjVPI c = conjunctDistrSS (c.s ! CSent) ;
|
ConjVPI c = conjunctDistrSS (c.s ! CSent) ;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ concrete IdiomChi of Idiom = CatChi ** open Prelude, ResChi in {
|
|||||||
---- it is John who did it
|
---- it is John who did it
|
||||||
CleftNP np rs = mkClause rs.s copula np.s ; -- did it + de + is I
|
CleftNP np rs = mkClause rs.s copula np.s ; -- did it + de + is I
|
||||||
|
|
||||||
CleftAdv ad s = mkClause (s.s ++ possessive_s) copula ad.s ; -- she sleeps + de + is here
|
CleftAdv ad s = mkClause (linS s ++ possessive_s) copula ad.s ; -- she sleeps + de + is here
|
||||||
|
|
||||||
ExistNP np = mkClause [] (regVerb you_s) np.s ; ---- infl of you
|
ExistNP np = mkClause [] (regVerb you_s) np.s ; ---- infl of you
|
||||||
|
|
||||||
|
|||||||
@@ -193,9 +193,9 @@ oper
|
|||||||
= \s -> lin Subj (ResChi.mkSubj s []) ;
|
= \s -> lin Subj (ResChi.mkSubj s []) ;
|
||||||
mkConj = overload {
|
mkConj = overload {
|
||||||
mkConj : Str -> Conj
|
mkConj : Str -> Conj
|
||||||
= \s -> lin Conj {s = \\_ => mkConjForm s} ;
|
= \s -> lin Conj {s = \\_ => mkConjForm s ; conjType = NotJiu} ;
|
||||||
mkConj : (both,and : Str) -> Conj
|
mkConj : (both,and : Str) -> Conj
|
||||||
= \s,t -> lin Conj {s = \\_ => mkConjForm2 s t} ;
|
= \s,t -> lin Conj {s = \\_ => mkConjForm2 s t ; conjType = NotJiu} ;
|
||||||
} ;
|
} ;
|
||||||
mkpDet : Str -> Det
|
mkpDet : Str -> Det
|
||||||
= \s -> lin Det {s = word s ; detType = DTFull Sg} ;
|
= \s -> lin Det {s = word s ; detType = DTFull Sg} ;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ concrete PhraseChi of Phrase = CatChi ** open Prelude, ResChi in {
|
|||||||
lin
|
lin
|
||||||
PhrUtt pconj utt voc = {s = pconj.s ++ voc.s ++ utt.s} ;
|
PhrUtt pconj utt voc = {s = pconj.s ++ voc.s ++ utt.s} ;
|
||||||
|
|
||||||
UttS s = s ;
|
UttS s = ss (linS s) ;
|
||||||
UttQS qs = ss (qs.s ! True) ;
|
UttQS qs = ss (qs.s ! True) ;
|
||||||
UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p} ;
|
UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p} ;
|
||||||
UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p} ;
|
UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p} ;
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ resource ResChi = ParamX ** open Prelude in {
|
|||||||
param
|
param
|
||||||
Aspect = APlain | APerf | ADurStat | ADurProg | AExper | AFut ; ---- APlain added by AR
|
Aspect = APlain | APerf | ADurStat | ADurProg | AExper | AFut ; ---- APlain added by AR
|
||||||
ConjForm = CPhr CPosType | CSent;
|
ConjForm = CPhr CPosType | CSent;
|
||||||
|
ConjType = Jiu | NotJiu ; -- to put conjunction in the right place in ConjS: "I sleep *and* she walks" vs. "if I sleep, she *then* walks"
|
||||||
CPosType = CAPhrase | CNPhrase | CVPhrase ;
|
CPosType = CAPhrase | CNPhrase | CVPhrase ;
|
||||||
DeForm = DeNoun | NdNoun ; -- parameter created for noun with/out partical "de"
|
DeForm = DeNoun | NdNoun ; -- parameter created for noun with/out partical "de"
|
||||||
|
|
||||||
@@ -169,7 +170,7 @@ oper
|
|||||||
ADurStat => v.s ++ v.ds ;
|
ADurStat => v.s ++ v.ds ;
|
||||||
ADurProg => v.dp ++ v.s ;
|
ADurProg => v.dp ++ v.s ;
|
||||||
AExper => v.s ++ v.ep ;
|
AExper => v.s ++ v.ep ;
|
||||||
AFut => jiu_s ++ hui_s ++ v.s
|
AFut => hui_s ++ v.s
|
||||||
} ;
|
} ;
|
||||||
Neg => table {
|
Neg => table {
|
||||||
APlain => v.neg ++ v.sn ; --- neg?
|
APlain => v.neg ++ v.sn ; --- neg?
|
||||||
@@ -177,7 +178,7 @@ oper
|
|||||||
ADurStat => "不" ++ v.sn ;
|
ADurStat => "不" ++ v.sn ;
|
||||||
ADurProg => v.neg ++ v.dp ++ v.sn ; -- mei or bu
|
ADurProg => v.neg ++ v.dp ++ v.sn ; -- mei or bu
|
||||||
AExper => v.neg ++ v.sn ++ v.ep ;
|
AExper => v.neg ++ v.sn ++ v.ep ;
|
||||||
AFut => jiu_s ++ "不" ++ hui_s ++ v.s
|
AFut => "不" ++ hui_s ++ v.s
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -218,12 +219,22 @@ oper
|
|||||||
|
|
||||||
-- clauses: keep np and vp separate to enable insertion of IAdv
|
-- clauses: keep np and vp separate to enable insertion of IAdv
|
||||||
|
|
||||||
Clause : Type = {
|
Clause : Type = {
|
||||||
s : Polarity => Aspect => Str ;
|
s : Polarity => Aspect => Str ;
|
||||||
np : Str;
|
np : Str ;
|
||||||
vp : VP
|
vp : VP ;
|
||||||
|
postJiu : Polarity => Aspect => Str ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
Sentence : Type = {
|
||||||
|
preJiu, -- everything until the subject
|
||||||
|
postJiu -- everything after the subject
|
||||||
|
: Str
|
||||||
|
} ;
|
||||||
|
|
||||||
|
linS : Sentence -> Str = \s -> s.preJiu ++ s.postJiu ;
|
||||||
|
simpleS : Str -> Sentence = \s -> {preJiu=s ; postJiu=[]} ;
|
||||||
|
|
||||||
|
|
||||||
mkClause = overload {
|
mkClause = overload {
|
||||||
mkClause : Str -> Verb -> Clause = \np,v ->
|
mkClause : Str -> Verb -> Clause = \np,v ->
|
||||||
@@ -240,6 +251,7 @@ oper
|
|||||||
s = \\p,a => vp.topic ++ np ++ vp.prePart ++ useVerb vp.verb ! p ! a ++ vp.compl ++ compl ;
|
s = \\p,a => vp.topic ++ np ++ vp.prePart ++ useVerb vp.verb ! p ! a ++ vp.compl ++ compl ;
|
||||||
np = vp.topic ++ np ;
|
np = vp.topic ++ np ;
|
||||||
vp = insertObj (ss compl) vp ;
|
vp = insertObj (ss compl) vp ;
|
||||||
|
postJiu = \\p,a => vp.prePart ++ useVerb vp.verb ! p ! a ++ vp.compl ++ compl ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
concrete SentenceChi of Sentence = CatChi **
|
concrete SentenceChi of Sentence = CatChi **
|
||||||
open Prelude, ResChi in {
|
open Prelude, ResChi in {
|
||||||
|
|
||||||
flags optimize=all_subs ;
|
flags optimize=all_subs ;
|
||||||
@@ -12,39 +12,55 @@ concrete SentenceChi of Sentence = CatChi **
|
|||||||
ImpVP vp = {
|
ImpVP vp = {
|
||||||
s = table {
|
s = table {
|
||||||
Pos => infVP vp ;
|
Pos => infVP vp ;
|
||||||
Neg => neg_s ++ infVP vp
|
Neg => neg_s ++ infVP vp
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
SlashVP np vp =
|
SlashVP np vp =
|
||||||
mkClauseCompl np.s vp []
|
mkClauseCompl np.s vp []
|
||||||
** {c2 = vp.c2} ;
|
** {c2 = vp.c2} ;
|
||||||
|
|
||||||
SlashVS np vs sslash = <mkClause np.s vs sslash.s : Clause> ** {c2 = sslash.c2} ;
|
SlashVS np vs sslash = <mkClause np.s vs sslash.s : Clause> ** {c2 = sslash.c2} ;
|
||||||
|
|
||||||
|
|
||||||
-- yet another reason for discontinuity of clauses
|
-- yet another reason for discontinuity of clauses
|
||||||
AdvSlash slash adv = slash ** {vp = insertAdv adv slash.vp} ;
|
AdvSlash slash adv = slash ** {vp = insertAdv adv slash.vp} ;
|
||||||
---- parser loops with unknown tokens if this version is used AR 20/4/2014
|
---- parser loops with unknown tokens if this version is used AR 20/4/2014
|
||||||
---- mkClauseCompl slash.np <insertAdv adv slash.vp : VP> []
|
---- mkClauseCompl slash.np <insertAdv adv slash.vp : VP> []
|
||||||
---- ** {c2 = slash.c2} ;
|
---- ** {c2 = slash.c2} ;
|
||||||
|
|
||||||
SlashPrep cl prep = cl ** {c2 = prep} ;
|
SlashPrep cl prep = cl ** {c2 = prep} ;
|
||||||
|
|
||||||
EmbedS s = ss (conjThat ++ s.s) ;
|
EmbedS s = ss (conjThat ++ linS s) ;
|
||||||
EmbedQS qs = ss (qs.s ! False) ;
|
EmbedQS qs = ss (qs.s ! False) ;
|
||||||
EmbedVP vp = ss (infVP vp) ;
|
EmbedVP vp = ss (infVP vp) ;
|
||||||
|
|
||||||
UseCl t p cl = {s = t.s ++ p.s ++ cl.s ! p.p ! t.t} ;
|
UseCl t p cl = {
|
||||||
UseQCl t p cl = {s = \\isDir => t.s ++ p.s ++ cl.s ! isDir ! p.p ! t.t} ;
|
preJiu = cl.np ;
|
||||||
UseRCl t p cl = {s = t.s ++ p.s ++ cl.s ! p.p ! t.t} ;
|
postJiu = t.s ++ p.s ++ cl.postJiu ! p.p ! t.t} ;
|
||||||
|
|
||||||
|
UseQCl t p cl = {s = \\isDir => t.s ++ p.s ++ cl.s ! isDir ! p.p ! t.t} ;
|
||||||
|
UseRCl t p cl = {s = t.s ++ p.s ++ cl.s ! p.p ! t.t} ;
|
||||||
UseSlash t p cl = {s = t.s ++ p.s ++ cl.s ! p.p ! t.t ; c2 = cl.c2} ;
|
UseSlash t p cl = {s = t.s ++ p.s ++ cl.s ! p.p ! t.t ; c2 = cl.c2} ;
|
||||||
|
|
||||||
AdvS a s = ss (a.s ++ s.s) ;
|
AdvS a s = s ** {
|
||||||
ExtAdvS a s = ss (a.s ++ chcomma ++ s.s) ;
|
preJiu = a.s ++ s.preJiu -- tomorrow she
|
||||||
|
} ;
|
||||||
|
|
||||||
RelS s r = ss (s.s ++ r.s) ;
|
ExtAdvS a s = s ** {
|
||||||
|
preJiu = a.s ++ chcomma ++ s.preJiu -- tomorrow, she
|
||||||
|
} ;
|
||||||
|
|
||||||
SSubjS a subj b = ss (a.s ++ subj.prePart ++ b.s ++ subj.sufPart) ;
|
RelS s r = s ** {
|
||||||
|
postJiu = s.postJiu ++ r.s ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- a="she walks", b="I die"
|
||||||
|
-- result: preJiu="if she walks, I", postJiu="die"
|
||||||
|
SSubjS a subj b = {
|
||||||
|
preJiu = linS a ++ subj.prePart -- if she walks,
|
||||||
|
++ b.preJiu ; -- I
|
||||||
|
postJiu = b.postJiu ++ subj.sufPart -- die
|
||||||
|
} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ concrete StructuralChi of Structural = CatChi **
|
|||||||
|
|
||||||
lin
|
lin
|
||||||
every_Det = mkDet "每" Sg ;
|
every_Det = mkDet "每" Sg ;
|
||||||
|
|
||||||
this_Quant = mkQuant "这" ;
|
this_Quant = mkQuant "这" ;
|
||||||
that_Quant = mkQuant "那" ;
|
that_Quant = mkQuant "那" ;
|
||||||
|
|
||||||
@@ -25,18 +25,20 @@ lin
|
|||||||
possess_Prep = mkPrep [] "的" ATPoss ;
|
possess_Prep = mkPrep [] "的" ATPoss ;
|
||||||
with_Prep = mkPrep "和" "一起" (ATPlace True) ; -- "with you"
|
with_Prep = mkPrep "和" "一起" (ATPlace True) ; -- "with you"
|
||||||
---- with_Prep = mkPrep "和" [] ; -- "with bread"
|
---- with_Prep = mkPrep "和" [] ; -- "with bread"
|
||||||
|
|
||||||
and_Conj = {s = table {
|
and_Conj = {s = table {
|
||||||
CPhr CNPhrase => mkConjForm "和" ;
|
CPhr CNPhrase => mkConjForm "和" ;
|
||||||
CPhr CAPhrase => mkConjForm "而" ;
|
CPhr CAPhrase => mkConjForm "而" ;
|
||||||
CPhr CVPhrase => mkConjForm "又" ;
|
CPhr CVPhrase => mkConjForm "又" ;
|
||||||
CSent => mkConjForm "并且" --modified by chenpneg 11.19
|
CSent => mkConjForm "而" --modified by chenpneg 11.19
|
||||||
}
|
} ;
|
||||||
|
conjType = NotJiu ;
|
||||||
} ;
|
} ;
|
||||||
or_Conj = {s = table {
|
or_Conj = {s = table {
|
||||||
CPhr _ => mkConjForm "或" ;
|
CPhr _ => mkConjForm "或" ;
|
||||||
CSent => mkConjForm "还是"
|
CSent => mkConjForm "还是"
|
||||||
}
|
} ;
|
||||||
|
conjType = NotJiu ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
although_Subj = mkSubj "虽然" "但";
|
although_Subj = mkSubj "虽然" "但";
|
||||||
@@ -116,13 +118,14 @@ as_CAdv = {s = word "和" ; p = word "一样" } ; -- modified by chenpeng 11.24
|
|||||||
at_least_AdN = ssword "最少" ; -- at least five
|
at_least_AdN = ssword "最少" ; -- at least five
|
||||||
at_most_AdN = ssword "最多" ;
|
at_most_AdN = ssword "最多" ;
|
||||||
behind_Prep = mkPrep "在" "后面" ;
|
behind_Prep = mkPrep "在" "后面" ;
|
||||||
|
|
||||||
both7and_DConj = {s = table { -- modified by chenpeng 11.19
|
both7and_DConj = {s = table { -- modified by chenpeng 11.19
|
||||||
CPhr CNPhrase => mkConjForm2 "包括" "和" ;
|
CPhr CNPhrase => mkConjForm2 "包括" "和" ;
|
||||||
CPhr CAPhrase => mkConjForm2 "即" "又" ;
|
CPhr CAPhrase => mkConjForm2 "即" "又" ;
|
||||||
CPhr CVPhrase => mkConjForm2 "不但" "而且" ;
|
CPhr CVPhrase => mkConjForm2 "不但" "而且" ;
|
||||||
CSent => mkConjForm2 "不但" "而且"
|
CSent => mkConjForm2 "不但" "而且"
|
||||||
}
|
} ;
|
||||||
|
conjType = NotJiu ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
by8agent_Prep = mkPrep "被" [] mannerAdvType; -- by for agent in passive
|
by8agent_Prep = mkPrep "被" [] mannerAdvType; -- by for agent in passive
|
||||||
@@ -135,7 +138,8 @@ either7or_DConj = {s = table { -- modified by chenpeng 11.19
|
|||||||
CPhr CAPhrase => mkConjForm2 "要么" "要么" ;
|
CPhr CAPhrase => mkConjForm2 "要么" "要么" ;
|
||||||
CPhr CVPhrase => mkConjForm2 "要么" "要么" ;
|
CPhr CVPhrase => mkConjForm2 "要么" "要么" ;
|
||||||
CSent => mkConjForm2 "要么" "要么"
|
CSent => mkConjForm2 "要么" "要么"
|
||||||
}
|
} ;
|
||||||
|
conjType = NotJiu ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
everybody_NP = ssword "每个人" ; -- [mark] "每个人": 每(every)+个(classifier)+人(person)
|
everybody_NP = ssword "每个人" ; -- [mark] "每个人": 每(every)+个(classifier)+人(person)
|
||||||
@@ -152,11 +156,10 @@ less_CAdv = {s = than_s ; p = word "没更"} ; -- modified by chenpeng 11.24
|
|||||||
more_CAdv = {s = than_s ; p = word "更"} ; -- modified by chenpeng 11.24
|
more_CAdv = {s = than_s ; p = word "更"} ; -- modified by chenpeng 11.24
|
||||||
most_Predet = ssword "大多数" ;
|
most_Predet = ssword "大多数" ;
|
||||||
if_then_Conj = {s = table { -- added by chenpeng 11.19
|
if_then_Conj = {s = table { -- added by chenpeng 11.19
|
||||||
CPhr CNPhrase => mkConjForm [] ;
|
CSent => mkConjForm2 "如果" "就" ; -- if she walks, I then sleep
|
||||||
CPhr CAPhrase => mkConjForm [] ;
|
CPhr _ => mkConjForm2 "如果" "那么" -- if fish , then rice
|
||||||
CPhr CVPhrase => mkConjForm [] ;
|
} ;
|
||||||
CSent => mkConjForm2 "如果" "那么"
|
conjType = Jiu ;
|
||||||
}
|
|
||||||
} ;
|
} ;
|
||||||
nobody_NP = ssword "没人" ;
|
nobody_NP = ssword "没人" ;
|
||||||
nothing_NP = ssword "没有什么" ;
|
nothing_NP = ssword "没有什么" ;
|
||||||
@@ -171,7 +174,7 @@ there7from_Adv = mkAdv "从那里" ; -- from there
|
|||||||
there7to_Adv = mkAdv "到那里" ;
|
there7to_Adv = mkAdv "到那里" ;
|
||||||
therefore_PConj = ssword "因此" ;
|
therefore_PConj = ssword "因此" ;
|
||||||
through_Prep = mkPrep "通过" ;
|
through_Prep = mkPrep "通过" ;
|
||||||
which_IQuant = mkIQuant "哪" ; --
|
which_IQuant = mkIQuant "哪" ; --
|
||||||
--which_IQuant = ssword [] ; -- [mark] in sent, it depends on the context
|
--which_IQuant = ssword [] ; -- [mark] in sent, it depends on the context
|
||||||
without_Prep = mkPrep "没有" [] mannerAdvType ;
|
without_Prep = mkPrep "没有" [] mannerAdvType ;
|
||||||
youPol_Pron = ssword "您" ; -- polite you
|
youPol_Pron = ssword "您" ; -- polite you
|
||||||
|
|||||||
@@ -13,17 +13,17 @@ concrete SymbolChi of Symbol = CatChi ** open Prelude, ResChi in {
|
|||||||
s = cn.s ++ i.s ;
|
s = cn.s ++ i.s ;
|
||||||
c = cn.c
|
c = cn.c
|
||||||
} ;
|
} ;
|
||||||
CNSymbNP det cn xs = ss (det.s ++ cn.s ++ xs.s) ; ----
|
CNSymbNP det cn xs = ss (det.s ++ cn.s ++ xs.s) ; ----
|
||||||
CNNumNP cn i = {
|
CNNumNP cn i = {
|
||||||
s = cn.s ++ i.s ;
|
s = cn.s ++ i.s ;
|
||||||
c = cn.c
|
c = cn.c
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
SymbS sy = sy ;
|
SymbS sy = simpleS sy.s ;
|
||||||
SymbNum sy = sy ;
|
SymbNum sy = sy ;
|
||||||
SymbOrd sy = sy ;
|
SymbOrd sy = sy ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
|
|
||||||
Symb, [Symb] = SS ;
|
Symb, [Symb] = SS ;
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ concrete VerbChi of Verb = CatChi ** open ResChi, Prelude in {
|
|||||||
SlashV2A v ap = insertObj {s = ap.s ! Pred} (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
SlashV2A v ap = insertObj {s = ap.s ! Pred} (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
||||||
|
|
||||||
SlashV2V v vp = insertObj (mkNP (infVP vp)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
SlashV2V v vp = insertObj (mkNP (infVP vp)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
||||||
SlashV2S v s = insertObj (ss (say_s ++ s.s)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
SlashV2S v s = insertObj (ss (say_s ++ linS s)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
||||||
SlashV2Q v q = insertObj (ss (say_s ++ q.s ! False)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
SlashV2Q v q = insertObj (ss (say_s ++ q.s ! False)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
||||||
|
|
||||||
ComplVV v vp = {
|
ComplVV v vp = {
|
||||||
@@ -23,7 +23,7 @@ concrete VerbChi of Verb = CatChi ** open ResChi, Prelude in {
|
|||||||
isAdj = False ;
|
isAdj = False ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ComplVS v s = insertObj s (predV v []) ;
|
ComplVS v s = insertObj (ss (linS s)) (predV v []) ;
|
||||||
ComplVQ v q = insertObj (ss (q.s ! False)) (predV v []) ;
|
ComplVQ v q = insertObj (ss (q.s ! False)) (predV v []) ;
|
||||||
ComplVA v ap = insertObj {s = ap.s ! Pred} (predV v []) ;
|
ComplVA v ap = insertObj {s = ap.s ! Pred} (predV v []) ;
|
||||||
|
|
||||||
|
|||||||
@@ -1,27 +1,41 @@
|
|||||||
Lang: ConjS if_then_Conj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V))) (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron she_Pron) (UseV walk_V))))
|
-- Basic conjunctions, no jiu
|
||||||
LangChi: 如 果 我 睡 觉 那 么 她 就 会 走
|
Lang: ConjS and_Conj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V))) (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron she_Pron) (UseV walk_V))))
|
||||||
LangEng: if I sleep then she walks
|
LangChi: 我 睡 觉 而 她 走
|
||||||
|
LangEng: I sleep and she walks
|
||||||
|
|
||||||
Lang: ConjS if_then_Conj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V))) (UseCl (TTAnt TFut ASimul) PPos (PredVP (UsePron she_Pron) (UseV walk_V))))
|
Lang: ConjS or_Conj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV go_V))) (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron she_Pron) (UseV go_V))))
|
||||||
LangChi: 如 果 我 睡 觉 那 么 她 将 会 走
|
LangChi: 我 去 还 是 她 去
|
||||||
LangEng: if I sleep then she will walk
|
LangEng: I go or she goes
|
||||||
|
|
||||||
|
Lang: ConjS either7or_DConj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV go_V))) (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron she_Pron) (UseV go_V))))
|
||||||
|
LangChi: 要 么 我 去 要 么 她 去
|
||||||
|
LangEng: either I go or she goes
|
||||||
|
|
||||||
|
-- If-then in different tenses
|
||||||
Lang: ConjS if_then_Conj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V))) (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron she_Pron) (UseV die_V))))
|
Lang: ConjS if_then_Conj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V))) (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron she_Pron) (UseV die_V))))
|
||||||
LangChi: 如 果 我 睡 觉 那 么 她 死
|
LangChi: 如 果 我 睡 觉 , 她 就 死
|
||||||
LangEng: if I sleep then she dies
|
LangEng: if I sleep then she dies
|
||||||
|
|
||||||
Lang: ConjS if_then_Conj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V))) (UseCl (TTAnt TFut ASimul) PPos (PredVP (UsePron she_Pron) (UseV die_V))))
|
Lang: ConjS if_then_Conj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V))) (UseCl (TTAnt TFut ASimul) PPos (PredVP (UsePron she_Pron) (UseV die_V))))
|
||||||
LangChi: 如 果 我 睡 觉 那 么 她 将 会 死
|
LangChi: 如 果 我 睡 觉 , 她 就 会 死
|
||||||
LangEng: if I sleep then she will die
|
LangEng: if I sleep then she will die
|
||||||
|
|
||||||
|
-- contrast: if_Subj, not if_then_Conj
|
||||||
|
Lang: ExtAdvS (SubjS if_Subj (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V)))) (UseCl (TTAnt TFut ASimul) PPos (PredVP (UsePron she_Pron) (UseV die_V)))
|
||||||
|
LangChi: 如 果 我 睡 觉 , 她 会 死
|
||||||
|
LangEng: if I sleep , she will die
|
||||||
|
|
||||||
|
-- back to if_then_Conj, now with negations
|
||||||
Lang: ConjS if_then_Conj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V))) (UseCl (TTAnt TPres ASimul) PNeg (PredVP (UsePron she_Pron) (UseV die_V))))
|
Lang: ConjS if_then_Conj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V))) (UseCl (TTAnt TPres ASimul) PNeg (PredVP (UsePron she_Pron) (UseV die_V))))
|
||||||
LangChi: 如 果 我 睡 觉 那 么 她 不 死
|
LangChi: 如 果 我 睡 觉 , 她 就 不 死
|
||||||
LangEng: if I sleep then she doesn't die
|
LangEng: if I sleep then she doesn't die
|
||||||
|
|
||||||
Lang: ConjS if_then_Conj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V))) (UseCl (TTAnt TFut ASimul) PNeg (PredVP (UsePron she_Pron) (UseV die_V))))
|
Lang: ConjS if_then_Conj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V))) (UseCl (TTAnt TFut ASimul) PNeg (PredVP (UsePron she_Pron) (UseV die_V))))
|
||||||
LangChi: 如 果 我 睡 觉 那 么 她 将 不 会 死
|
LangChi: 如 果 我 睡 觉 , 她 就 不 会 死
|
||||||
LangEng: if I sleep then she won't die
|
LangEng: if I sleep then she won't die
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- NP conjunctions
|
-- NP conjunctions
|
||||||
Lang: ConjNP or_Conj (BaseNP (MassNP (UseN fish_N)) (MassNP (UseN beer_N)))
|
Lang: ConjNP or_Conj (BaseNP (MassNP (UseN fish_N)) (MassNP (UseN beer_N)))
|
||||||
LangChi: 鱼 或 啤 酒
|
LangChi: 鱼 或 啤 酒
|
||||||
@@ -29,5 +43,5 @@ LangEng: fish or beer
|
|||||||
|
|
||||||
--NB: unnatural non-empty strings just for testing purpose
|
--NB: unnatural non-empty strings just for testing purpose
|
||||||
Lang: ConjNP if_then_Conj (BaseNP (MassNP (UseN fish_N)) (MassNP (UseN beer_N)))
|
Lang: ConjNP if_then_Conj (BaseNP (MassNP (UseN fish_N)) (MassNP (UseN beer_N)))
|
||||||
LangChi: 鱼 啤 酒
|
LangChi: 如 果 鱼 那 么 啤 酒
|
||||||
LangEng: if fish then beer
|
LangEng: if fish then beer
|
||||||
32
src/chinese/unittest/future.gftest
Normal file
32
src/chinese/unittest/future.gftest
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
Lang: UseCl (TTAnt TFut ASimul) PPos (PredVP (UsePron i_Pron) (UseV die_V))
|
||||||
|
LangChi: 我 就 会 死
|
||||||
|
LangEng: I will die
|
||||||
|
|
||||||
|
Lang: ExtAdvS (SubjS if_Subj (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V)))) (UseCl (TTAnt TFut ASimul) PPos (PredVP (UsePron she_Pron) (UseV walk_V)))
|
||||||
|
LangChi: 如 果 我 睡 觉 , 她 会 走
|
||||||
|
LangEng: if I sleep , she will walk
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ProgrVP (UseV die_V)))
|
||||||
|
LangChi: 我 在 死
|
||||||
|
LangEng: I am dying
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TFut ASimul) PNeg (PredVP (UsePron i_Pron) (UseV die_V))
|
||||||
|
LangChi: 我 就 不 会 死
|
||||||
|
LangEng: I won't die
|
||||||
|
|
||||||
|
Lang: UseQCl (TTAnt TFut ASimul) PPos (QuestCl (PredVP (UsePron i_Pron) (UseV die_V)))
|
||||||
|
-- LangChi: 我 会 不 会 死
|
||||||
|
LangChi: 我 会 死 吗
|
||||||
|
LangEng: will I die
|
||||||
|
|
||||||
|
Lang: UseQCl (TTAnt TFut ASimul) PNeg (QuestCl (PredVP (UsePron i_Pron) (UseV die_V)))
|
||||||
|
LangChi: 我 不 会 死 吗
|
||||||
|
LangEng: won't I die
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (UsePron i_Pron) (ComplVQ know_VQ (UseQCl (TTAnt TFut ASimul) PPos (QuestCl (PredVP (UsePron i_Pron) (UseV die_V))))))
|
||||||
|
LangChi: 我 不 知 道 我 会 不 会 死
|
||||||
|
LangEng: I don't know if I will die
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (UsePron i_Pron) (ComplVQ know_VQ (UseQCl (TTAnt TFut ASimul) PNeg (QuestCl (PredVP (UsePron i_Pron) (UseV die_V))))))
|
||||||
|
LangChi: 我 不 知 道 我 不 会 死
|
||||||
|
LangEng: I don't know if I won't die
|
||||||
Reference in New Issue
Block a user