diff --git a/lib/src/Makefile b/lib/src/Makefile index 1ecf39644..0f591fc28 100644 --- a/lib/src/Makefile +++ b/lib/src/Makefile @@ -156,7 +156,7 @@ ParseEngSwe: gf -make -literal=Symb -probs=$(PROBSFILE) -name=ParseEngSwe ParseEng.pgf ParseSwe.pgf ParseChi: - gf -make -literal=Symb -probs=$(PROBSFILE) -name=ParseChi chinese/ParseChi.gf + gf -make -s -literal=Symb -probs=$(PROBSFILE) -name=ParseChi chinese/ParseChi.gf ParseEngChi: gf -make -literal=Symb -probs=$(PROBSFILE) -name=ParseEngChi ParseEng.pgf ParseChi.pgf diff --git a/lib/src/chinese/ConjunctionChi.gf b/lib/src/chinese/ConjunctionChi.gf index 2b93a566b..c27eab382 100644 --- a/lib/src/chinese/ConjunctionChi.gf +++ b/lib/src/chinese/ConjunctionChi.gf @@ -7,6 +7,7 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin ConjNP c = conjunctDistrSS (c.s ! CPhr CNPhrase) ; ConjAP c as = conjunctDistrSS (c.s ! CPhr CAPhrase) as ** {monoSyl = False} ; 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. @@ -20,6 +21,8 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin ConsAP = consrSS duncomma ; 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} ; @@ -27,5 +30,7 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin [NP] = {s1,s2 : Str} ; [AP] = {s1,s2 : Str} ; [RS] = {s1,s2 : Str} ; + [CN] = {s1,s2 : Str ; c : Str} ; + } diff --git a/lib/src/chinese/DictEngChi.gf b/lib/src/chinese/DictEngChi.gf index c32cf2cfe..6ad63c743 100644 --- a/lib/src/chinese/DictEngChi.gf +++ b/lib/src/chinese/DictEngChi.gf @@ -491,7 +491,7 @@ rate_N = mkN "率" ; bond_N = mkN "券" ; zoological_A = mkA "关于动物" ; time_N = mkN "时间" ; ---* presidentMasc_N = mkN "" ; --?? Don't understand +presidentMasc_N = mkN "总统" ; week_N = mkN "星期" ; investor_N = mkN "投资者" ; into_Prep = mkPrep "成" ; @@ -542,6 +542,7 @@ just_Adv = mkAdv "只是" ; up_Adv = mkAdv "上" ; security_N = mkN "安全" ; current_A = mkA "现时" ; +currency_N = mkN "货币" ; cost_N = mkN "成本" ; problem_N = mkN "问题" ; financial_A = mkA "金融" ; diff --git a/lib/src/chinese/ExtraChi.gf b/lib/src/chinese/ExtraChi.gf index e8ff7c4bd..aa7f43a19 100644 --- a/lib/src/chinese/ExtraChi.gf +++ b/lib/src/chinese/ExtraChi.gf @@ -7,7 +7,6 @@ concrete ExtraChi of ExtraChiAbs = CatChi ** [VPS] = {s1,s2 : Str} ; VPI = {s : Str} ; --- ??? [VPI] = {s1,s2 : Str} ; --- ??? - [CN] = {s : Str ; c : Str} ; lin PassVPSlash vps = insertAdv (mkNP passive_s) vps ; @@ -17,14 +16,13 @@ concrete ExtraChi of ExtraChiAbs = CatChi ** BaseVPS = twoSS ; ConsVPS = consrSS duncomma ; + PredVPS np vps = {s = np.s ++ vps.s} ; + MkVPI vp = {s = (mkClause [] vp).s ! Pos ! APlain} ; --- ?? almost just a copy of VPS ConjVPI c = conjunctDistrSS (c.s ! CSent) ; BaseVPI = twoSS ; ConsVPI = consrSS duncomma ; - ConjCN c = conjunctDistrSS (c.s ! CPhr CNPhrase) ** {c = ge_s} ; --- classifier always ge - BaseCN = twoSS ; - ConsCN = consrSS duncomma ; GenRP nu cn = {s = cn.s ++ relative_s} ; ---- ?? diff --git a/lib/src/chinese/ExtraChiAbs.gf b/lib/src/chinese/ExtraChiAbs.gf index d0de1b03b..f304785bf 100644 --- a/lib/src/chinese/ExtraChiAbs.gf +++ b/lib/src/chinese/ExtraChiAbs.gf @@ -3,7 +3,7 @@ abstract ExtraChiAbs = Cat, Extra [NP, Quant, VPSlash, VP, Tense, Aspect, GenNP, PassVPSlash, Temp, Pol, Conj, VPS, ListVPS, S, Num, CN, RP, MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS, GenRP, VPI, VPIForm, VPIInf, VPIPresPart, ListVPI, VV, MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV, - ClSlash, RCl, EmptyRelSlash, ListCN, ConjCN, BaseCN, ConsCN] + ClSlash, RCl, EmptyRelSlash] ** { cat diff --git a/lib/src/chinese/ParadigmsChi.gf b/lib/src/chinese/ParadigmsChi.gf index 1108004de..469c9b92b 100644 --- a/lib/src/chinese/ParadigmsChi.gf +++ b/lib/src/chinese/ParadigmsChi.gf @@ -72,8 +72,12 @@ oper mkVV : Str -> VV = ---- \v -> lin VV (regVerb v) ; - mkVQ : V -> VQ = - \v -> lin VQ v ; + mkVQ = overload { + mkVQ : Str -> VQ = + \v -> lin VQ (regVerb v) ; + mkVQ : V -> VQ = + \v -> lin VQ v ; + } ; mkVS = overload { mkVS : V -> VS = @@ -89,10 +93,12 @@ oper \v -> lin VA v ; } ; - mkV2Q : V -> V2Q = - \v -> lin V2Q (v ** {c2 = emptyPrep ; hasPrep = False ; part = []}) ; ----- mkV2Q : V -> Str -> V2Q = ----- \v,p -> lin V2Q (v ** {c2 = mkPrep p}) ; + mkV2Q = overload { + mkV2Q : V -> V2Q = + \v -> lin V2Q (v ** {c2 = emptyPrep ; hasPrep = False ; part = []}) ; + mkV2Q : Str -> V2Q = + \v -> lin V2Q (regVerb v ** {c2 = emptyPrep ; hasPrep = False ; part = []}) ; + } ; mkV2V= overload { mkV2V : Str -> V2V = diff --git a/lib/src/chinese/ResChi.gf b/lib/src/chinese/ResChi.gf index 1c49a7034..a5267d739 100644 --- a/lib/src/chinese/ResChi.gf +++ b/lib/src/chinese/ResChi.gf @@ -62,7 +62,7 @@ resource ResChi = ParamX ** open Prelude in { -- Write the characters that constitute a word separately. This enables straightforward tokenization. - bword : Str -> Str -> Str = \x,y -> x + y ; -- change to x + y to treat words as single tokens + bword : Str -> Str -> Str = \x,y -> x ++ y ; -- change to x + y to treat words as single tokens word : Str -> Str = \s -> case s of { x@? + y@? + z@? + u@? + v@? + w@? + a@? + b@? => bword x (bword y (bword z (bword u (bword v (bword w (bword a b)))))) ;