(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:
Hans Leiss
2022-04-11 15:33:36 +02:00
39 changed files with 1042 additions and 431 deletions

View File

@@ -4,7 +4,7 @@ DirectComplVQ empty nsubj head ccomp -- Temp argument can only be empty in Eng
DirectComplVS 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 SlashVP nsubj head
SlashVS nsubj head ccomp SlashVS nsubj head ccomp
FocusObjS nsubj head -- again might be wrong; more correct to call it dobj FocusObjS nsubj head -- again might be wrong; more correct to call it obj
QuestIAdv advmod head -- "where does John sleep" cf. AdvVP QuestIAdv advmod head -- "where does John sleep" cf. AdvVP
QuestIComp head nsubj -- "where is John": John is clearly nsubj, but is where the head? QuestIComp head nsubj -- "where is John": John is clearly nsubj, but is where the head?
QuestQVP nsubj head QuestQVP nsubj head
@@ -159,7 +159,7 @@ TQuestMark head dep
ComplV2 head obj -- shortcuts in App ComplV2 head obj -- shortcuts in App
ComplV2V head obj xcomp 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 PassAgentV2 head ncomp -- not sure
RelV2 mark nsubj head RelV2 mark nsubj head
QuestV2 obj nsubj head QuestV2 obj nsubj head
@@ -181,7 +181,7 @@ AdV ADV
Adv ADV Adv ADV
CAdv ADV CAdv ADV
Card NUM Card NUM
Conj CONJ Conj CCONJ
Det DET Det DET
Digits NUM Digits NUM
IAdv ADV IAdv ADV
@@ -194,7 +194,7 @@ N2 NOUN
N3 NOUN N3 NOUN
Numeral NUM Numeral NUM
Ord NUM Ord NUM
PConj CONJ PConj CCONJ
PN PROPN PN PROPN
Predet DET Predet DET
Prep ADP Prep ADP
@@ -214,7 +214,3 @@ VA VERB
VQ VERB VQ VERB
VS VERB VS VERB
VV VERB VV VERB

View File

@@ -4,26 +4,58 @@ concrete AdjectiveChi of Adjective = CatChi ** open ResChi, Prelude in {
PositA a = a ** {hasAdA = False} ; PositA a = a ** {hasAdA = False} ;
--ComparA a np = complexAP (a.s ++ than_s ++ np.s) ; ComparA a np = a ** {
ComparA a np = complexAP (than_s ++ np.s ++ a.s) ; 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) ; AdjOrd ord = ord ** {
CAdvAP ad ap np = complexAP (ad.s++ np.s++ad.p++ap.s ) ; --modified by ChenPeng 11.24 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} ; 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 }
};
} }

View File

@@ -2,20 +2,20 @@ concrete AdverbChi of Adverb = CatChi **
open ResChi, Prelude in { open ResChi, Prelude in {
lin 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 ? 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} ; 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} ; -----
PositAdAAdj a = {s = a.s} ; ---- PositAdAAdj a = {s = a.s!Attr} ; ----
} }

View File

@@ -4,7 +4,7 @@ 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} ;
@@ -59,7 +59,10 @@ 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 ;
@@ -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 ;
} }

View File

@@ -2,33 +2,47 @@ 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 = 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) ; ConjRS c = conjunctDistrSS (c.s ! CSent) ;
ConjCN c ns = conjunctDistrSS (c.s ! CPhr CNPhrase) ns ** {c = ns.c} ; ConjCN c ns = conjunctDistrSS (c.s ! CPhr CNPhrase) ns ** {c = ns.c} ;
-- 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 ;
ConsNP = consrSS duncomma ; ConsNP = consrSS duncomma ;
BaseAP x y = twoSS x y ** {monoSyl = y.monoSyl} ; BaseAP x y = twoTable AdjPlace x y ** {monoSyl = y.monoSyl} ;
ConsAP x xs = consrSS duncomma x xs ** {monoSyl = xs.monoSyl} ; ConsAP x xs = consrTable AdjPlace duncomma x xs ** {monoSyl = xs.monoSyl} ;
BaseRS = twoSS ; BaseRS = twoSS ;
ConsRS = consrSS duncomma ; ConsRS = consrSS duncomma ;
BaseCN x y = twoSS x y ** {c = x.c} ; --- classified comes from first part ; should it rather be ge? 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} ; 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 : Str ; monoSyl : Bool} ; [AP] = {s1,s2 : AdjPlace => Str ; monoSyl : Bool} ;
[RS] = {s1,s2 : Str} ; [RS] = {s1,s2 : Str} ;
[CN] = {s1,s2 : Str ; c : Str} ; [CN] = {s1,s2 : Str ; c : Str} ;

