diff --git a/src/chinese/AdverbChi.gf b/src/chinese/AdverbChi.gf index 73876c496..8a50ddd90 100644 --- a/src/chinese/AdverbChi.gf +++ b/src/chinese/AdverbChi.gf @@ -2,19 +2,19 @@ concrete AdverbChi of Adverb = CatChi ** open ResChi, Prelude in { lin - PositAdvAdj a = {s = a.s ++ "地" ; advType = ATManner} ; ---- for all adjs? + PositAdvAdj a = {s = a.s ++ "地" ; advType = ATManner ; hasDe = False} ; ---- for all adjs? - PrepNP prep np = ss (appPrep prep np.s) ** {advType = prep.advType} ; --- 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} ; + ComparAdvAdj cadv a np = ss (a.s ++ 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} ; + ComparAdvAdjS cadv a s = ss (a.s ++ cadv.s ++ cadv.p ++ s.s) ** {advType = ATManner ; hasDe = False} ; - AdAdv adv ad = ss (ad.s ++ adv.s) ** {advType = ad.advType} ; + AdAdv ad adv = adv ** {s = ad.s ++ adv.s} ; - SubjS subj s = ss (subj.prePart ++ s.s ++ subj.sufPart) ** {advType = ATTime} ; + SubjS subj s = ss (subj.prePart ++ s.s ++ subj.sufPart) ** {advType = ATTime ; hasDe = False} ; - AdnCAdv cadv = ss (cadv.s ++ conjThat) ** {advType = ATManner} ; ----- + AdnCAdv cadv = ss (cadv.s ++ conjThat) ** {advType = ATManner ; hasDe = False} ; ----- PositAdAAdj a = {s = a.s} ; ---- diff --git a/src/chinese/CatChi.gf b/src/chinese/CatChi.gf index b65edceb6..679846ced 100644 --- a/src/chinese/CatChi.gf +++ b/src/chinese/CatChi.gf @@ -50,7 +50,7 @@ concrete CatChi of Cat = CommonX - [Tense, Temp, Ant, Adv] ** open ResChi, Prelu Ord = {s : Str} ; Num = {s : Str ; numType : NumType} ; - Adv = {s : Str ; advType : AdvType} ; + Adv = {s : Str ; advType : AdvType ; hasDe : Bool} ; -- Numeral diff --git a/src/chinese/ConjunctionChi.gf b/src/chinese/ConjunctionChi.gf index bc5abeab0..e507667ae 100644 --- a/src/chinese/ConjunctionChi.gf +++ b/src/chinese/ConjunctionChi.gf @@ -3,9 +3,9 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin lin ConjS c = conjunctDistrSS (c.s ! CSent) ; - ConjAdv c as = conjunctDistrSS (c.s ! CSent) as ** {advType = as.advType} ; ---- ?? + 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 = False ; hasAdA = True} ; ---- ?? + ConjAP c as = conjunctDistrSS (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} ; @@ -13,12 +13,12 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin BaseS = twoSS ; ConsS = consrSS duncomma ; - BaseAdv x y = twoSS x y ** {advType = x.advType} ; ---- ?? - ConsAdv x xs = consrSS duncomma x xs ** {advType = x.advType} ; ---- ?? + 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 = twoSS ; - ConsAP = consrSS duncomma ; + BaseAP x y = twoSS x y ** {monoSyl = y.monoSyl} ; + ConsAP x xs = consrSS 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? @@ -26,9 +26,9 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin lincat [S] = {s1,s2 : Str} ; - [Adv] = {s1,s2 : Str ; advType : AdvType} ; + [Adv] = {s1,s2 : Str ; advType : AdvType ; hasDe : Bool} ; [NP] = {s1,s2 : Str} ; - [AP] = {s1,s2 : Str} ; + [AP] = {s1,s2 : Str ; monoSyl : Bool} ; [RS] = {s1,s2 : Str} ; [CN] = {s1,s2 : Str ; c : Str} ; diff --git a/src/chinese/ConstructionChi.gf b/src/chinese/ConstructionChi.gf index 0202f2b9c..c6032b857 100644 --- a/src/chinese/ConstructionChi.gf +++ b/src/chinese/ConstructionChi.gf @@ -36,16 +36,16 @@ lincat Month = N ; Year = NP ; lin - weekdayPunctualAdv w = lin Adv {s = w.s ; advType = timeAdvType} ; - weekdayHabitualAdv w = lin Adv {s = w.s ; advType = timeAdvType} ; - weekdayNextAdv w = lin Adv {s = "下" ++ w.s ; advType = timeAdvType} ; - weekdayLastAdv w = lin Adv {s = "上" ++ w.s ; advType = timeAdvType} ; + weekdayPunctualAdv w = lin Adv {s = w.s ; advType = timeAdvType ; hasDe = False} ; + weekdayHabitualAdv w = lin Adv {s = w.s ; advType = timeAdvType ; hasDe = False} ; + weekdayNextAdv w = lin Adv {s = "下" ++ w.s ; advType = timeAdvType ; hasDe = False} ; + weekdayLastAdv w = lin Adv {s = "上" ++ w.s ; advType = timeAdvType ; hasDe = False} ; - monthAdv m = lin Adv {s = m.s ; advType = timeAdvType} ; - yearAdv y = lin Adv {s = y.s ++ "年" ; advType = timeAdvType} ; - dayMonthAdv d m = lin Adv {s = m.s ++ d.s ++ "日" ; advType = timeAdvType} ; - monthYearAdv m y = lin Adv {s = y.s ++ "年" ++ m.s ; advType = timeAdvType} ; - dayMonthYearAdv d m y = lin Adv {s = y.s ++ "年" ++ m.s ++ d.s ++ "日" ; advType = timeAdvType} ; + monthAdv m = lin Adv {s = m.s ; advType = timeAdvType ; hasDe = False} ; + yearAdv y = lin Adv {s = y.s ++ "年" ; advType = timeAdvType ; hasDe = False} ; + dayMonthAdv d m = lin Adv {s = m.s ++ d.s ++ "日" ; advType = timeAdvType ; hasDe = False} ; + monthYearAdv m y = lin Adv {s = y.s ++ "年" ++ m.s ; advType = timeAdvType ; hasDe = False} ; + dayMonthYearAdv d m y = lin Adv {s = y.s ++ "年" ++ m.s ++ d.s ++ "日" ; advType = timeAdvType ; hasDe = False} ; intYear i = lin NP i ; intMonthday i = lin NP i ; diff --git a/src/chinese/NounChi.gf b/src/chinese/NounChi.gf index 9277ce35d..4a4a330b4 100644 --- a/src/chinese/NounChi.gf +++ b/src/chinese/NounChi.gf @@ -20,8 +20,8 @@ concrete NounChi of Noun = CatChi ** open ResChi, Prelude in { PPartNP np v2 = mkNP ((predV v2 v2.part).verb.s ++ possessive_s ++ np.s) ; ---- ?? - AdvNP np adv = mkNP (adv.s ++ possessiveIf adv.advType ++ np.s) ; - ExtAdvNP np adv = mkNP (adv.s ++ possessiveIf adv.advType ++ embedInCommas np.s) ; ---- commas? + AdvNP np adv = mkNP (adv.s ++ possessiveIf adv.hasDe ++ np.s) ; + ExtAdvNP np adv = mkNP (adv.s ++ possessiveIf adv.hasDe ++ embedInCommas np.s) ; ---- commas? DetQuant quant num = { s = case num.numType of { @@ -85,7 +85,7 @@ concrete NounChi of Noun = CatChi ** open ResChi, Prelude in { } ; RelCN cn rs = {s = rs.s ++ cn.s ; c = cn.c} ; - AdvCN cn ad = {s = ad.s ++ possessiveIf ad.advType ++ cn.s ; c = cn.c} ; + AdvCN cn ad = {s = ad.s ++ possessiveIf ad.hasDe ++ cn.s ; c = cn.c} ; SentCN cn cs = {s = cs.s ++ cn.s ; c = cn.c} ; ApposCN cn np = {s = np.s ++ cn.s ; c = cn.c} ; diff --git a/src/chinese/ParadigmsChi.gf b/src/chinese/ParadigmsChi.gf index 269bfbc44..6ec08c2f4 100644 --- a/src/chinese/ParadigmsChi.gf +++ b/src/chinese/ParadigmsChi.gf @@ -145,13 +145,13 @@ oper mkAdv = overload { mkAdv : Str -> Adv - = \s -> lin Adv {s = word s ; advType = getAdvType s} ; + = \s -> let at = getAdvType s in lin Adv {s = word s ; advType = at ; hasDe = advTypeHasDe at} ; mkAdv : Str -> Str -> Adv - = \s,t -> lin Adv {s = word (s + t) ; advType = getAdvType s} ; ---- + = \s,t -> let at = getAdvType s in lin Adv {s = word (s + t) ; advType = at ; hasDe = advTypeHasDe at} ; ---- mkAdv : Str -> AdvType -> Adv - = \s,at -> lin Adv {s = word s ; advType = at} ; + = \s,at -> lin Adv {s = word s ; advType = at ; hasDe = advTypeHasDe at} ; mkAdv : Adv -> AdvType -> Adv -- To fix the AdvType in an Adv produced by SyntaxChi.mkAdv - = \adv,at -> adv ** {advType = at} ; + = \adv,at -> adv ** {advType = at ; hasDe = advTypeHasDe at} ; } ; diff --git a/src/chinese/ResChi.gf b/src/chinese/ResChi.gf index ba96bceea..e30a87941 100644 --- a/src/chinese/ResChi.gf +++ b/src/chinese/ResChi.gf @@ -250,13 +250,19 @@ oper s = word s } ; - Preposition = {prepPre : Str ; prepPost : Str ; advType : AdvType} ; + Preposition = {prepPre : Str ; prepPost : Str ; advType : AdvType ; hasDe : Bool} ; mkPreposition : Str -> Str -> AdvType -> Preposition = \s1,s2,at -> { prepPre = word s1 ; prepPost = word s2 ; - advType = at + advType = at ; + hasDe = advTypeHasDe at ; } ; + + advTypeHasDe : AdvType -> Bool = \at -> case at of { + ATPoss => True ; + _ => False + } ; getAdvType : Str -> AdvType = \s -> case s of { "的" => ATPoss ; @@ -264,8 +270,8 @@ oper _ => ATPlace False -- uncertain whether ATPlace } ; - possessiveIf : AdvType -> Str = \at -> case at of { - ATPoss => [] ; --- to avoid double "de" + possessiveIf : Bool -> Str = \hasDe -> case hasDe of { + True => [] ; --- to avoid double "de" _ => possessive_s } ;