forked from GitHub/gf-rgl
fixed the use of de in Chi Adv
This commit is contained in:
@@ -2,19 +2,19 @@ concrete AdverbChi of Adverb = CatChi **
|
|||||||
open ResChi, Prelude in {
|
open ResChi, Prelude in {
|
||||||
|
|
||||||
lin
|
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} ; ----
|
PositAdAAdj a = {s = a.s} ; ----
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ concrete CatChi of Cat = CommonX - [Tense, Temp, Ant, Adv] ** open ResChi, Prelu
|
|||||||
Ord = {s : Str} ;
|
Ord = {s : Str} ;
|
||||||
Num = {s : Str ; numType : NumType} ;
|
Num = {s : Str ; numType : NumType} ;
|
||||||
|
|
||||||
Adv = {s : Str ; advType : AdvType} ;
|
Adv = {s : Str ; advType : AdvType ; hasDe : Bool} ;
|
||||||
|
|
||||||
-- Numeral
|
-- Numeral
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin
|
|||||||
lin
|
lin
|
||||||
|
|
||||||
ConjS c = conjunctDistrSS (c.s ! CSent) ;
|
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) ;
|
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) ;
|
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} ;
|
||||||
|
|
||||||
@@ -13,12 +13,12 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin
|
|||||||
|
|
||||||
BaseS = twoSS ;
|
BaseS = twoSS ;
|
||||||
ConsS = consrSS duncomma ;
|
ConsS = consrSS duncomma ;
|
||||||
BaseAdv x y = twoSS x y ** {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} ; ---- ??
|
ConsAdv x xs = consrSS duncomma x xs ** {advType = x.advType ; hasDe = xs.hasDe} ; ---- ??
|
||||||
BaseNP = twoSS ;
|
BaseNP = twoSS ;
|
||||||
ConsNP = consrSS duncomma ;
|
ConsNP = consrSS duncomma ;
|
||||||
BaseAP = twoSS ;
|
BaseAP x y = twoSS x y ** {monoSyl = y.monoSyl} ;
|
||||||
ConsAP = consrSS duncomma ;
|
ConsAP x xs = consrSS 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?
|
||||||
@@ -26,9 +26,9 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin
|
|||||||
|
|
||||||
lincat
|
lincat
|
||||||
[S] = {s1,s2 : Str} ;
|
[S] = {s1,s2 : Str} ;
|
||||||
[Adv] = {s1,s2 : Str ; advType : AdvType} ;
|
[Adv] = {s1,s2 : Str ; advType : AdvType ; hasDe : Bool} ;
|
||||||
[NP] = {s1,s2 : Str} ;
|
[NP] = {s1,s2 : Str} ;
|
||||||
[AP] = {s1,s2 : Str} ;
|
[AP] = {s1,s2 : Str ; monoSyl : Bool} ;
|
||||||
[RS] = {s1,s2 : Str} ;
|
[RS] = {s1,s2 : Str} ;
|
||||||
[CN] = {s1,s2 : Str ; c : Str} ;
|
[CN] = {s1,s2 : Str ; c : Str} ;
|
||||||
|
|
||||||
|
|||||||
@@ -36,16 +36,16 @@ lincat
|
|||||||
Month = N ;
|
Month = N ;
|
||||||
Year = NP ;
|
Year = NP ;
|
||||||
lin
|
lin
|
||||||
weekdayPunctualAdv 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} ;
|
weekdayHabitualAdv w = lin Adv {s = w.s ; advType = timeAdvType ; hasDe = False} ;
|
||||||
weekdayNextAdv w = lin Adv {s = "下" ++ w.s ; advType = timeAdvType} ;
|
weekdayNextAdv w = lin Adv {s = "下" ++ w.s ; advType = timeAdvType ; hasDe = False} ;
|
||||||
weekdayLastAdv w = lin Adv {s = "上" ++ w.s ; advType = timeAdvType} ;
|
weekdayLastAdv w = lin Adv {s = "上" ++ w.s ; advType = timeAdvType ; hasDe = False} ;
|
||||||
|
|
||||||
monthAdv m = lin Adv {s = m.s ; advType = timeAdvType} ;
|
monthAdv m = lin Adv {s = m.s ; advType = timeAdvType ; hasDe = False} ;
|
||||||
yearAdv y = lin Adv {s = y.s ++ "年" ; advType = timeAdvType} ;
|
yearAdv y = lin Adv {s = y.s ++ "年" ; advType = timeAdvType ; hasDe = False} ;
|
||||||
dayMonthAdv d m = lin Adv {s = m.s ++ d.s ++ "日" ; advType = timeAdvType} ;
|
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} ;
|
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} ;
|
dayMonthYearAdv d m y = lin Adv {s = y.s ++ "年" ++ m.s ++ d.s ++ "日" ; advType = timeAdvType ; hasDe = False} ;
|
||||||
|
|
||||||
intYear i = lin NP i ;
|
intYear i = lin NP i ;
|
||||||
intMonthday i = lin NP i ;
|
intMonthday i = lin NP i ;
|
||||||
|
|||||||
@@ -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) ; ---- ??
|
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) ;
|
AdvNP np adv = mkNP (adv.s ++ possessiveIf adv.hasDe ++ np.s) ;
|
||||||
ExtAdvNP np adv = mkNP (adv.s ++ possessiveIf adv.advType ++ embedInCommas np.s) ; ---- commas?
|
ExtAdvNP np adv = mkNP (adv.s ++ possessiveIf adv.hasDe ++ embedInCommas np.s) ; ---- commas?
|
||||||
|
|
||||||
DetQuant quant num = {
|
DetQuant quant num = {
|
||||||
s = case num.numType of {
|
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} ;
|
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} ;
|
SentCN cn cs = {s = cs.s ++ cn.s ; c = cn.c} ;
|
||||||
ApposCN cn np = {s = np.s ++ cn.s ; c = cn.c} ;
|
ApposCN cn np = {s = np.s ++ cn.s ; c = cn.c} ;
|
||||||
|
|
||||||
|
|||||||
@@ -145,13 +145,13 @@ oper
|
|||||||
|
|
||||||
mkAdv = overload {
|
mkAdv = overload {
|
||||||
mkAdv : Str -> Adv
|
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
|
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
|
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
|
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} ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -250,13 +250,19 @@ oper
|
|||||||
s = word s
|
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 -> {
|
mkPreposition : Str -> Str -> AdvType -> Preposition = \s1,s2,at -> {
|
||||||
prepPre = word s1 ;
|
prepPre = word s1 ;
|
||||||
prepPost = word s2 ;
|
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 {
|
getAdvType : Str -> AdvType = \s -> case s of {
|
||||||
"的" => ATPoss ;
|
"的" => ATPoss ;
|
||||||
@@ -264,8 +270,8 @@ oper
|
|||||||
_ => ATPlace False -- uncertain whether ATPlace
|
_ => ATPlace False -- uncertain whether ATPlace
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
possessiveIf : AdvType -> Str = \at -> case at of {
|
possessiveIf : Bool -> Str = \hasDe -> case hasDe of {
|
||||||
ATPoss => [] ; --- to avoid double "de"
|
True => [] ; --- to avoid double "de"
|
||||||
_ => possessive_s
|
_ => possessive_s
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user