forked from GitHub/gf-rgl
(Ger) small fix to make reimplementation of infinitives compile for 'present'
new SlashVP, RelSlash in tests/german/TestLangGer to control reflexives in relative clauses
This commit is contained in:
266
src/Lang.labels
266
src/Lang.labels
@@ -1,157 +1,157 @@
|
||||
PredVP nsubj head
|
||||
PredVPS nsubj head
|
||||
DirectComplVQ empty nsubj head ccomp -- Temp argument can only be empty in English
|
||||
DirectComplVS empty nsubj head ccomp -- Temp argument can only be empty in English
|
||||
SlashVP nsubj head
|
||||
SlashVS nsubj head ccomp
|
||||
FocusObjS nsubj head -- again might be wrong; more correct to call it dobj
|
||||
QuestIAdv advmod head -- "where does John sleep" cf. AdvVP
|
||||
QuestIComp head nsubj -- "where is John": John is clearly nsubj, but is where the head?
|
||||
QuestQVP nsubj head
|
||||
QuestSlash obj head
|
||||
QuestVP nsubj head
|
||||
PredVP nsubj head
|
||||
PredVPS nsubj head
|
||||
DirectComplVQ empty nsubj head ccomp -- Temp argument can only be empty in English
|
||||
DirectComplVS empty nsubj head ccomp -- Temp argument can only be empty in English
|
||||
SlashVP nsubj head
|
||||
SlashVS nsubj head ccomp
|
||||
FocusObjS nsubj head -- again might be wrong; more correct to call it obj
|
||||
QuestIAdv advmod head -- "where does John sleep" cf. AdvVP
|
||||
QuestIComp head nsubj -- "where is John": John is clearly nsubj, but is where the head?
|
||||
QuestQVP nsubj head
|
||||
QuestSlash obj head
|
||||
QuestVP nsubj head
|
||||
IdetCN det head
|
||||
|
||||
PredSCVP csubj head
|
||||
PredSCVP csubj head
|
||||
|
||||
ComplSlash head obj
|
||||
ComplSlashIP head obj
|
||||
Slash3V3 head obj
|
||||
SlashV2VNP head obj xcomp
|
||||
PastPartAgentAP head obj
|
||||
AdvQVP head obj
|
||||
ComplSlash head obj
|
||||
ComplSlashIP head obj
|
||||
Slash3V3 head obj
|
||||
SlashV2VNP head obj xcomp
|
||||
PastPartAgentAP head obj
|
||||
AdvQVP head obj
|
||||
|
||||
Slash2V3 head iobj
|
||||
Slash2V3 head iobj
|
||||
|
||||
ComplVS head ccomp
|
||||
ComplVQ head ccomp
|
||||
SlashV2S head ccomp
|
||||
SlashV2Q head ccomp
|
||||
CleftAdv head advcl -- not sure
|
||||
ComplVS head ccomp
|
||||
ComplVQ head ccomp
|
||||
SlashV2S head ccomp
|
||||
SlashV2Q head ccomp
|
||||
CleftAdv head advcl -- not sure
|
||||
|
||||
ComplVA head xcomp
|
||||
ComplVV head xcomp
|
||||
SlashVV head acl
|
||||
SlashV2A head xcomp
|
||||
SlashV2V head xcomp
|
||||
ComplVA head xcomp
|
||||
ComplVV head xcomp
|
||||
SlashVV head acl
|
||||
SlashV2A head xcomp
|
||||
SlashV2V head xcomp
|
||||
|
||||
AdvNP head nmod -- not sure
|
||||
ExtAdvNP head nmod -- not sure
|
||||
PassAgentVPSlash head nmod -- not sure
|
||||
CleftNP head acl -- this cannot be nmod, not with type RS
|
||||
AdvNP head nmod -- not sure
|
||||
ExtAdvNP head nmod -- not sure
|
||||
PassAgentVPSlash head nmod -- not sure
|
||||
CleftNP head acl -- this cannot be nmod, not with type RS
|
||||
|
||||
SSubjS head mark advcl
|
||||
RelS head advcl
|
||||
SSubjS head mark advcl
|
||||
RelS head advcl
|
||||
|
||||
AdNum advmod head
|
||||
AdAP advmod head
|
||||
AdvAP head advmod
|
||||
ComparAdvAdj advmod amod head
|
||||
ComparAdvAdjS advmod amod head
|
||||
AdvIAdv advmod head
|
||||
AdVVP advmod head
|
||||
AdvVP head advmod
|
||||
ExtAdvVP head advmod
|
||||
AddAdvQVP head advmod
|
||||
AdVVPSlash advmod head
|
||||
AdvVPSlash head advmod
|
||||
AdvSlash head advmod
|
||||
ExistIPAdv head advmod
|
||||
AdvS advmod head
|
||||
ExtAdvS advmod head
|
||||
AdNum advmod head
|
||||
AdAP advmod head
|
||||
AdvAP head advmod
|
||||
ComparAdvAdj advmod amod head
|
||||
ComparAdvAdjS advmod amod head
|
||||
AdvIAdv advmod head
|
||||
AdVVP advmod head
|
||||
AdvVP head advmod
|
||||
ExtAdvVP head advmod
|
||||
AddAdvQVP head advmod
|
||||
AdVVPSlash advmod head
|
||||
AdvVPSlash head advmod
|
||||
AdvSlash head advmod
|
||||
ExistIPAdv head advmod
|
||||
AdvS advmod head
|
||||
ExtAdvS advmod head
|
||||
|
||||
SubjS mark head
|
||||
RelVP mark head
|
||||
RelSlash mark head
|
||||
SubjS mark head
|
||||
RelVP mark head
|
||||
RelSlash mark head
|
||||
|
||||
ComplN2 head nmod
|
||||
ComplN3 nmod head
|
||||
AdvCN head nmod
|
||||
PossNP head nmod
|
||||
PartNP head nmod
|
||||
ExistNPAdv head nmod
|
||||
ComplN2 head nmod
|
||||
ComplN3 nmod head
|
||||
AdvCN head nmod
|
||||
PossNP head nmod
|
||||
PartNP head nmod
|
||||
ExistNPAdv head nmod
|
||||
|
||||
OrdNumeralSuperl nummod head -- quite wrong; cannot find relevant details in the documentation; but most probably head lies outside the score of this function
|
||||
DetQuant head nummod -- quite wrong; I think the head lies outside the scope of the function
|
||||
CNNumNP head nummod
|
||||
OrdNumeralSuperl nummod head -- quite wrong; cannot find relevant details in the documentation; but most probably head lies outside the score of this function
|
||||
DetQuant head nummod -- quite wrong; I think the head lies outside the scope of the function
|
||||
CNNumNP head nummod
|
||||
|
||||
ApposCN head appos
|
||||
ApposNP head appos
|
||||
ApposCN head appos
|
||||
ApposNP head appos
|
||||
|
||||
RelNP head acl
|
||||
RelCN head acl
|
||||
SentCN head acl
|
||||
SentAP head acl
|
||||
RelNP head acl
|
||||
RelCN head acl
|
||||
SentCN head acl
|
||||
SentAP head acl
|
||||
|
||||
DetQuantOrd head nummod amod -- quite wrong; again for same reason as DetQuant function
|
||||
DetCN det head
|
||||
IdetCN det head
|
||||
DetQuantOrd head nummod amod -- quite wrong; again for same reason as DetQuant function
|
||||
DetCN det head
|
||||
IdetCN det head
|
||||
IdetQuant head nummod
|
||||
CountNP det head
|
||||
PredetNP det head
|
||||
CountNP det head
|
||||
PredetNP det head
|
||||
PPartNP head amod -- only in core RGL
|
||||
|
||||
AdjCN amod head
|
||||
AdjDAP head amod
|
||||
CAdvAP case amod head
|
||||
ComparA amod head
|
||||
ComplA2 amod head
|
||||
CompoundAP head amod
|
||||
AdAdV amod head
|
||||
AdAdv amod head
|
||||
AdjCN amod head
|
||||
AdjDAP head amod
|
||||
CAdvAP case amod head
|
||||
ComparA amod head
|
||||
ComplA2 amod head
|
||||
CompoundAP head amod
|
||||
AdAdV amod head
|
||||
AdAdv amod head
|
||||
|
||||
CompoundN compound head
|
||||
CompoundN compound head
|
||||
|
||||
IIDig head goeswith
|
||||
IIDig head goeswith
|
||||
|
||||
PrepNP case head
|
||||
PrepIP case head
|
||||
SlashPrep head case
|
||||
VPSlashPrep head case
|
||||
PrepNP case head
|
||||
PrepIP case head
|
||||
SlashPrep head case
|
||||
VPSlashPrep head case
|
||||
|
||||
UttImpPl empty head
|
||||
UttImpPol empty head
|
||||
UttImpSg empty head
|
||||
UttImpPl empty head
|
||||
UttImpPol empty head
|
||||
UttImpSg empty head
|
||||
|
||||
MkVPS empty empty head
|
||||
MkVPS empty empty head
|
||||
|
||||
UseCl empty empty head
|
||||
UseQCl empty empty head
|
||||
UseRCl empty empty head
|
||||
UseSlash empty empty head
|
||||
UseVC empty empty head
|
||||
UseCl empty empty head
|
||||
UseQCl empty empty head
|
||||
UseRCl empty empty head
|
||||
UseSlash empty empty head
|
||||
UseVC empty empty head
|
||||
|
||||
BaseAP head conj
|
||||
BaseAdV head conj
|
||||
BaseAdv head conj
|
||||
BaseCN head conj
|
||||
BaseDAP head conj
|
||||
BaseIAdv head conj
|
||||
BaseNP head conj
|
||||
BaseRS head conj
|
||||
BaseS head conj
|
||||
ConsAP head conj
|
||||
ConsAdV head conj
|
||||
ConsAdv head conj
|
||||
ConsCN head conj
|
||||
ConsDAP head conj
|
||||
ConsIAdv head conj
|
||||
ConsNP head conj
|
||||
ConsRS head conj
|
||||
ConsS head conj
|
||||
ConjAP cc head
|
||||
ConjAdV cc head
|
||||
ConjAdv cc head
|
||||
ConjCN cc head
|
||||
ConjDet cc head
|
||||
ConjIAdv cc head
|
||||
ConjNP cc head
|
||||
ConjRS cc head
|
||||
ConjS cc head
|
||||
PhrUtt cc head discourse
|
||||
BaseAP head conj
|
||||
BaseAdV head conj
|
||||
BaseAdv head conj
|
||||
BaseCN head conj
|
||||
BaseDAP head conj
|
||||
BaseIAdv head conj
|
||||
BaseNP head conj
|
||||
BaseRS head conj
|
||||
BaseS head conj
|
||||
ConsAP head conj
|
||||
ConsAdV head conj
|
||||
ConsAdv head conj
|
||||
ConsCN head conj
|
||||
ConsDAP head conj
|
||||
ConsIAdv head conj
|
||||
ConsNP head conj
|
||||
ConsRS head conj
|
||||
ConsS head conj
|
||||
ConjAP cc head
|
||||
ConjAdV cc head
|
||||
ConjAdv cc head
|
||||
ConjCN cc head
|
||||
ConjDet cc head
|
||||
ConjIAdv cc head
|
||||
ConjNP cc head
|
||||
ConjRS cc head
|
||||
ConjS cc head
|
||||
PhrUtt cc head discourse
|
||||
|
||||
PlusChunk head dep
|
||||
TTAnt empty empty head
|
||||
PlusChunk head dep
|
||||
TTAnt empty empty head
|
||||
|
||||
TExclMark head dep -- punctuation in the middle in these three
|
||||
TFullStop head dep
|
||||
@@ -159,7 +159,7 @@ TQuestMark head dep
|
||||
|
||||
ComplV2 head obj -- shortcuts in App
|
||||
ComplV2V head obj xcomp
|
||||
ComplV3 head iobj obj ---- could be dobj dobj
|
||||
ComplV3 head iobj obj ---- could be obj obj
|
||||
PassAgentV2 head ncomp -- not sure
|
||||
RelV2 mark nsubj head
|
||||
QuestV2 obj nsubj head
|
||||
@@ -181,7 +181,7 @@ AdV ADV
|
||||
Adv ADV
|
||||
CAdv ADV
|
||||
Card NUM
|
||||
Conj CONJ
|
||||
Conj CCONJ
|
||||
Det DET
|
||||
Digits NUM
|
||||
IAdv ADV
|
||||
@@ -194,7 +194,7 @@ N2 NOUN
|
||||
N3 NOUN
|
||||
Numeral NUM
|
||||
Ord NUM
|
||||
PConj CONJ
|
||||
PConj CCONJ
|
||||
PN PROPN
|
||||
Predet DET
|
||||
Prep ADP
|
||||
@@ -214,7 +214,3 @@ VA VERB
|
||||
VQ VERB
|
||||
VS VERB
|
||||
VV VERB
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,26 +4,58 @@ concrete AdjectiveChi of Adjective = CatChi ** open ResChi, Prelude in {
|
||||
|
||||
PositA a = a ** {hasAdA = False} ;
|
||||
|
||||
--ComparA a np = complexAP (a.s ++ than_s ++ np.s) ;
|
||||
ComparA a np = complexAP (than_s ++ np.s ++ a.s) ;
|
||||
ComparA a np = a ** {
|
||||
s = table {_=> than_s ++ np.s ++ a.s!Attr};
|
||||
hasAdA = False
|
||||
|
||||
UseComparA a = complexAP (geng_s ++ a.s) ;
|
||||
};
|
||||
|
||||
AdjOrd ord = complexAP ord.s ;
|
||||
UseComparA a = a ** {
|
||||
s = table { _=> geng_s ++ a.s!Attr};
|
||||
hasAdA = False
|
||||
};
|
||||
|
||||
-- CAdvAP ad ap np = complexAP (ap.s ++ ad.s ++ ad.p ++ np.s) ;
|
||||
CAdvAP ad ap np = complexAP (ad.s++ np.s++ad.p++ap.s ) ; --modified by ChenPeng 11.24
|
||||
AdjOrd ord = ord ** {
|
||||
s = table {
|
||||
adjPlace => ord.s
|
||||
-- Attr => ord.s; --"first is he" ;
|
||||
-- Pred => ord.s --"he is first"
|
||||
} ;
|
||||
hasAdA = False;
|
||||
monoSyl = True -- to do and figure out in relation to Ord = {s : Str}
|
||||
};
|
||||
|
||||
ComplA2 a np = complexAP (appPrep a.c2 np.s ++ a.s) ;
|
||||
CAdvAP ad ap np = ap ** {
|
||||
s = table {adjPlace => ad.s ++ np.s ++ ad.p ++ ap.s!adjPlace}
|
||||
};
|
||||
|
||||
ReflA2 a = complexAP (a.s ++ appPrep a.c2 reflPron) ;
|
||||
ComplA2 a np = a ** {
|
||||
s= table { adjPlace => appPrep a.c2 np.s ++ a.s!adjPlace};
|
||||
hasAdA = False
|
||||
};
|
||||
|
||||
SentAP ap sc = complexAP (ap.s ++ sc.s) ;
|
||||
|
||||
AdAP ada ap = {s = ada.s ++ ap.s ; monoSyl = False ; hasAdA = True} ;
|
||||
ReflA2 a = a ** {
|
||||
s = table {adjPlace => a.s!adjPlace ++ appPrep a.c2 reflPron};
|
||||
hasAdA = False
|
||||
};
|
||||
|
||||
|
||||
SentAP ap sc = ap ** {
|
||||
s = table { adjPlace => ap.s ! adjPlace ++ sc.s }
|
||||
} ;
|
||||
|
||||
-- AdAP ada ap = {s = ada.s ++ ap.s ; monoSyl = False ; hasAdA = True} ;
|
||||
AdAP ada ap = ap ** {
|
||||
s = table { adjPlace => ada.s ++ ap.s ! adjPlace };
|
||||
monoSyl = False;
|
||||
hasAdA = True
|
||||
};
|
||||
|
||||
UseA2 a = a ** {hasAdA = False} ;
|
||||
|
||||
AdvAP ap adv = complexAP (adv.s ++ ap.s) ; ----
|
||||
AdvAP ap adv = ap ** {
|
||||
s = table { adjPlace => adv.s ++ ap.s ! adjPlace }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -2,20 +2,20 @@ concrete AdverbChi of Adverb = CatChi **
|
||||
open ResChi, Prelude in {
|
||||
|
||||
lin
|
||||
PositAdvAdj a = {s = a.s ++ "地" ; advType = ATManner ; hasDe = False} ; ---- for all adjs?
|
||||
PositAdvAdj a = {s = a.s!Attr ++ "地" ; advType = ATManner ; hasDe = False} ; ---- for all adjs?
|
||||
|
||||
PrepNP prep np = ss (appPrep prep np.s) ** {advType = prep.advType ; hasDe = prep.hasDe} ; --- should depend on np too ?
|
||||
|
||||
ComparAdvAdj cadv a np = ss (a.s ++ 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 ++ 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} ;
|
||||
|
||||
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} ; -----
|
||||
|
||||
PositAdAAdj a = {s = a.s} ; ----
|
||||
PositAdAAdj a = {s = a.s!Attr} ; ----
|
||||
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ concrete CatChi of Cat = CommonX - [Tense, Temp, Ant, Adv] ** open ResChi, Prelu
|
||||
|
||||
-- Tensed/Untensed
|
||||
|
||||
S = {s : Str} ;
|
||||
S = Sentence ;
|
||||
QS = {s : Bool => Str} ; -- True = direct question (with ma for sentential questions)
|
||||
RS = {s : Str} ;
|
||||
SSlash = {s : Str ; c2 : Preposition} ;
|
||||
@@ -59,7 +59,10 @@ concrete CatChi of Cat = CommonX - [Tense, Temp, Ant, Adv] ** open ResChi, Prelu
|
||||
|
||||
-- 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} ;
|
||||
Prep = Preposition ;
|
||||
|
||||
@@ -84,4 +87,6 @@ concrete CatChi of Cat = CommonX - [Tense, Temp, Ant, Adv] ** open ResChi, Prelu
|
||||
Tense = {s : Str ; t : Aspect} ;
|
||||
Ant = {s : Str ; t : Aspect} ;
|
||||
|
||||
linref
|
||||
S = linS ;
|
||||
}
|
||||
|
||||
@@ -2,33 +2,47 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin
|
||||
|
||||
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} ; ---- ??
|
||||
ConjNP c = conjunctDistrSS (c.s ! CPhr CNPhrase) ;
|
||||
ConjAP c as = conjunctDistrSS (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
|
||||
ConjRS c = conjunctDistrSS (c.s ! CSent) ;
|
||||
ConjCN c ns = conjunctDistrSS (c.s ! CPhr CNPhrase) ns ** {c = ns.c} ;
|
||||
|
||||
-- These fun's are generated from the list cat's.
|
||||
|
||||
BaseS = twoSS ;
|
||||
ConsS = consrSS duncomma ;
|
||||
BaseS s t = t ** {
|
||||
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} ; ---- ??
|
||||
ConsAdv x xs = consrSS duncomma x xs ** {advType = x.advType ; hasDe = xs.hasDe} ; ---- ??
|
||||
BaseNP = twoSS ;
|
||||
ConsNP = consrSS duncomma ;
|
||||
BaseAP x y = twoSS x y ** {monoSyl = y.monoSyl} ;
|
||||
ConsAP x xs = consrSS duncomma x xs ** {monoSyl = xs.monoSyl} ;
|
||||
BaseAP x y = twoTable AdjPlace x y ** {monoSyl = y.monoSyl} ;
|
||||
ConsAP x xs = consrTable AdjPlace duncomma x xs ** {monoSyl = xs.monoSyl} ;
|
||||
BaseRS = twoSS ;
|
||||
ConsRS = consrSS duncomma ;
|
||||
BaseCN x y = twoSS x y ** {c = x.c} ; --- classified comes from first part ; should it rather be ge?
|
||||
ConsCN x xs = consrSS duncomma x xs ** {c = x.c} ;
|
||||
|
||||
lincat
|
||||
[S] = {s1,s2 : Str} ;
|
||||
--[S] = ConjType => {s1,s2 : Str} ;
|
||||
[S] = {s1,preJiu,postJiu : Str} ;
|
||||
[Adv] = {s1,s2 : Str ; advType : AdvType ; hasDe : Bool} ;
|
||||
[NP] = {s1,s2 : Str} ;
|
||||
[AP] = {s1,s2 : Str ; monoSyl : Bool} ;
|
||||
[AP] = {s1,s2 : AdjPlace => Str ; monoSyl : Bool} ;
|
||||
[RS] = {s1,s2 : Str} ;
|
||||
[CN] = {s1,s2 : Str ; c : Str} ;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ lin
|
||||
InflectionA, InflectionA2 = \adj -> {
|
||||
t = "a" ;
|
||||
s1 = heading1 "Adjective" ;
|
||||
s2 = adj.s
|
||||
s2 = adj.s!Attr
|
||||
} ;
|
||||
|
||||
InflectionAdv, InflectionAdV, InflectionAdA, InflectionAdN = \adv -> {
|
||||
|
||||
@@ -18,7 +18,7 @@ concrete ExtraChi of ExtraChiAbs = CatChi **
|
||||
BaseVPS = twoSS ;
|
||||
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
|
||||
ConjVPI c = conjunctDistrSS (c.s ! CSent) ;
|
||||
@@ -37,8 +37,8 @@ concrete ExtraChi of ExtraChiAbs = CatChi **
|
||||
Aspect = {s : Str ; a : ResChi.Aspect} ;
|
||||
lin
|
||||
CompBareAP ap = case ap.hasAdA of {
|
||||
True => insertObj (mkNP ap.s) (predV nocopula []) ;
|
||||
False => insertObj (mkNP ap.s) (predV hen_copula [])
|
||||
True => insertObj (mkNP (ap.s!Pred)) (predV nocopula []) ;
|
||||
False => insertObj (mkNP (ap.s!Pred)) (predV hen_copula [])
|
||||
} ;
|
||||
QuestRepV cl = {
|
||||
s = \\_,p,a => ---- also for indirect questions?
|
||||
@@ -49,7 +49,8 @@ concrete ExtraChi of ExtraChiAbs = CatChi **
|
||||
APerf => v.s ++ "不" ++ v.sn ++ v.pp ;
|
||||
ADurStat => v.s ++ "不" ++ v.sn ;
|
||||
ADurProg => v.s ++ v.neg ++ v.dp ++ v.sn ; -- mei or bu
|
||||
AExper => v.s ++ v.neg ++ v.sn ++ v.ep
|
||||
AExper => v.s ++ v.neg ++ v.sn ++ v.ep ;
|
||||
AFut => jiu_s ++ v.s ++ v.neg ++ v.sn ++ v.ep -- TODO check placement of jiang
|
||||
}
|
||||
in
|
||||
cl.np ++ cl.vp.prePart ++ verb ++ cl.vp.compl
|
||||
|
||||
@@ -12,7 +12,7 @@ concrete IdiomChi of Idiom = CatChi ** open Prelude, ResChi in {
|
||||
---- it is John who did it
|
||||
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
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ lin
|
||||
tree_N = mkN "树" "棵"; -- "shu" "ke"
|
||||
big_A = mkA "大" ; -- "da"
|
||||
small_A = mkA "小" ; -- "xiao"
|
||||
green_A = mkA "绿" ; -- "lv"
|
||||
green_A = colourA "绿" ; -- "lv"
|
||||
walk_V = mkV "走" ; -- "zou"
|
||||
sleep_V = mkV "睡觉" ; -- "shui"
|
||||
love_V2 = mkV2 "爱" ; -- "ai"
|
||||
@@ -159,10 +159,10 @@ ashes_N = mkN "灰" [];
|
||||
burn_V = mkV "烧" ;
|
||||
road_N = mkN "路" "条";
|
||||
mountain_N = mkN "山" "座";
|
||||
red_A = mkA "红" ;
|
||||
yellow_A = mkA "黄" ;
|
||||
white_A = mkA "白" ;
|
||||
black_A = mkA "黑" ;
|
||||
red_A = colourA "红" ;
|
||||
yellow_A = colourA "黄" ;
|
||||
white_A = colourA "白" ;
|
||||
black_A = colourA "黑" ;
|
||||
night_N = mkN "夜晚" ; -- [mark] "夜晚" 's classifier is "个"
|
||||
day_N = mkN "白天" []; -- [mark] "白天" -> "天", "天" itself is classifier
|
||||
year_N = mkN "年" [] ; -- [mark] "年" itself is classifier
|
||||
@@ -357,7 +357,7 @@ lin
|
||||
beg_V2V = mkV2V (mkV "乞求") ; -- beg him to do something
|
||||
break_V2 = mkV2 "打破" ;
|
||||
broad_A = mkA "宽" ;
|
||||
brown_A = mkA "棕" ;
|
||||
brown_A = colourA "棕" ;
|
||||
clever_A = mkA "聪明" ;
|
||||
close_V2 = mkV2 "关闭" ;
|
||||
easy_A2V = mkA2 "简单" ;
|
||||
@@ -376,6 +376,4 @@ lin
|
||||
ugly_A = mkA "丑" ;
|
||||
uncertain_A = mkA "不确定" ; -- [mark] "不确定": 不("un-") + 确定("certain")
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -12,6 +12,7 @@ concrete NounChi of Noun = CatChi ** open ResChi, Prelude in {
|
||||
|
||||
DetNP det = {s = case det.detType of {
|
||||
DTFull Pl => det.s ++ xie_s ;
|
||||
DTPoss => det.s ;
|
||||
_ => det.s ++ ge_s
|
||||
} ;
|
||||
} ; ----
|
||||
@@ -63,8 +64,8 @@ concrete NounChi of Noun = CatChi ** open ResChi, Prelude in {
|
||||
|
||||
AdNum adn num = {s = adn.s ++ num.s ; hasC = True} ;
|
||||
|
||||
OrdSuperl a = {s = superlative_s ++ a.s} ;
|
||||
OrdNumeralSuperl n a = {s = ordinal_s ++ n.s ++ superlative_s ++ a.s} ; ---- to check AR 24/8/2014
|
||||
OrdSuperl a = {s = superlative_s ++ a.s ! Attr} ;
|
||||
OrdNumeralSuperl n a = {s = ordinal_s ++ n.s ++ superlative_s ++ a.s ! Attr} ; ---- to check AR 24/8/2014
|
||||
|
||||
DefArt = mkQuant [] [] DTPoss ; -- use that_Quant if you want the_s
|
||||
IndefArt = mkQuant yi_s [] DTNum ; -- (DTFull Sg) ; -- empty in the plural
|
||||
@@ -80,8 +81,8 @@ concrete NounChi of Noun = CatChi ** open ResChi, Prelude in {
|
||||
ComplN3 f x = {s = appPrep f.c2 x.s ++ f.s ; c = f.c ; c2 = f.c3} ;
|
||||
|
||||
AdjCN ap cn = case ap.monoSyl of {
|
||||
True => {s = ap.s ++ cn.s ; c = cn.c} ;
|
||||
False => {s = ap.s ++ possessive_s ++ cn.s ; c = cn.c}
|
||||
True => {s = ap.s ! Attr ++ cn.s ; c = cn.c} ;
|
||||
False => {s = ap.s ! Attr ++ possessive_s ++ cn.s ; c = cn.c}
|
||||
} ;
|
||||
|
||||
RelCN cn rs = {s = rs.s ++ cn.s ; c = cn.c} ;
|
||||
|
||||
@@ -35,6 +35,9 @@ oper
|
||||
= \a,b -> lin A (mkAdj a b) ;
|
||||
} ;
|
||||
|
||||
colourA : Str -> A ; -- colour Adjectives have a "色" when used as predicative
|
||||
colourA colour = lin A (colourAdj colour);
|
||||
|
||||
mkA2 = overload {
|
||||
mkA2 : Str -> A2
|
||||
= \a -> lin A2 (simpleAdj a ** {c2 = emptyPrep}) ;
|
||||
@@ -190,9 +193,9 @@ oper
|
||||
= \s -> lin Subj (ResChi.mkSubj s []) ;
|
||||
mkConj = overload {
|
||||
mkConj : Str -> Conj
|
||||
= \s -> lin Conj {s = \\_ => mkConjForm s} ;
|
||||
= \s -> lin Conj {s = \\_ => mkConjForm s ; conjType = NotJiu} ;
|
||||
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
|
||||
= \s -> lin Det {s = word s ; detType = DTFull Sg} ;
|
||||
|
||||
@@ -3,7 +3,7 @@ concrete PhraseChi of Phrase = CatChi ** open Prelude, ResChi in {
|
||||
lin
|
||||
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) ;
|
||||
UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p} ;
|
||||
UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p} ;
|
||||
@@ -13,7 +13,7 @@ concrete PhraseChi of Phrase = CatChi ** open Prelude, ResChi in {
|
||||
UttIAdv iadv = iadv ;
|
||||
UttNP np = np ;
|
||||
UttCN cn = cn ;
|
||||
UttAP ap = ap ;
|
||||
UttAP ap = {s = ap.s!Attr} ;
|
||||
UttCard x = x ;
|
||||
UttVP vp = ss (infVP vp) ;
|
||||
UttAdv adv = adv ;
|
||||
|
||||
@@ -7,21 +7,7 @@ concrete QuestionChi of Question = CatChi **
|
||||
lin
|
||||
|
||||
QuestCl cl = {
|
||||
s = table {
|
||||
True => \\p,a => cl.s ! p ! a ++ question_s ; -- redup question as variant in ExtraChi
|
||||
False => \\p,a => --- code copied from ExtraChi
|
||||
let
|
||||
v = cl.vp.verb ;
|
||||
verb = case a of {
|
||||
APlain => v.s ++ v.neg ++ v.sn ;
|
||||
APerf => v.s ++ neg_s ++ v.sn ++ v.pp ;
|
||||
ADurStat => v.s ++ neg_s ++ v.sn ;
|
||||
ADurProg => v.s ++ v.neg ++ v.dp ++ v.sn ; -- mei or bu
|
||||
AExper => v.s ++ v.neg ++ v.sn ++ v.ep
|
||||
}
|
||||
in
|
||||
cl.np ++ cl.vp.prePart ++ verb ++ cl.vp.compl
|
||||
}
|
||||
s = \\b,p,a => cl.s ! p ! a ++ question_s ; -- redup question as variant in ExtraChi
|
||||
} ;
|
||||
|
||||
QuestVP ip vp = {
|
||||
|
||||
@@ -42,6 +42,8 @@ resource ResChi = ParamX ** open Prelude in {
|
||||
geng_s = "更" ; -- more, in comparison
|
||||
hen_s = "很" ; -- very, or predicating a monosyllabic adjective
|
||||
taN_s = "它" ;
|
||||
jiu_s = "就" ;
|
||||
hui_s = "会" ;
|
||||
|
||||
zai_V = mkVerb "在" [] [] [] [] "不" ;
|
||||
fullstop_s = "。" ;
|
||||
@@ -89,15 +91,17 @@ resource ResChi = ParamX ** open Prelude in {
|
||||
-- parameters
|
||||
|
||||
param
|
||||
Aspect = APlain | APerf | ADurStat | ADurProg | AExper ; ---- APlain added by AR
|
||||
Aspect = APlain | APerf | ADurStat | ADurProg | AExper | AFut ; ---- APlain added by AR
|
||||
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 ;
|
||||
DeForm = DeNoun | NdNoun ; -- parameter created for noun with/out partical "de"
|
||||
|
||||
AdvType = ATPlace Bool | ATTime | ATManner | ATPoss ; -- ATPlace True = has zai_s already
|
||||
|
||||
-- parts of speech
|
||||
AdjPlace = Attr | Pred ; -- a green cat / the cat is green colour
|
||||
|
||||
-- parts of speech
|
||||
oper
|
||||
|
||||
VP = {
|
||||
@@ -113,21 +117,35 @@ oper
|
||||
-- for morphology
|
||||
|
||||
Noun : Type = {s : Str ; c : Str} ;
|
||||
Adj : Type = {s : Str ; monoSyl: Bool} ;
|
||||
Adj : Type = {s : AdjPlace => Str ; monoSyl: Bool} ;
|
||||
Verb : Type = {s,sn : Str ; pp,ds,dp,ep : Str ; neg : Str} ; --- sn=[] needed for "hen" as copula
|
||||
|
||||
regNoun : Str -> Str -> Noun = \s,c -> {s = word s ; c = word c};
|
||||
|
||||
mkAdj : Str -> Bool -> Adj = \s,b -> {s = word s ; monoSyl = b};
|
||||
mkAdj : Str -> Bool -> Adj = \s,b -> {s =
|
||||
table {
|
||||
_ => word s
|
||||
};
|
||||
monoSyl = b};
|
||||
|
||||
complexAP : Str -> Adj ** {hasAdA : Bool} =
|
||||
\s -> {s = s ; monoSyl = False ; hasAdA = False} ; --- not used for adding AdA
|
||||
\s -> mkAdj s False ** {hasAdA = False} ; --- not used for adding AdA
|
||||
|
||||
simpleAdj : Str -> Adj = \s -> case s of {
|
||||
? => mkAdj s True ; -- monosyllabic
|
||||
_ => mkAdj s False
|
||||
} ;
|
||||
|
||||
colourAdj : Str -> Adj = \s -> {
|
||||
s = table {
|
||||
Attr => word s ;
|
||||
Pred => word s ++ "色"
|
||||
};
|
||||
monoSyl = case s of {
|
||||
? => True ;
|
||||
_ => False }
|
||||
};
|
||||
|
||||
copula : Verb = mkVerb "是" [] [] [] [] "不" ;
|
||||
hen_copula : Verb =
|
||||
{s = hen_s ; sn = [] ; pp = [] ; ds = [] ; dp = [] ; ep = [] ; neg = "不"} ; ---
|
||||
@@ -151,14 +169,16 @@ oper
|
||||
APerf => v.s ++ v.pp ;
|
||||
ADurStat => v.s ++ v.ds ;
|
||||
ADurProg => v.dp ++ v.s ;
|
||||
AExper => v.s ++ v.ep
|
||||
AExper => v.s ++ v.ep ;
|
||||
AFut => hui_s ++ v.s
|
||||
} ;
|
||||
Neg => table {
|
||||
APlain => v.neg ++ v.sn ; --- neg?
|
||||
APerf => "不" ++ v.sn ++ v.pp ;
|
||||
ADurStat => "不" ++ v.sn ;
|
||||
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 => "不" ++ hui_s ++ v.s
|
||||
}
|
||||
} ;
|
||||
|
||||
@@ -199,12 +219,22 @@ oper
|
||||
|
||||
-- clauses: keep np and vp separate to enable insertion of IAdv
|
||||
|
||||
Clause : Type = {
|
||||
Clause : Type = {
|
||||
s : Polarity => Aspect => Str ;
|
||||
np : Str;
|
||||
vp : VP
|
||||
np : Str ;
|
||||
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 : Str -> Verb -> Clause = \np,v ->
|
||||
@@ -221,6 +251,7 @@ oper
|
||||
s = \\p,a => vp.topic ++ np ++ vp.prePart ++ useVerb vp.verb ! p ! a ++ vp.compl ++ compl ;
|
||||
np = vp.topic ++ np ;
|
||||
vp = insertObj (ss compl) vp ;
|
||||
postJiu = \\p,a => vp.prePart ++ useVerb vp.verb ! p ! a ++ vp.compl ++ compl ;
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
@@ -31,20 +31,36 @@ concrete SentenceChi of Sentence = CatChi **
|
||||
|
||||
SlashPrep cl prep = cl ** {c2 = prep} ;
|
||||
|
||||
EmbedS s = ss (conjThat ++ s.s) ;
|
||||
EmbedS s = ss (conjThat ++ linS s) ;
|
||||
EmbedQS qs = ss (qs.s ! False) ;
|
||||
EmbedVP vp = ss (infVP vp) ;
|
||||
|
||||
UseCl t p cl = {s = t.s ++ p.s ++ cl.s ! p.p ! t.t} ;
|
||||
UseCl t p cl = {
|
||||
preJiu = cl.np ;
|
||||
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} ;
|
||||
|
||||
AdvS a s = ss (a.s ++ s.s) ;
|
||||
ExtAdvS a s = ss (a.s ++ chcomma ++ s.s) ;
|
||||
AdvS a 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
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -30,13 +30,15 @@ and_Conj = {s = table {
|
||||
CPhr CNPhrase => mkConjForm "和" ;
|
||||
CPhr CAPhrase => mkConjForm "而" ;
|
||||
CPhr CVPhrase => mkConjForm "又" ;
|
||||
CSent => mkConjForm "并且" --modified by chenpneg 11.19
|
||||
}
|
||||
CSent => mkConjForm "而" --modified by chenpneg 11.19
|
||||
} ;
|
||||
conjType = NotJiu ;
|
||||
} ;
|
||||
or_Conj = {s = table {
|
||||
CPhr _ => mkConjForm "或" ;
|
||||
CSent => mkConjForm "还是"
|
||||
}
|
||||
} ;
|
||||
conjType = NotJiu ;
|
||||
} ;
|
||||
|
||||
although_Subj = mkSubj "虽然" "但";
|
||||
@@ -52,8 +54,8 @@ when_IAdv = mkIAdvL "什么时候" ;
|
||||
how_IAdv = mkIAdvL "如何" ;
|
||||
all_Predet = ssword "所有" ;
|
||||
many_Det = mkDet (word "很多") DTPoss ;
|
||||
someSg_Det = mkDet (word "一些") Sg ;
|
||||
somePl_Det = mkDet (word "一些") Sg ;
|
||||
someSg_Det = mkDet (word "一些") DTPoss ;
|
||||
somePl_Det = mkDet (word "一些") DTPoss ;
|
||||
few_Det = mkDet "少" Pl ;
|
||||
other_A = mkA "其他" ;
|
||||
|
||||
@@ -122,7 +124,8 @@ both7and_DConj = {s = table { -- modified by chenpeng 11.19
|
||||
CPhr CAPhrase => mkConjForm2 "即" "又" ;
|
||||
CPhr CVPhrase => mkConjForm2 "不但" "而且" ;
|
||||
CSent => mkConjForm2 "不但" "而且"
|
||||
}
|
||||
} ;
|
||||
conjType = NotJiu ;
|
||||
} ;
|
||||
|
||||
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 CVPhrase => mkConjForm2 "要么" "要么" ;
|
||||
CSent => mkConjForm2 "要么" "要么"
|
||||
}
|
||||
} ;
|
||||
conjType = NotJiu ;
|
||||
} ;
|
||||
|
||||
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
|
||||
most_Predet = ssword "大多数" ;
|
||||
if_then_Conj = {s = table { -- added by chenpeng 11.19
|
||||
CPhr CNPhrase => mkConjForm [] ;
|
||||
CPhr CAPhrase => mkConjForm [] ;
|
||||
CPhr CVPhrase => mkConjForm [] ;
|
||||
CSent => mkConjForm2 "如果" "那么"
|
||||
}
|
||||
CSent => mkConjForm2 "如果" "就" ; -- if she walks, I then sleep
|
||||
CPhr _ => mkConjForm2 "如果" "那么" -- if fish , then rice
|
||||
} ;
|
||||
conjType = Jiu ;
|
||||
} ;
|
||||
nobody_NP = ssword "没人" ;
|
||||
nothing_NP = ssword "没有什么" ;
|
||||
|
||||
@@ -19,7 +19,7 @@ concrete SymbolChi of Symbol = CatChi ** open Prelude, ResChi in {
|
||||
c = cn.c
|
||||
} ;
|
||||
|
||||
SymbS sy = sy ;
|
||||
SymbS sy = simpleS sy.s ;
|
||||
SymbNum sy = sy ;
|
||||
SymbOrd sy = sy ;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ concrete TenseChi of Tense =
|
||||
---- ??
|
||||
TPres = {s = [] ; t = APlain} ;
|
||||
TPast = {s = [] ; t = APerf} ;
|
||||
TFut = {s = [] ; t = ADurProg} ;
|
||||
TFut = {s = [] ; t = AFut} ;
|
||||
TCond = {s = [] ; t = ADurStat} ;
|
||||
|
||||
ASimul = {s = [] ; t = APlain} ;
|
||||
|
||||
@@ -10,10 +10,10 @@ concrete VerbChi of Verb = CatChi ** open ResChi, Prelude in {
|
||||
Slash2V3 v np = insertAdv (mkNP (ba_s ++ np.s)) (predV v v.part) ** {c2 = v.c3 ; isPre = v.hasPrep} ; -- slot for third argument
|
||||
Slash3V3 v np = insertObj (mkNP (appPrep v.c3 np.s)) (predV v v.part) ** {c2 = v.c2 ; isPre = True} ; -- slot for ba object
|
||||
|
||||
SlashV2A v ap = insertObj ap (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} ;
|
||||
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} ;
|
||||
|
||||
ComplVV v vp = {
|
||||
@@ -23,9 +23,9 @@ concrete VerbChi of Verb = CatChi ** open ResChi, Prelude in {
|
||||
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 []) ;
|
||||
ComplVA v ap = insertObj ap (predV v []) ;
|
||||
ComplVA v ap = insertObj {s = ap.s ! Pred} (predV v []) ;
|
||||
|
||||
ComplSlash vp np = case vp.isPre of {
|
||||
--- True => insertAdv (mkNP (ba_s ++ np.s)) vp ; --- ba or vp.c2 ?
|
||||
@@ -62,7 +62,7 @@ concrete VerbChi of Verb = CatChi ** open ResChi, Prelude in {
|
||||
|
||||
PassV2 v = insertAdv (mkNP passive_s) (predV v v.part) ; ----
|
||||
|
||||
CompAP ap = insertObj (mkNP (ap.s ++ de_s)) (predV copula []) ** {isAdj = True} ;
|
||||
CompAP ap = insertObj (mkNP (ap.s ! Pred ++ de_s)) (predV copula []) ** {isAdj = True} ;
|
||||
|
||||
{-
|
||||
CompAP ap = case ap.hasAdA of {
|
||||
|
||||
3
src/chinese/unittest/adjectives.gftest
Normal file
3
src/chinese/unittest/adjectives.gftest
Normal file
@@ -0,0 +1,3 @@
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant that_Quant NumSg) (AdjCN (PositA green_A) (UseN cat_N))) (UseComp (CompAP (PositA green_A))))
|
||||
LangChi: 那 只 绿 猫 是 绿 色 的
|
||||
LangEng: that green cat is green
|
||||
12
src/chinese/unittest/adverbial.gftest
Normal file
12
src/chinese/unittest/adverbial.gftest
Normal file
@@ -0,0 +1,12 @@
|
||||
-- These are not ideal output. TODO: Add new constructor for semantic contexts to achieve the correct output for "地" vs "得"
|
||||
|
||||
Lang: PredVP (AdvNP (UsePron it_Pron) (PositAdvAdj beautiful_A)) (UseV walk_V)
|
||||
LangChi: 漂 亮 地 的 它 走
|
||||
LangEng: it beautifully walks
|
||||
-- Correct LangChi: 它 漂 亮 地 走
|
||||
|
||||
|
||||
Lang: PredVP (UsePron it_Pron) (AdvVP (UseV walk_V) (PositAdvAdj beautiful_A))
|
||||
LangChi: 它 走 得 漂 亮 地
|
||||
LangEng: it walks beautifully
|
||||
-- Correct LangChi: 它 走 得 漂 亮
|
||||
3
src/chinese/unittest/complements.gftest
Normal file
3
src/chinese/unittest/complements.gftest
Normal file
@@ -0,0 +1,3 @@
|
||||
-- One way of saying "he/she gives me a cat"
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron he_Pron) (ComplSlash (Slash2V3 give_V3 (DetCN (DetQuant DefArt NumSg) (UseN cat_N))) (UsePron i_Pron)))
|
||||
LangChi: 他 把 猫 给 我
|
||||
47
src/chinese/unittest/conjunctions.gftest
Normal file
47
src/chinese/unittest/conjunctions.gftest
Normal file
@@ -0,0 +1,47 @@
|
||||
-- Basic conjunctions, no jiu
|
||||
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))))
|
||||
LangChi: 我 睡 觉 而 她 走
|
||||
LangEng: I sleep and she walks
|
||||
|
||||
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: 我 去 还 是 她 去
|
||||
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))))
|
||||
LangChi: 如 果 我 睡 觉 , 她 就 死
|
||||
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))))
|
||||
LangChi: 如 果 我 睡 觉 , 她 就 会 死
|
||||
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))))
|
||||
LangChi: 如 果 我 睡 觉 , 她 就 不 死
|
||||
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))))
|
||||
LangChi: 如 果 我 睡 觉 , 她 就 不 会 死
|
||||
LangEng: if I sleep then she won't die
|
||||
|
||||
|
||||
|
||||
-- NP conjunctions
|
||||
Lang: ConjNP or_Conj (BaseNP (MassNP (UseN fish_N)) (MassNP (UseN beer_N)))
|
||||
LangChi: 鱼 或 啤 酒
|
||||
LangEng: fish or beer
|
||||
|
||||
--NB: unnatural non-empty strings just for testing purpose
|
||||
Lang: ConjNP if_then_Conj (BaseNP (MassNP (UseN fish_N)) (MassNP (UseN beer_N)))
|
||||
LangChi: 如 果 鱼 那 么 啤 酒
|
||||
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
|
||||
30
src/chinese/unittest/negation.gftest
Normal file
30
src/chinese/unittest/negation.gftest
Normal file
@@ -0,0 +1,30 @@
|
||||
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (MassNP (UseN cat_N)) (UseComp (CompCN (UseN dog_N))))
|
||||
LangEng: cat isn't a dog
|
||||
LangChi: 猫 不 是 狗
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant this_Quant NumPl) (UseN cat_N)) (UseComp (CompAP (PositA green_A))))
|
||||
LangEng: these cats aren't green
|
||||
LangChi: 这 些 猫 不 是 绿 色 的
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant that_Quant NumPl) (UseN cat_N)) (UseComp (CompAdv (PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN house_N))))))
|
||||
LangEng: those cats aren't in the house
|
||||
LangChi: 那 些 猫 不 在 房 子 中
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant this_Quant NumPl) (UseN cat_N)) (ComplVV can8know_VV (UseV walk_V)))
|
||||
LangChi: 这 些 猫 不 会 走
|
||||
LangEng: these cats can't walk
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant this_Quant NumPl) (UseN cat_N)) (ComplVV can_VV (UseV walk_V)))
|
||||
LangChi: 这 些 猫 不 能 走
|
||||
LangEng: these cats can't walk
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant this_Quant NumPl) (UseN cat_N)) (ComplVV want_VV (UseV walk_V)))
|
||||
LangChi: 这 些 猫 不 想 走
|
||||
LangEng: these cats don't want to walk
|
||||
|
||||
-- this tree does not make semantic sense in chinese but is compositionally correct due to the direct word for word translation for "must"
|
||||
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant that_Quant NumPl) (UseN cat_N)) (ComplVV must_VV (UseV walk_V)))
|
||||
LangChi: 那 些 猫 不 必 须 走
|
||||
LangEng: those cats mustn't walk
|
||||
|
||||
-- 没有 and must not , bu ke yi
|
||||
11
src/chinese/unittest/numerals.gftest
Normal file
11
src/chinese/unittest/numerals.gftest
Normal file
@@ -0,0 +1,11 @@
|
||||
Lang: DetCN (DetQuant IndefArt (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01))))))) (UseN cat_N)
|
||||
LangEng: one cat
|
||||
LangChi: 一 只 猫
|
||||
|
||||
Lang: DetCN (DetQuant this_Quant (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n5)))))))) (UseN cat_N)
|
||||
LangEng: these five cats
|
||||
LangChi: 这 五 只 猫
|
||||
|
||||
Lang: DetCN (DetQuant (PossPron i_Pron) (NumCard (NumNumeral (num (pot2as3 (pot2 (pot0 n7))))))) (UseN cat_N)
|
||||
LangEng: my seven hundred cats
|
||||
LangChi: 我 的 七 百 只 猫
|
||||
11
src/chinese/unittest/passive.gftest
Normal file
11
src/chinese/unittest/passive.gftest
Normal file
@@ -0,0 +1,11 @@
|
||||
Lang: PredVP (DetCN (DetQuant that_Quant NumSg) (UseN boy_N)) (PassV2 kill_V2)
|
||||
LangEng: that boy is killed
|
||||
LangChi: 那 个 男 孩 被 杀
|
||||
|
||||
Lang: PredVP (DetCN (DetQuant DefArt NumSg) (UseN chair_N)) (PassV2 split_V2)
|
||||
LangEng: the chair is split
|
||||
LangChi: 椅 子 被 劈 开
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant that_Quant NumSg) (UseN boy_N)) (ComplVV want_VV (PassV2 kill_V2)))
|
||||
LangEng: that boy doesn't want to be killed
|
||||
LangChi: 那 个 男 孩 不 想 被 杀
|
||||
117
src/chinese/unittest/pronouns.gftest
Normal file
117
src/chinese/unittest/pronouns.gftest
Normal file
@@ -0,0 +1,117 @@
|
||||
----------
|
||||
-- Objects
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (ComplSlash (VPSlashPrep (ComplSlash (VPSlashPrep (UseV go_V) with_Prep) (UsePron i_Pron)) to_Prep) (DetCN (DetQuant DefArt NumSg) (UseN moon_N))))
|
||||
LangEng: the cat goes with me to the moon
|
||||
LangChi: 猫 和 我 一 起 往 月 亮 去
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant (PossPron i_Pron) NumPl) (UseN cat_N)) (UseComp (CompAdv (PrepNP with_Prep (DetCN (DetQuant that_Quant NumSg) (UseN person_N))))))
|
||||
LangEng: my cats are with that person
|
||||
LangChi: 我 的 猫 和 那 个 人 一 起
|
||||
|
||||
Lang: UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a hit_V2) (UsePron he_Pron)))
|
||||
LangEng: I hit him
|
||||
LangChi: 我 打 了 他
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a hit_V2) (UsePron he_Pron)))
|
||||
LangEng: I hit him
|
||||
LangChi: 我 打 他
|
||||
|
||||
-------------
|
||||
-- Possession
|
||||
Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN cat_N)
|
||||
LangEng: my cat
|
||||
LangChi: 我 的 猫
|
||||
|
||||
-- that is my cat
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetNP (DetQuant that_Quant NumSg)) (UseComp (CompNP (DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN cat_N)))))
|
||||
LangEng: that is my cat
|
||||
LangChi: 那 个 是 我 的 猫
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant that_Quant NumSg) (UseN cat_N)) (UseComp (CompNP (DetNP (DetQuant (PossPron i_Pron) NumSg)))))
|
||||
LangEng: that cat is mine
|
||||
LangChi: 那 只 猫 是 我 的
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant (PossPron she_Pron) NumSg) (UseN cat_N)) (UseComp (CompAP (PositA green_A))))
|
||||
LangEng: her cat is green
|
||||
LangChi: 她 的 猫 是 绿 色 的
|
||||
|
||||
-- two variants, different trees
|
||||
-- read a book
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron he_Pron) (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant IndefArt NumSg) (PossNP (UseN book_N) (UsePron she_Pron)))))
|
||||
LangEng: he reads a book of hers
|
||||
LangChi: 他 读 一 本 她 的 书
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron he_Pron) (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant (PossPron she_Pron) NumSg) (UseN book_N))))
|
||||
LangEng: he reads her book
|
||||
LangChi: 他 读 她 的 书
|
||||
|
||||
-- I read his/her father's book
|
||||
Lang: UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant DefArt NumSg) (PossNP (UseN book_N) (DetCN (DetQuant DefArt NumSg) (PossNP (UseN2 father_N2) (UsePron she_Pron)))))))
|
||||
LangEng: I read the book of the father of hers
|
||||
LangChi: 我 读 了 她 的 父 亲 的 书
|
||||
|
||||
-- Only the noun phrase
|
||||
Lang: MassNP (PossNP (UseN book_N) (UsePron he_Pron))
|
||||
LangEng: book of his
|
||||
LangChi: 他 的 书
|
||||
|
||||
Lang: DetCN (DetQuant (PossPron he_Pron) NumSg) (UseN book_N)
|
||||
LangEng: his book
|
||||
LangChi: 他 的 书
|
||||
|
||||
-- For non-pronoun NPs, multiple trees
|
||||
Lang: AdvNP (MassNP (UseN book_N)) (PrepNP part_Prep (DetCN (DetQuant DefArt NumSg) (UseN cat_N)))
|
||||
LangEng: book of the cat
|
||||
LangChi: 猫 的 书
|
||||
|
||||
Lang: AdvNP (MassNP (UseN book_N)) (PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN cat_N)))
|
||||
LangEng: book of the cat
|
||||
LangChi: 猫 的 书
|
||||
|
||||
Lang: MassNP (AdvCN (UseN book_N) (PrepNP part_Prep (DetCN (DetQuant DefArt NumSg) (UseN cat_N))))
|
||||
LangEng: book of the cat
|
||||
LangChi: 猫 的 书
|
||||
|
||||
Lang: MassNP (AdvCN (UseN book_N) (PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN cat_N))))
|
||||
LangEng: book of the cat
|
||||
LangChi: 猫 的 书
|
||||
|
||||
Lang: MassNP (ApposCN (AdvCN (UseN book_N) (PrepNP part_Prep (DetNP (DetQuant DefArt NumPl)))) (MassNP (UseN cat_N)))
|
||||
LangEng: book of the cat
|
||||
LangChi: 猫 的 书
|
||||
|
||||
Lang: MassNP (ApposCN (AdvCN (UseN book_N) (PrepNP possess_Prep (DetNP (DetQuant DefArt NumPl)))) (MassNP (UseN cat_N)))
|
||||
LangEng: book of the cat
|
||||
LangChi: 猫 的 书
|
||||
|
||||
Lang: MassNP (ApposCN (PartNP (UseN book_N) (DetNP (DetQuant DefArt NumPl))) (MassNP (UseN cat_N)))
|
||||
LangEng: book of the cat
|
||||
LangChi: 猫 的 书
|
||||
|
||||
Lang: MassNP (ApposCN (PossNP (UseN book_N) (DetNP (DetQuant DefArt NumPl))) (MassNP (UseN cat_N)))
|
||||
LangEng: book of the cat
|
||||
LangChi: 猫 的 书
|
||||
|
||||
Lang: MassNP (PartNP (UseN book_N) (DetCN (DetQuant DefArt NumSg) (UseN cat_N)))
|
||||
LangEng: book of the cat
|
||||
LangChi: 猫 的 书
|
||||
|
||||
Lang: MassNP (PossNP (UseN book_N) (DetCN (DetQuant DefArt NumSg) (UseN cat_N)))
|
||||
LangEng: book of the cat
|
||||
LangChi: 猫 的 书
|
||||
|
||||
-- You can also produce nonsensical variants, in all languages.
|
||||
-- The point of RGL is to be a collection of syntactic structures,
|
||||
-- and application grammarians can choose to use them in any combinations.
|
||||
-- So the following English linearizations aren't *wrong*, they just don't make sense.
|
||||
|
||||
-- If theese Chinese linearizations are merely weird, like the English ones, then they are correct.
|
||||
-- If they feel wrong in the same way as "his cat of my" would in English, then they are wrong.
|
||||
Lang: DetCN (DetQuant (PossPron he_Pron) NumSg) (PossNP (UseN cat_N) (UsePron i_Pron))
|
||||
LangEng: his cat of mine
|
||||
LangChi: 他 的 我 的 猫
|
||||
|
||||
Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (PossNP (UseN cat_N) (UsePron she_Pron))
|
||||
LangEng: my cat of hers
|
||||
LangChi: 我 的 她 的 猫
|
||||
63
src/chinese/unittest/quantifier.gftest
Normal file
63
src/chinese/unittest/quantifier.gftest
Normal file
@@ -0,0 +1,63 @@
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a have_V2) (DetCN somePl_Det (UseN cat_N))))
|
||||
--LangChi: 我 有 一 些 只 猫
|
||||
LangChi: 我 有 一 些 猫
|
||||
LangEng: I have some cats
|
||||
|
||||
Lang: DetCN someSg_Det (UseN water_N)
|
||||
--LangChi: 一 些 滴 水
|
||||
LangChi: 一 些 水
|
||||
LangEng: some water
|
||||
|
||||
Lang: DetCN someSg_Det (UseN beer_N)
|
||||
--LangChi: 一 些 杯 啤 酒
|
||||
LangChi: 一 些 啤 酒
|
||||
LangEng: some beer
|
||||
|
||||
--LangChi: 我 有 几 只 猫
|
||||
--LangEng: I have a few cats
|
||||
|
||||
|
||||
Lang: DetCN (DetQuant IndefArt (NumCard (NumNumeral (num (pot2as3 (pot1as2 pot111)))))) (UseN cat_N)
|
||||
LangChi: 十 一 只 猫
|
||||
LangEng: eleven cats
|
||||
|
||||
Lang: DetCN many_Det (UseN cat_N)
|
||||
LangChi: 很 多 猫
|
||||
LangEng: many cats
|
||||
|
||||
Lang: PredVP (UsePron i_Pron) (ComplVV want_VV (ComplSlash (SlashV2a have_V2) (DetCN many_Det (UseN child_N))))
|
||||
LangChi: 我 想 有 很 多 孩 子
|
||||
LangEng: I want to have many children
|
||||
|
||||
|
||||
Lang: DetCN (DetQuant this_Quant NumPl) (UseN cat_N)
|
||||
LangChi: 这 些 猫
|
||||
LangEng: these cats
|
||||
|
||||
Lang: DetCN (DetQuant this_Quant NumSg) (UseN cat_N)
|
||||
LangChi: 这 只 猫
|
||||
LangEng: this cat
|
||||
|
||||
Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a like_V2) (DetCN (DetQuant that_Quant NumPl) (UseN cat_N)))
|
||||
LangChi: 我 喜 欢 那 些 猫
|
||||
LangEng: I like those cats
|
||||
|
||||
Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a like_V2) (DetCN (DetQuant that_Quant NumSg) (UseN cat_N)))
|
||||
LangChi: 我 喜 欢 那 只 猫
|
||||
LangEng: I like that cat
|
||||
|
||||
Lang: DetCN every_Det (UseN rule_N)
|
||||
LangChi: 每 项 规 则
|
||||
LangEng: every rule
|
||||
|
||||
Lang: DetCN few_Det (UseN child_N)
|
||||
LangChi: 少 些 孩 子
|
||||
LangEng: few children
|
||||
|
||||
Lang: PredVP (UsePron i_Pron) (ComplVV want_VV (ComplSlash (SlashV2a have_V2) (DetCN few_Det (UseN child_N))))
|
||||
LangChi: 我 想 有 少 些 孩 子
|
||||
LangEng: I want to have few children
|
||||
|
||||
Lang: DetCN much_Det (UseN beer_N)
|
||||
LangChi: 多 杯 啤 酒
|
||||
LangEng: much beer
|
||||
57
src/chinese/unittest/relative.gftest
Normal file
57
src/chinese/unittest/relative.gftest
Normal file
@@ -0,0 +1,57 @@
|
||||
--------------------------------------------------------------
|
||||
-- Basics
|
||||
|
||||
Lang: DetCN (DetQuant IndefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV walk_V))))
|
||||
LangEng: a cat that walks
|
||||
LangChi: 一 只 走 的 猫
|
||||
|
||||
Lang: DetCN (DetQuant IndefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a drink_V2) (MassNP (UseN milk_N))))))
|
||||
LangEng: a cat that drinks milk
|
||||
LangChi: 一 只 喝 牛 奶 的 猫
|
||||
|
||||
Lang: MassNP (RelCN (UseN milk_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (SlashV2a drink_V2)))))
|
||||
LangEng: milk that the cat drinks
|
||||
LangChi: 猫 喝 的 牛 奶
|
||||
|
||||
|
||||
Lang: DetCN (DetQuant DefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (VPSlashPrep (UseV walk_V) with_Prep) (DetCN (DetQuant DefArt NumSg) (UseN dog_N))))))
|
||||
LangChi: 和 狗 一 起 走 的 猫
|
||||
LangEng: the cat that walks with the dog
|
||||
|
||||
--------------------------------------------------------------
|
||||
-- Determiner placement
|
||||
|
||||
Lang: DetCN (DetQuant this_Quant NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV walk_V))))
|
||||
LangEng: this cat that walks
|
||||
LangChi: 这 只 走 的 猫
|
||||
|
||||
Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a drink_V2) (MassNP (UseN milk_N))))))
|
||||
LangEng: my cat that drinks milk
|
||||
LangChi: 我 的 喝 牛 奶 的 猫
|
||||
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetNP (DetQuant this_Quant NumSg)) (UseComp (CompNP (DetCN (DetQuant DefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV walk_V))))))))
|
||||
LangEng: this is the cat that walks
|
||||
LangChi: 这 个 是 走 的 猫
|
||||
|
||||
|
||||
--------------------------------------------------------------
|
||||
-- Complex example: "the book that his/her father gave him/her"
|
||||
|
||||
-- 1. His father gave him a book
|
||||
Lang: UseCl (TTAnt TPast ASimul) PPos (PredVP (MassNP (ComplN2 father_N2 (UsePron he_Pron))) (ComplSlash (Slash2V3 give_V3 (MassNP (UseN book_N))) (UsePron he_Pron)))
|
||||
LangChi: 他 父 亲 把 书 给 了 他
|
||||
|
||||
-- 2. the book that the father of her gave her
|
||||
Lang: DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPast ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (ComplN2 father_N2 (UsePron she_Pron))) (Slash3V3 give_V3 (UsePron she_Pron))))))
|
||||
LangChi: 她 父 亲 给 了 她 的 书
|
||||
LangEng: the book that the father of her gave her
|
||||
|
||||
-- I want to read the book that my father gave me
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplVV want_VV (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPast ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN2 father_N2)) (Slash3V3 give_V3 (UsePron i_Pron))))))))))
|
||||
LangChi: 我 想 读 我 的 父 亲 给 了 我 的 书
|
||||
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplVV want_VV (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPast ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN2 father_N2)) (SlashV2a read_V2)))))))))
|
||||
LangChi: 我 想 读 我 的 父 亲 读 了 的 书
|
||||
LangEng: I want to read the book that my father read
|
||||
44
src/chinese/unittest/tenses.gftest
Normal file
44
src/chinese/unittest/tenses.gftest
Normal file
@@ -0,0 +1,44 @@
|
||||
-------------
|
||||
-- Basics
|
||||
|
||||
Lang: UseCl (TTAnt TPres AAnter) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (UseV walk_V))
|
||||
LangEng: the cat has walked
|
||||
LangChi: 猫 走 了
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant this_Quant NumSg) (UseN cat_N)) (UseV walk_V))
|
||||
LangEng: this cat walks
|
||||
LangChi: 这 只 猫 走
|
||||
|
||||
Lang: UseCl (TTAnt TFut ASimul) PPos (PredVP (DetCN (DetQuant this_Quant NumSg) (UseN cat_N)) (UseV walk_V))
|
||||
LangEng: this cat will walk
|
||||
LangChi: 这 只 猫 会 走
|
||||
|
||||
Lang: PredVP (DetCN (DetQuant this_Quant NumSg) (UseN cat_N)) (ComplVV can8know_VV (UseV walk_V))
|
||||
LangChi: 这 只 猫 会 走
|
||||
LangEng: this cat can walk
|
||||
|
||||
Lang: PredVP (DetCN (DetQuant this_Quant NumSg) (UseN cat_N)) (ComplVV can_VV (UseV walk_V))
|
||||
LangChi: 这 只 猫 能 走
|
||||
LangEng: this cat can walk
|
||||
|
||||
-- As a verbal complement
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN cat_N)) (ComplVV want_VV (UseV walk_V)))
|
||||
LangChi: 我 的 猫 想 走
|
||||
LangEng: my cat wants to walk
|
||||
|
||||
-- Transitive verbs
|
||||
|
||||
Lang: UseCl (TTAnt TPres AAnter) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a eat_V2) (DetCN (DetQuant IndefArt NumSg) (UseN fish_N))))
|
||||
LangChi: 我 吃 了 一 条 鱼
|
||||
LangEng: I have eaten a fish
|
||||
|
||||
-------------
|
||||
-- Conditions
|
||||
|
||||
Lang: AdvS (SubjS if_Subj (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV walk_V)))) (UseCl (TTAnt TFut ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (UseV walk_V)))
|
||||
LangEng: if I walk the cat will walk
|
||||
LangChi: 如 果 我 走 猫 会 走
|
||||
|
||||
Lang: ExtAdvS (SubjS when_Subj (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV walk_V)))) (UseCl (TTAnt TFut ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (UseV walk_V)))
|
||||
LangEng: when I walk , the cat will walk
|
||||
LangChi: 我 走 的 时 候 , 猫 会 走
|
||||
@@ -3,13 +3,13 @@ UseV,ComplVV,ComplVS,ComplVQ,ComplVA,SlashV2a,SlashV2V,SlashV2A,SlashV2S,Slash2V
|
||||
UseV,UseComp {"to"} PART mark head
|
||||
UseComp,CompAdv,CompAP,CompNP,CompCN,ProgrVP,QuestIComp {"is","are","am","was","were","been","be"} VERB cop head
|
||||
CompCN {"a","an"} DET det head
|
||||
PassV2 {"is","are","am","was","were""been","be"} VERB auxpass head
|
||||
PassV2 {"is","are","am","was","were""been","be"} VERB aux:pass head
|
||||
ComplVV {"to"} PART mark xcomp
|
||||
ComplVS {"that"} PART mark ccomp
|
||||
EmbedVP {"to"} PART mark head
|
||||
EmbedS {"that"} PART mark head
|
||||
SentCN {"that","to"} PART mark acl
|
||||
ExtAdvS,SubjS {","} PUNCT punct head
|
||||
ConsNP,ExtAdvS,SSubjS,VocNP {","} PUNCT punct head
|
||||
ExistNPAdv,ExistNP {"not","don't","doesn't","didn't","haven't","hasn't","hadn't","wouldn't","won't","isn't","aren't","wasn't","weren't"} PART neg head
|
||||
ExistNPAdv,ExistNP {"has","had","have","will","would","do","does","did"} AUX aux head
|
||||
ExistNPAdv,ExistNP {"is","are","am","was","were""been","be"} VERB cop head
|
||||
@@ -34,9 +34,3 @@ PossNP,PartNP {"of"} ADP case nmod
|
||||
@"am" PresSg1
|
||||
@"is" PresSg3
|
||||
@"are" PresPl
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -81,7 +81,8 @@ lin
|
||||
infObjs = (vp.inf.inpl.p1)!agr ; -- adapted to new VP.inf, HL 3/2022
|
||||
infPred = vp.inf.inpl.p2 ;
|
||||
infCompl : Str = case <t,a,vp.isAux> of {
|
||||
<Fut|Cond,Anter,True> => [] ; _ => infObjs ++ infPred } ;
|
||||
<Fut|Cond,Anter,True> => [] ; --# notpresent
|
||||
_ => infObjs ++ infPred } ;
|
||||
pred : {inf, infComplfin : Str} = case <t,a,vp.isAux> of {
|
||||
<Fut|Cond,Anter,True> => --# notpresent
|
||||
{inf = infObjs ++ haben ++ infPred ++ verb.inf ; --# notpresent Duden 318
|
||||
|
||||
@@ -142,7 +142,8 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||
infObjs = (vp.inf.inpl.p1)!agr ; -- adapted to new VP.inf, HL 3/2022
|
||||
infPred = vp.inf.inpl.p2 ;
|
||||
infCompl : Str = case <t,a,vp.isAux> of {
|
||||
<Fut|Cond,Anter,True> => [] ; _ => infObjs ++ infPred } ;
|
||||
<Fut|Cond,Anter,True> => [] ; --# notpresent
|
||||
_ => infObjs ++ infPred } ;
|
||||
pred : {inf, infComplfin : Str} = case <t,a,vp.isAux> of {
|
||||
<Fut|Cond,Anter,True> => --# notpresent
|
||||
{inf = infObjs ++ haben ++ infPred ++ verb.inf ; --# notpresent Duden 318
|
||||
@@ -182,7 +183,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||
|
||||
ReflPoss num cn = {s = \\a,c => num.s ! cn.g ! c ++ possPron a num.n cn.g c ++ cn.s ! adjfCase Strong c ! num.n ! c} ;
|
||||
|
||||
ReflPron = { s = reflPron } ; -- reflexively used personal pronoun, with special forms in P3 Sg
|
||||
ReflPron = { s = ResGer.reflPron } ; -- reflexively used personal pronoun, with special forms in P3 Sg
|
||||
|
||||
-- In P1,P2 we might use "selbst" to define a (stronger) reflexive pronoun instead: -- HL 3/2022
|
||||
-- du kennst mich vs. ich kenne mich selbst
|
||||
@@ -190,7 +191,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||
-- sie kennen sich (selbst) =/= sie kennen einander
|
||||
-- Likewise, instead of ReflPoss we might define a reflexive possessive pronoun:
|
||||
-- du kennst meine Fehler vs. ich kenne meine eigenen Fehler
|
||||
-- er|sie|es kennt seine Fehler vs. er|sie|es kennt seine|ihre|seine eigenen Fehler
|
||||
-- er|sie|es kennt seine|ihre Fehler vs. er|sie|es kennt seine|ihre|seine eigenen Fehler
|
||||
oper
|
||||
reflPronSelf : Agr => Case => Str = \\a => \\c => reflPron ! a ! c ++ "selbst" ;
|
||||
|
||||
@@ -299,4 +300,6 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||
|
||||
-- this function is not entirely satisfactory as largely
|
||||
-- though not entirely duplicating mkClause in ResGer
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -4,13 +4,12 @@ abstract ExtraGerAbs = Extra [
|
||||
VPSlash, PassVPSlash, PassAgentVPSlash, CompIQuant, PastPartAP, PastPartAgentAP,
|
||||
Temp,Tense,Pol,S,NP,VV,VP,Conj,IAdv,IQuant,IComp,ICompAP,IAdvAdv,Adv,AP,
|
||||
Foc,FocObj,FocAdv,FocAP,UseFoc,
|
||||
RNP,ReflRNP,ReflPoss
|
||||
RNP,ReflRNP,ReflPoss,ReflPron
|
||||
] ** {
|
||||
flags coding=utf8;
|
||||
|
||||
cat
|
||||
FClause ; -- formal clause
|
||||
|
||||
fun
|
||||
PPzuAdv : CN -> Adv ; -- zum Lied, zur Flasche
|
||||
TImpfSubj : Tense ; -- ich möchte... --# notpresent
|
||||
@@ -27,4 +26,5 @@ abstract ExtraGerAbs = Extra [
|
||||
FtoCl : FClause -> Cl ; -- embedding FClause within the RGL, to allow generation of S, Utt, etc.
|
||||
|
||||
Pass3V3 : V3 -> VPSlash ; -- wir bekommen den Beweis erklärt
|
||||
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ resource ResGer = ParamX ** open Prelude in {
|
||||
-- adv : Str ; -- die Frage [a von Max] -- HL: cannot be extracted
|
||||
a : Agr ;
|
||||
-- isLight : Bool ; -- light NPs come before negation in simple clauses (expensive)
|
||||
-- isPron : Bool } ; -- needed to put accPron before datPron
|
||||
-- isPron : Bool ; -- needed to put accPron before datPron
|
||||
w : Weight } ;
|
||||
|
||||
mkN : (x1,_,_,_,_,x6,x7 : Str) -> Gender -> Noun =
|
||||
@@ -606,7 +606,7 @@ resource ResGer = ParamX ** open Prelude in {
|
||||
Fut => vf True (wird m a) vpart haben ; --# notpresent
|
||||
Cond => vf True (wuerde a) vpart haben ; --# notpresent
|
||||
Pres => vf True (hat m t a) vpart []
|
||||
} ; --# notpresent
|
||||
} ;
|
||||
VPImperat False => vf False (verb.s ! VImper (numberAgr a)) [] [] ;
|
||||
VPImperat True => vf False (verb.s ! VFin False (VPresSubj Pl P3)) [] [] ;
|
||||
VPInfinit Anter => vf True [] (vpart ++ haben) [] ; --# notpresent
|
||||
@@ -828,7 +828,8 @@ resource ResGer = ParamX ** open Prelude in {
|
||||
-- leave inf-complement of +auxV(2)V in place,
|
||||
-- extract infzu-complement of -auxV(2)V: (ComplVV, SlashV2V)
|
||||
infCompl : Str = case <t,a,vp.isAux> of {
|
||||
<Fut|Cond,Anter,True> => [] ; _ => infObjs ++ infPred } ;
|
||||
<Fut|Cond,Anter,True> => [] ; --# notpresent
|
||||
_ => infObjs ++ infPred } ;
|
||||
pred : {inf, infComplfin : Str} = case <t,a,vp.isAux> of {
|
||||
<Fut|Cond,Anter,True> => --# notpresent
|
||||
{inf = infObjs ++ haben ++ infPred ++ verb.inf ; --# notpresent Duden 318
|
||||
@@ -838,15 +839,10 @@ resource ResGer = ParamX ** open Prelude in {
|
||||
{inf = verb.inf ++ haben ; --# notpresent
|
||||
infComplfin = -- es ++ wird/hat/hatte ++ tun ++ wollen --# notpresent
|
||||
infObjs ++ verb.fin ++ infPred ++ verb.inf ++ haben} ; --# notpresent
|
||||
<Pres,_,_> =>
|
||||
_ =>
|
||||
{inf = verb.inf ++ haben ;
|
||||
infComplfin = -- es zu tun ++ [] ++ [] ++ versucht
|
||||
infComplfin = -- es zu tun ++ versucht/[] +[]+ hat/versuchte
|
||||
infCompl ++ verb.inf ++ haben ++ verb.fin}
|
||||
; --# notpresent
|
||||
_ => --# notpresent
|
||||
{inf = verb.inf ++ haben ; --# notpresent
|
||||
infComplfin = -- es zu tun ++ versucht ++ [] ++ hat --# notpresent
|
||||
infCompl ++ verb.inf ++ haben ++ verb.fin} --# notpresent
|
||||
} ;
|
||||
extra = vp.inf.extr!agr ++ vp.ext ;
|
||||
in
|
||||
@@ -1005,4 +1001,3 @@ resource ResGer = ParamX ** open Prelude in {
|
||||
in <subj , agr> ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ LangMay: kucing tidak berjalan
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant this_Quant NumPl) (UseN cat_N)) (UseComp (CompAP (PositA green_A))))
|
||||
LangEng: these cats aren't green
|
||||
LangMay: kucing-kucing ini hijau
|
||||
LangMay: kucing-kucing ini tidak hijau
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant that_Quant NumPl) (UseN cat_N)) (UseComp (CompAdv (PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN house_N))))))
|
||||
LangEng: those cats aren't in the house
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
abstract TestLang =
|
||||
Grammar,
|
||||
Grammar - [SlashVP, RelSlash],
|
||||
TestLexiconGerAbs
|
||||
, Construction
|
||||
** {
|
||||
@@ -32,4 +32,12 @@ abstract TestLang =
|
||||
Pass2V3 : V3 -> NP -> VP ; -- uns erklärt werden ; Eng give_V3[indir,dir]: we are given the book
|
||||
|
||||
Pass2V4 : V4 -> NP -> VPSlash ; -- bei dir (für Gold) gekauft werden
|
||||
|
||||
cat
|
||||
ClauseSlash ;
|
||||
|
||||
fun
|
||||
RelSlash : RP -> ClauseSlash -> RCl ;
|
||||
SlashVP : NP -> VPSlash -> ClauseSlash ;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
-- use the modified files in gf-rgl/src/german
|
||||
|
||||
concrete TestLangGer of TestLang =
|
||||
GrammarGer
|
||||
GrammarGer - [SlashVP, RelSlash]
|
||||
, TestLexiconGer
|
||||
, ConstructionGer
|
||||
** open ResGer,Prelude,(P=ParadigmsGer) in {
|
||||
@@ -100,12 +100,10 @@ concrete TestLangGer of TestLang =
|
||||
insertExtrapos vp.ext (
|
||||
insertInf inf vps) ** {c2 = v.c2 ; objCtrl = v.objCtrl} ;
|
||||
|
||||
}
|
||||
|
||||
-- SlashV2VNP : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy
|
||||
-- -- (the book) that (she (begged:V2V me:NP (to buy ()):VPSlash):VPSlash):ClSlash
|
||||
|
||||
-- 3/22 expensive:
|
||||
-- 3/22 expensive: |NP|=54, |Prep|=|18|, |V2|=180, |V2V|=720, |VP|=360, |VPSlash|=12.290 (!)
|
||||
-- i -v -src TestLangGer.gf
|
||||
-- + ComplSlash 699840 (355680,532)
|
||||
-- + SlashV2V 259200 (1440,20)
|
||||
@@ -152,3 +150,99 @@ gr -tr (PredVP (UsePron ?) (ComplSlash (SlashV2V lassen_V2V (ReflVP (SlashV2a wa
|
||||
|
||||
-}
|
||||
|
||||
-- Reimplementation of SlashVP: replace mkClause by mkClSlash to let reflexives agree
|
||||
-- with object in relative clauses, if objCtrl = true. To save memory, use
|
||||
-- ClauseSlash.s : ... => RelGenNum => Str instead of : ... => Agr => Str.
|
||||
-- + SlashVP 699840 gf: out of memory (requested 2097152 bytes) with Agr => Str
|
||||
-- + SlashVP 699840 (2880,160) with RelGenNum => Str; |Agr| = 18, |RelGenNum| = 5.
|
||||
-- Todo: replace other uses of ClSlash by ClauseSlash
|
||||
|
||||
lincat
|
||||
ClauseSlash = {
|
||||
s : Mood => ResGer.Tense => Anteriority => Polarity => Order => RelGenNum => Str ;
|
||||
c2 : Preposition
|
||||
} ;
|
||||
|
||||
lin
|
||||
SlashVP np vp =
|
||||
let subj = mkSubj np vp.c1
|
||||
in mkClSlash subj.p1 subj.p2 vp ** { c2 = vp.c2 } ;
|
||||
|
||||
RelSlash rp cls = lin RCl {
|
||||
s = \\m,t,a,p,gn =>
|
||||
appPrep cls.c2 (\\k => usePrepC k (\c -> rp.s ! gn ! c)) ++
|
||||
cls.s ! m ! t ! a ! p ! Sub ! gn ;
|
||||
c = (prepC cls.c2.c).c
|
||||
} ;
|
||||
{-
|
||||
QuestSlash ip slash = {
|
||||
s = \\m,t,a,p =>
|
||||
let
|
||||
cls = slash.s ! m ! t ! a ! p ;
|
||||
who = appPrep slash.c2 (\\k => usePrepC k (\c -> ip.s ! c)) ;
|
||||
in table {
|
||||
QDir => who ++ cls ! Inv ;
|
||||
QIndir => who ++ cls ! Sub
|
||||
}
|
||||
} ;
|
||||
-}
|
||||
|
||||
|
||||
oper
|
||||
gnToAgr : RelGenNum -> Agr = \gn ->
|
||||
case gn of {RGenNum (GSg g) => Ag g Sg P3 ;
|
||||
RGenNum GPl => Ag Neutr Pl P3 ;
|
||||
RSentence => Ag Neutr Sg P3} ;
|
||||
|
||||
|
||||
mkClSlash : Str -> Agr -> ResGer.VPSlash -> ClauseSlash = \subj,agr,vp ->
|
||||
let vps = useVP vp in lin ClauseSlash {
|
||||
c2 = vp.c2 ;
|
||||
s = \\m,t,a,b,o,gn =>
|
||||
let
|
||||
ord = case o of {
|
||||
Sub => True ; -- glue prefix to verb
|
||||
_ => False
|
||||
} ;
|
||||
verb = vps.s ! ord ! agr ! VPFinite m t a ;
|
||||
haben = verb.inf2 ;
|
||||
neg = negation ! b ;
|
||||
ag : Agr = case vp.objCtrl of {True => gnToAgr gn ; _ => agr} ;
|
||||
obj1 = (vp.nn ! ag).p1 ++ (vp.nn ! ag).p2 ; -- refl ++ pronouns ++ light nps
|
||||
obj2 = (vp.nn ! ag).p3 ; -- pp-objects and heavy nps
|
||||
obj3 = (vp.nn ! ag).p4 ++ vp.adj ++ vp.a2 ; -- pred.AP|CN|Adv, via useComp HL 6/2019
|
||||
compl : Str = obj1 ++ obj2 ++ neg ++ obj3 ;
|
||||
infObjs = (vp.inf.inpl.p1) ! ag ;
|
||||
infPred = vp.inf.inpl.p2 ;
|
||||
infCompl : Str = case <t,a,vp.isAux> of {
|
||||
<Fut|Cond,Anter,True> => [] ; _ => infObjs ++ infPred } ;
|
||||
pred : {inf, infComplfin : Str} = case <t,a,vp.isAux> of {
|
||||
<Fut|Cond,Anter,True> => --# notpresent
|
||||
{inf = infObjs ++ haben ++ infPred ++ verb.inf ; --# notpresent Duden 318
|
||||
infComplfin = -- es ++ wird ++ haben ++ tun ++ wollen --# notpresent
|
||||
infObjs ++ verb.fin ++ haben ++ infPred ++ verb.inf} ; --# notpresent
|
||||
<_,Anter,True> => --# notpresent
|
||||
{inf = verb.inf ++ haben ; --# notpresent
|
||||
infComplfin = -- es ++ wird/hat/hatte ++ tun ++ wollen --# notpresent
|
||||
infObjs ++ verb.fin ++ infPred ++ verb.inf ++ haben} ; --# notpresent
|
||||
<Pres,_,_> =>
|
||||
{inf = verb.inf ++ haben ;
|
||||
infComplfin = -- es zu tun ++ [] ++ [] ++ versucht
|
||||
infCompl ++ verb.inf ++ haben ++ verb.fin}
|
||||
; --# notpresent
|
||||
_ => --# notpresent
|
||||
{inf = verb.inf ++ haben ; --# notpresent
|
||||
infComplfin = -- es zu tun ++ versucht ++ [] ++ hat --# notpresent
|
||||
infCompl ++ verb.inf ++ haben ++ verb.fin} --# notpresent
|
||||
} ;
|
||||
extra : Str = (vp.inf.extr) ! ag ++ vp.ext ;
|
||||
in
|
||||
case o of {
|
||||
Main => subj ++ verb.fin ++ compl ++ infCompl ++ pred.inf ++ extra ;
|
||||
Inv => verb.fin ++ subj ++ compl ++ infCompl ++ pred.inf ++ extra ;
|
||||
Subj => subj ++ compl ++ pred.infComplfin ++ extra
|
||||
}
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user