1
0
forked from GitHub/gf-rgl

add distinction between Attributive vs Predicative (esp for colours)

This commit is contained in:
1Regina
2022-01-03 15:54:05 +08:00
committed by Meowyam
parent cf9e2cdd7f
commit dd5b34492a
11 changed files with 172 additions and 159 deletions

View File

@@ -4,53 +4,56 @@ concrete AdjectiveChi of Adjective = CatChi ** open ResChi, Prelude in {
PositA a = a ** {hasAdA = False} ;
--ComparA a np = complexAP (a.s ++ than_s ++ np.s) ;
-- ComparA a np = complexAP (than_s ++ np.s ++ a.s) ;
ComparA a np = a ** {
s = table { adjPlace => than_s ++ np.s ++ a.s!adjPlace}
s = table { adjPlace => than_s ++ np.s ++ a.s!adjPlace};
hasAdA = False
};
--UseComparA a = complexAP (geng_s ++ a.s) ;
UseComparA a = geng ** {
s = table { adjPlace => geng.s!adjPlace ++ a.s}
UseComparA a = a ** {
s = table { adjPlace => geng_s ++ a.s!adjPlace};
hasAdA = False
};
-- AdjOrd ord = complexAP ord.s ;
AdjOrd ord = ord ** {
s = table {adjPlace => ord.s!adjPlace}
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}
};
-- CAdvAP ad ap np = complexAP (ap.s ++ ad.s ++ ad.p ++ np.s) ;
-- CAdvAP ad ap np = complexAP (ad.s++ np.s++ad.p++ap.s ) ; --modified by ChenPeng 11.24
CAdvAP ad ap np = ap ** {
s = table {adjPlace => ad.s ++ np.s ++ ad.p ++ ap.s!adjPlace}
};
-- ComplA2 a np = complexAP (appPrep a.c2 np.s ++ a.s) ;
ComplA2 a np = a ** {
s= table { adjPlace => appPrep a.c2 np.s ++ a.s!adjPlace}
s= table { adjPlace => appPrep a.c2 np.s ++ a.s!adjPlace};
hasAdA = False
};
-- ReflA2 a = complexAP (a.s ++ appPrep a.c2 reflPron) ;
ReflA2 a = a ** {
s = table {adjPlace => a.s!adjPlace ++ appPrep a.c2 reflPron}
s = table {adjPlace => a.s!adjPlace ++ appPrep a.c2 reflPron};
hasAdA = False
};
-- SentAP ap sc = complexAP (ap.s ++ sc.s) ;
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}
s = table { adjPlace => ada.s ++ ap.s ! adjPlace };
monoSyl = False;
hasAdA = True
};
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,13 +2,13 @@ concrete AdverbChi of Adverb = CatChi **
open ResChi, Prelude in {
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 ?
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 ++ s.s) ** {advType = ATManner ; hasDe = False} ;
AdAdv ad adv = adv ** {s = ad.s ++ adv.s} ;
@@ -16,6 +16,6 @@ concrete AdverbChi of Adverb = CatChi **
AdnCAdv cadv = ss (cadv.s ++ conjThat) ** {advType = ATManner ; hasDe = False} ; -----
PositAdAAdj a = {s = a.s} ; ----
PositAdAAdj a = {s = a.s!Attr} ; ----
}

View File

@@ -5,7 +5,7 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin
ConjS c = conjunctDistrSS (c.s ! CSent) ;
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 = 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) ;
ConjCN c ns = conjunctDistrSS (c.s ! CPhr CNPhrase) ns ** {c = ns.c} ;
@@ -17,8 +17,8 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin
ConsAdv x xs = consrSS duncomma x xs ** {advType = x.advType ; hasDe = xs.hasDe} ; ---- ??
BaseNP = twoSS ;
ConsNP = consrSS duncomma ;
BaseAP x y = twoSS x y ** {monoSyl = y.monoSyl} ;
ConsAP x xs = consrSS duncomma x xs ** {monoSyl = xs.monoSyl} ;
BaseAP x y = twoTable AdjPlace x y ** {monoSyl = y.monoSyl} ;
ConsAP x xs = consrTable AdjPlace 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?
@@ -28,7 +28,7 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin
[S] = {s1,s2 : Str} ;
[Adv] = {s1,s2 : Str ; advType : AdvType ; hasDe : Bool} ;
[NP] = {s1,s2 : Str} ;
[AP] = {s1,s2 : Str ; monoSyl : Bool} ;
[AP] = {s1,s2 : AdjPlace => Str ; monoSyl : Bool} ;
[RS] = {s1,s2 : Str} ;
[CN] = {s1,s2 : Str ; c : Str} ;

View File

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

View File

@@ -37,8 +37,8 @@ concrete ExtraChi of ExtraChiAbs = CatChi **
Aspect = {s : Str ; a : ResChi.Aspect} ;
lin
CompBareAP ap = case ap.hasAdA of {
True => insertObj (mkNP ap.s) (predV nocopula []) ;
False => insertObj (mkNP ap.s) (predV hen_copula [])
True => insertObj (mkNP (ap.s!Pred)) (predV nocopula []) ;
False => insertObj (mkNP (ap.s!Pred)) (predV hen_copula [])
} ;
QuestRepV cl = {
s = \\_,p,a => ---- also for indirect questions?

View File

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

View File

@@ -63,8 +63,8 @@ concrete NounChi of Noun = CatChi ** open ResChi, Prelude in {
AdNum adn num = {s = adn.s ++ num.s ; hasC = True} ;
OrdSuperl a = {s = superlative_s ++ a.s} ;
OrdNumeralSuperl n a = {s = ordinal_s ++ n.s ++ superlative_s ++ a.s} ; ---- to check AR 24/8/2014
OrdSuperl a = {s = superlative_s ++ a.s ! Attr} ;
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
IndefArt = mkQuant yi_s [] DTNum ; -- (DTFull Sg) ; -- empty in the plural
@@ -80,8 +80,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} ;
AdjCN ap cn = case ap.monoSyl of {
True => {s = ap.s ++ cn.s ; c = cn.c} ;
False => {s = ap.s ++ possessive_s ++ cn.s ; c = cn.c}
True => {s = ap.s ! Attr ++ 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} ;

View File

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

View File

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

View File

@@ -99,7 +99,6 @@ param
AdjPlace = Attr | Pred ; -- a green cat / the cat is green colour
-- parts of speech
oper
VP = {
@@ -134,6 +133,16 @@ oper
_ => mkAdj s False
} ;
colourAdj : Str -> Adj = \s -> {
s = table {
Attr => word s ;
Pred => word s ++ "色"
};
monoSyl = case s of {
? => True ;
_ => False }
};
copula : Verb = mkVerb "是" [] [] [] [] "不" ;
hen_copula : Verb =
{s = hen_s ; sn = [] ; pp = [] ; ds = [] ; dp = [] ; ep = [] ; neg = "不"} ; ---

View File

@@ -10,7 +10,7 @@ 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
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} ;
SlashV2S v s = insertObj (ss (say_s ++ s.s)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
@@ -25,7 +25,7 @@ concrete VerbChi of Verb = CatChi ** open ResChi, Prelude in {
ComplVS v s = insertObj s (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 {
--- 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) ; ----
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 {