View File

@@ -19,7 +19,7 @@ lin
InflectionA, InflectionA2 = \adj -> { InflectionA, InflectionA2 = \adj -> {
t = "a" ; t = "a" ;
s1 = heading1 "Adjective" ; s1 = heading1 "Adjective" ;
s2 = adj.s s2 = adj.s!Attr
} ; } ;
InflectionAdv, InflectionAdV, InflectionAdA, InflectionAdN = \adv -> { InflectionAdv, InflectionAdV, InflectionAdA, InflectionAdN = \adv -> {

View File

@@ -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) ;
@@ -37,8 +37,8 @@ concrete ExtraChi of ExtraChiAbs = CatChi **
Aspect = {s : Str ; a : ResChi.Aspect} ; Aspect = {s : Str ; a : ResChi.Aspect} ;
lin lin
CompBareAP ap = case ap.hasAdA of { CompBareAP ap = case ap.hasAdA of {
True => insertObj (mkNP ap.s) (predV nocopula []) ; True => insertObj (mkNP (ap.s!Pred)) (predV nocopula []) ;
False => insertObj (mkNP ap.s) (predV hen_copula []) False => insertObj (mkNP (ap.s!Pred)) (predV hen_copula [])
} ; } ;
QuestRepV cl = { QuestRepV cl = {
s = \\_,p,a => ---- also for indirect questions? s = \\_,p,a => ---- also for indirect questions?
@@ -49,7 +49,8 @@ concrete ExtraChi of ExtraChiAbs = CatChi **
APerf => v.s ++ "不" ++ v.sn ++ v.pp ; APerf => v.s ++ "不" ++ v.sn ++ v.pp ;
ADurStat => v.s ++ "不" ++ v.sn ; ADurStat => v.s ++ "不" ++ v.sn ;
ADurProg => v.s ++ v.neg ++ v.dp ++ v.sn ; -- mei or bu 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 in
cl.np ++ cl.vp.prePart ++ verb ++ cl.vp.compl cl.np ++ cl.vp.prePart ++ verb ++ cl.vp.compl

View File

@@ -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

View File

@@ -14,7 +14,7 @@ lin
tree_N = mkN "树" "棵"; -- "shu" "ke" tree_N = mkN "树" "棵"; -- "shu" "ke"
big_A = mkA "大" ; -- "da" big_A = mkA "大" ; -- "da"
small_A = mkA "小" ; -- "xiao" small_A = mkA "小" ; -- "xiao"
green_A = mkA "绿" ; -- "lv" green_A = colourA "绿" ; -- "lv"
walk_V = mkV "走" ; -- "zou" walk_V = mkV "走" ; -- "zou"
sleep_V = mkV "睡觉" ; -- "shui" sleep_V = mkV "睡觉" ; -- "shui"
love_V2 = mkV2 "爱" ; -- "ai" love_V2 = mkV2 "爱" ; -- "ai"
@@ -159,10 +159,10 @@ ashes_N = mkN "灰" [];
burn_V = mkV "烧" ; burn_V = mkV "烧" ;
road_N = mkN "路" "条"; road_N = mkN "路" "条";
mountain_N = mkN "山" "座"; mountain_N = mkN "山" "座";
red_A = mkA "红" ; red_A = colourA "红" ;
yellow_A = mkA "黄" ; yellow_A = colourA "黄" ;
white_A = mkA "白" ; white_A = colourA "白" ;
black_A = mkA "黑" ; black_A = colourA "黑" ;
night_N = mkN "夜晚" ; -- [mark] "夜晚" 's classifier is "个" night_N = mkN "夜晚" ; -- [mark] "夜晚" 's classifier is "个"
day_N = mkN "白天" []; -- [mark] "白天" -> "天", "天" itself is classifier day_N = mkN "白天" []; -- [mark] "白天" -> "天", "天" itself is classifier
year_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 beg_V2V = mkV2V (mkV "乞求") ; -- beg him to do something
break_V2 = mkV2 "打破" ; break_V2 = mkV2 "打破" ;
broad_A = mkA "宽" ; broad_A = mkA "宽" ;
brown_A = mkA "棕" ; brown_A = colourA "棕" ;
clever_A = mkA "聪明" ; clever_A = mkA "聪明" ;
close_V2 = mkV2 "关闭" ; close_V2 = mkV2 "关闭" ;
easy_A2V = mkA2 "简单" ; easy_A2V = mkA2 "简单" ;
@@ -376,6 +376,4 @@ lin
ugly_A = mkA "丑" ; ugly_A = mkA "丑" ;
uncertain_A = mkA "不确定" ; -- [mark] "不确定": 不("un-") + 确定("certain") uncertain_A = mkA "不确定" ; -- [mark] "不确定": 不("un-") + 确定("certain")
} }

View File

@@ -12,6 +12,7 @@ concrete NounChi of Noun = CatChi ** open ResChi, Prelude in {
DetNP det = {s = case det.detType of { DetNP det = {s = case det.detType of {
DTFull Pl => det.s ++ xie_s ; DTFull Pl => det.s ++ xie_s ;
DTPoss => det.s ;
_ => det.s ++ ge_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} ; AdNum adn num = {s = adn.s ++ num.s ; hasC = True} ;
OrdSuperl a = {s = superlative_s ++ a.s} ; OrdSuperl a = {s = superlative_s ++ a.s ! Attr} ;
OrdNumeralSuperl n a = {s = ordinal_s ++ n.s ++ superlative_s ++ a.s} ; ---- to check AR 24/8/2014 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 DefArt = mkQuant [] [] DTPoss ; -- use that_Quant if you want the_s
IndefArt = mkQuant yi_s [] DTNum ; -- (DTFull Sg) ; -- empty in the plural 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} ; ComplN3 f x = {s = appPrep f.c2 x.s ++ f.s ; c = f.c ; c2 = f.c3} ;
AdjCN ap cn = case ap.monoSyl of { AdjCN ap cn = case ap.monoSyl of {
True => {s = ap.s ++ cn.s ; c = cn.c} ; True => {s = ap.s ! Attr ++ cn.s ; c = cn.c} ;
False => {s = ap.s ++ possessive_s ++ 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} ; RelCN cn rs = {s = rs.s ++ cn.s ; c = cn.c} ;

View File

@@ -35,6 +35,9 @@ oper
= \a,b -> lin A (mkAdj a b) ; = \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 = overload {
mkA2 : Str -> A2 mkA2 : Str -> A2
= \a -> lin A2 (simpleAdj a ** {c2 = emptyPrep}) ; = \a -> lin A2 (simpleAdj a ** {c2 = emptyPrep}) ;
@@ -190,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} ;

View File

@@ -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} ;
@@ -13,7 +13,7 @@ concrete PhraseChi of Phrase = CatChi ** open Prelude, ResChi in {
UttIAdv iadv = iadv ; UttIAdv iadv = iadv ;
UttNP np = np ; UttNP np = np ;
UttCN cn = cn ; UttCN cn = cn ;
UttAP ap = ap ; UttAP ap = {s = ap.s!Attr} ;
UttCard x = x ; UttCard x = x ;
UttVP vp = ss (infVP vp) ; UttVP vp = ss (infVP vp) ;
UttAdv adv = adv ; UttAdv adv = adv ;

View File

@@ -7,21 +7,7 @@ concrete QuestionChi of Question = CatChi **
lin lin
QuestCl cl = { QuestCl cl = {
s = table { s = \\b,p,a => cl.s ! p ! a ++ question_s ; -- redup question as variant in ExtraChi
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
}
} ; } ;
QuestVP ip vp = { QuestVP ip vp = {

View File

@@ -42,6 +42,8 @@ resource ResChi = ParamX ** open Prelude in {
geng_s = "更" ; -- more, in comparison geng_s = "更" ; -- more, in comparison
hen_s = "很" ; -- very, or predicating a monosyllabic adjective hen_s = "很" ; -- very, or predicating a monosyllabic adjective
taN_s = "它" ; taN_s = "它" ;
jiu_s = "就" ;
hui_s = "会" ;
zai_V = mkVerb "在" [] [] [] [] "不" ; zai_V = mkVerb "在" [] [] [] [] "不" ;
fullstop_s = "。" ; fullstop_s = "。" ;
@@ -89,15 +91,17 @@ resource ResChi = ParamX ** open Prelude in {
-- parameters -- parameters
param 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; 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"
AdvType = ATPlace Bool | ATTime | ATManner | ATPoss ; -- ATPlace True = has zai_s already 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 oper
VP = { VP = {
@@ -113,21 +117,35 @@ oper
-- for morphology -- for morphology
Noun : Type = {s : Str ; c : Str} ; 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 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}; 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} = 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 { simpleAdj : Str -> Adj = \s -> case s of {
? => mkAdj s True ; -- monosyllabic ? => mkAdj s True ; -- monosyllabic
_ => mkAdj s False _ => mkAdj s False
} ; } ;
colourAdj : Str -> Adj = \s -> {
s = table {
Attr => word s ;
Pred => word s ++ "色"
};
monoSyl = case s of {
? => True ;
_ => False }
};
copula : Verb = mkVerb "是" [] [] [] [] "不" ; copula : Verb = mkVerb "是" [] [] [] [] "不" ;
hen_copula : Verb = hen_copula : Verb =
{s = hen_s ; sn = [] ; pp = [] ; ds = [] ; dp = [] ; ep = [] ; neg = "不"} ; --- {s = hen_s ; sn = [] ; pp = [] ; ds = [] ; dp = [] ; ep = [] ; neg = "不"} ; ---
@@ -151,14 +169,16 @@ oper
APerf => v.s ++ v.pp ; APerf => v.s ++ v.pp ;
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 => hui_s ++ v.s
} ; } ;
Neg => table { Neg => table {
APlain => v.neg ++ v.sn ; --- neg? APlain => v.neg ++ v.sn ; --- neg?
APerf => "不" ++ v.sn ++ v.pp ; APerf => "不" ++ v.sn ++ v.pp ;
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 => "不" ++ hui_s ++ v.s
} }
} ; } ;
@@ -201,10 +221,20 @@ oper
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 ->
@@ -221,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 ;
} ; } ;

View File

@@ -31,20 +31,36 @@ concrete SentenceChi of Sentence = CatChi **
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 = {
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} ; 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} ; 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
} ;
} }

