1
0
forked from GitHub/gf-rgl

fixed the use of de in Chi Adv

This commit is contained in:
Aarne Ranta
2018-05-27 10:11:46 +02:00
parent 8ae61cc1a8
commit b3eeee54ce
7 changed files with 42 additions and 36 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -250,12 +250,18 @@ 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 {
@@ -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
} ;