View File

@@ -30,13 +30,15 @@ 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 "虽然" "但";
@@ -52,8 +54,8 @@ when_IAdv = mkIAdvL "什么时候" ;
how_IAdv = mkIAdvL "如何" ; how_IAdv = mkIAdvL "如何" ;
all_Predet = ssword "所有" ; all_Predet = ssword "所有" ;
many_Det = mkDet (word "很多") DTPoss ; many_Det = mkDet (word "很多") DTPoss ;
someSg_Det = mkDet (word "一些") Sg ; someSg_Det = mkDet (word "一些") DTPoss ;
somePl_Det = mkDet (word "一些") Sg ; somePl_Det = mkDet (word "一些") DTPoss ;
few_Det = mkDet "少" Pl ; few_Det = mkDet "少" Pl ;
other_A = mkA "其他" ; other_A = mkA "其他" ;
@@ -122,7 +124,8 @@ both7and_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 ;
} ; } ;
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 "没有什么" ;

View File

@@ -19,7 +19,7 @@ concrete SymbolChi of Symbol = CatChi ** open Prelude, ResChi in {
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 ;

View File

@@ -7,7 +7,7 @@ concrete TenseChi of Tense =
---- ?? ---- ??
TPres = {s = [] ; t = APlain} ; TPres = {s = [] ; t = APlain} ;
TPast = {s = [] ; t = APerf} ; TPast = {s = [] ; t = APerf} ;
TFut = {s = [] ; t = ADurProg} ; TFut = {s = [] ; t = AFut} ;
TCond = {s = [] ; t = ADurStat} ; TCond = {s = [] ; t = ADurStat} ;
ASimul = {s = [] ; t = APlain} ; ASimul = {s = [] ; t = APlain} ;

View File

@@ -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 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 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} ; 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,9 +23,9 @@ 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 ap (predV v []) ; ComplVA v ap = insertObj {s = ap.s ! Pred} (predV v []) ;
ComplSlash vp np = case vp.isPre of { ComplSlash vp np = case vp.isPre of {
--- True => insertAdv (mkNP (ba_s ++ np.s)) vp ; --- ba or vp.c2 ? --- 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) ; ---- 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 { CompAP ap = case ap.hasAdA of {

View 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

View 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: 它 走 得 漂 亮

View 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: 他 把 猫 给 我

View 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

View 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

View 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

View 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: 我 的 七 百 只 猫

View 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: 那 个 男 孩 不 想 被 杀

View 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: 我 的 她 的 猫

View 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

View 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

View 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: 我 走 的 时 候 猫 会 走

View File

@@ -3,13 +3,13 @@ UseV,ComplVV,ComplVS,ComplVQ,ComplVA,SlashV2a,SlashV2V,SlashV2A,SlashV2S,Slash2V
UseV,UseComp {"to"} PART mark head UseV,UseComp {"to"} PART mark head
UseComp,CompAdv,CompAP,CompNP,CompCN,ProgrVP,QuestIComp {"is","are","am","was","were","been","be"} VERB cop head UseComp,CompAdv,CompAP,CompNP,CompCN,ProgrVP,QuestIComp {"is","are","am","was","were","been","be"} VERB cop head
CompCN {"a","an"} DET det 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 ComplVV {"to"} PART mark xcomp
ComplVS {"that"} PART mark ccomp ComplVS {"that"} PART mark ccomp
EmbedVP {"to"} PART mark head EmbedVP {"to"} PART mark head
EmbedS {"that"} PART mark head EmbedS {"that"} PART mark head
SentCN {"that","to"} PART mark acl 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 {"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 {"has","had","have","will","would","do","does","did"} AUX aux head
ExistNPAdv,ExistNP {"is","are","am","was","were""been","be"} VERB cop 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 @"am" PresSg1
@"is" PresSg3 @"is" PresSg3
@"are" PresPl @"are" PresPl

View File

@@ -81,7 +81,8 @@ lin
infObjs = (vp.inf.inpl.p1)!agr ; -- adapted to new VP.inf, HL 3/2022 infObjs = (vp.inf.inpl.p1)!agr ; -- adapted to new VP.inf, HL 3/2022
infPred = vp.inf.inpl.p2 ; infPred = vp.inf.inpl.p2 ;
infCompl : Str = case <t,a,vp.isAux> of { 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 { pred : {inf, infComplfin : Str} = case <t,a,vp.isAux> of {
<Fut|Cond,Anter,True> => --# notpresent <Fut|Cond,Anter,True> => --# notpresent
{inf = infObjs ++ haben ++ infPred ++ verb.inf ; --# notpresent Duden 318 {inf = infObjs ++ haben ++ infPred ++ verb.inf ; --# notpresent Duden 318

View File

@@ -142,7 +142,8 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
infObjs = (vp.inf.inpl.p1)!agr ; -- adapted to new VP.inf, HL 3/2022 infObjs = (vp.inf.inpl.p1)!agr ; -- adapted to new VP.inf, HL 3/2022
infPred = vp.inf.inpl.p2 ; infPred = vp.inf.inpl.p2 ;
infCompl : Str = case <t,a,vp.isAux> of { 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 { pred : {inf, infComplfin : Str} = case <t,a,vp.isAux> of {
<Fut|Cond,Anter,True> => --# notpresent <Fut|Cond,Anter,True> => --# notpresent
{inf = infObjs ++ haben ++ infPred ++ verb.inf ; --# notpresent Duden 318 {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} ; 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 -- 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 -- du kennst mich vs. ich kenne mich selbst
@@ -190,7 +191,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
-- sie kennen sich (selbst) =/= sie kennen einander -- sie kennen sich (selbst) =/= sie kennen einander
-- Likewise, instead of ReflPoss we might define a reflexive possessive pronoun: -- Likewise, instead of ReflPoss we might define a reflexive possessive pronoun:
-- du kennst meine Fehler vs. ich kenne meine eigenen Fehler -- 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 oper
reflPronSelf : Agr => Case => Str = \\a => \\c => reflPron ! a ! c ++ "selbst" ; 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 -- this function is not entirely satisfactory as largely
-- though not entirely duplicating mkClause in ResGer -- though not entirely duplicating mkClause in ResGer
} }

View File

@@ -4,13 +4,12 @@ abstract ExtraGerAbs = Extra [
VPSlash, PassVPSlash, PassAgentVPSlash, CompIQuant, PastPartAP, PastPartAgentAP, VPSlash, PassVPSlash, PassAgentVPSlash, CompIQuant, PastPartAP, PastPartAgentAP,
Temp,Tense,Pol,S,NP,VV,VP,Conj,IAdv,IQuant,IComp,ICompAP,IAdvAdv,Adv,AP, Temp,Tense,Pol,S,NP,VV,VP,Conj,IAdv,IQuant,IComp,ICompAP,IAdvAdv,Adv,AP,
Foc,FocObj,FocAdv,FocAP,UseFoc, Foc,FocObj,FocAdv,FocAP,UseFoc,
RNP,ReflRNP,ReflPoss RNP,ReflRNP,ReflPoss,ReflPron
] ** { ] ** {
flags coding=utf8; flags coding=utf8;
cat cat
FClause ; -- formal clause FClause ; -- formal clause
fun fun
PPzuAdv : CN -> Adv ; -- zum Lied, zur Flasche PPzuAdv : CN -> Adv ; -- zum Lied, zur Flasche
TImpfSubj : Tense ; -- ich möchte... --# notpresent 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. FtoCl : FClause -> Cl ; -- embedding FClause within the RGL, to allow generation of S, Utt, etc.
Pass3V3 : V3 -> VPSlash ; -- wir bekommen den Beweis erklärt Pass3V3 : V3 -> VPSlash ; -- wir bekommen den Beweis erklärt
} }

View File

@@ -254,7 +254,7 @@ resource ResGer = ParamX ** open Prelude in {
-- adv : Str ; -- die Frage [a von Max] -- HL: cannot be extracted -- adv : Str ; -- die Frage [a von Max] -- HL: cannot be extracted
a : Agr ; a : Agr ;
-- isLight : Bool ; -- light NPs come before negation in simple clauses (expensive) -- 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 } ; w : Weight } ;
mkN : (x1,_,_,_,_,x6,x7 : Str) -> Gender -> Noun = 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 Fut => vf True (wird m a) vpart haben ; --# notpresent
Cond => vf True (wuerde a) vpart haben ; --# notpresent Cond => vf True (wuerde a) vpart haben ; --# notpresent
Pres => vf True (hat m t a) vpart [] Pres => vf True (hat m t a) vpart []
} ; --# notpresent } ;
VPImperat False => vf False (verb.s ! VImper (numberAgr a)) [] [] ; VPImperat False => vf False (verb.s ! VImper (numberAgr a)) [] [] ;
VPImperat True => vf False (verb.s ! VFin False (VPresSubj Pl P3)) [] [] ; VPImperat True => vf False (verb.s ! VFin False (VPresSubj Pl P3)) [] [] ;
VPInfinit Anter => vf True [] (vpart ++ haben) [] ; --# notpresent 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, -- leave inf-complement of +auxV(2)V in place,
-- extract infzu-complement of -auxV(2)V: (ComplVV, SlashV2V) -- extract infzu-complement of -auxV(2)V: (ComplVV, SlashV2V)
infCompl : Str = case <t,a,vp.isAux> of { 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 { pred : {inf, infComplfin : Str} = case <t,a,vp.isAux> of {
<Fut|Cond,Anter,True> => --# notpresent <Fut|Cond,Anter,True> => --# notpresent
{inf = infObjs ++ haben ++ infPred ++ verb.inf ; --# notpresent Duden 318 {inf = infObjs ++ haben ++ infPred ++ verb.inf ; --# notpresent Duden 318
@@ -838,15 +839,10 @@ resource ResGer = ParamX ** open Prelude in {
{inf = verb.inf ++ haben ; --# notpresent {inf = verb.inf ++ haben ; --# notpresent
infComplfin = -- es ++ wird/hat/hatte ++ tun ++ wollen --# notpresent infComplfin = -- es ++ wird/hat/hatte ++ tun ++ wollen --# notpresent
infObjs ++ verb.fin ++ infPred ++ verb.inf ++ haben} ; --# notpresent infObjs ++ verb.fin ++ infPred ++ verb.inf ++ haben} ; --# notpresent
<Pres,_,_> => _ =>
{inf = verb.inf ++ haben ; {inf = verb.inf ++ haben ;
infComplfin = -- es zu tun ++ [] ++ [] ++ versucht infComplfin = -- es zu tun ++ versucht/[] +[]+ hat/versuchte
infCompl ++ verb.inf ++ haben ++ verb.fin} 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 ; extra = vp.inf.extr!agr ++ vp.ext ;
in in
@@ -1005,4 +1001,3 @@ resource ResGer = ParamX ** open Prelude in {
in <subj , agr> ; in <subj , agr> ;
} }

View File

@@ -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)))) 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 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)))))) 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 LangEng: those cats aren't in the house

View File

@@ -1,5 +1,5 @@
abstract TestLang = abstract TestLang =
Grammar, Grammar - [SlashVP, RelSlash],
TestLexiconGerAbs TestLexiconGerAbs
, Construction , 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 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 Pass2V4 : V4 -> NP -> VPSlash ; -- bei dir (für Gold) gekauft werden
cat
ClauseSlash ;
fun
RelSlash : RP -> ClauseSlash -> RCl ;
SlashVP : NP -> VPSlash -> ClauseSlash ;
} ; } ;

View File

@@ -2,7 +2,7 @@
-- use the modified files in gf-rgl/src/german -- use the modified files in gf-rgl/src/german
concrete TestLangGer of TestLang = concrete TestLangGer of TestLang =
GrammarGer GrammarGer - [SlashVP, RelSlash]
, TestLexiconGer , TestLexiconGer
, ConstructionGer , ConstructionGer
** open ResGer,Prelude,(P=ParadigmsGer) in { ** open ResGer,Prelude,(P=ParadigmsGer) in {
@@ -100,12 +100,10 @@ concrete TestLangGer of TestLang =
insertExtrapos vp.ext ( insertExtrapos vp.ext (
insertInf inf vps) ** {c2 = v.c2 ; objCtrl = v.objCtrl} ; insertInf inf vps) ** {c2 = v.c2 ; objCtrl = v.objCtrl} ;
}
-- SlashV2VNP : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy -- SlashV2VNP : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy
-- -- (the book) that (she (begged:V2V me:NP (to buy ()):VPSlash):VPSlash):ClSlash -- -- (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 -- i -v -src TestLangGer.gf
-- + ComplSlash 699840 (355680,532) -- + ComplSlash 699840 (355680,532)
-- + SlashV2V 259200 (1440,20) -- + 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
}
} ;
}