mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 08:58:55 -06:00
Merge branch 'GrammaticalFramework:master' into master
This commit is contained in:
@@ -7,8 +7,6 @@ Aarne Ranta
|
|||||||
The following table gives the languages currently available in the
|
The following table gives the languages currently available in the
|
||||||
GF Resource Grammar Library.
|
GF Resource Grammar Library.
|
||||||
|
|
||||||
For another view, see the
|
|
||||||
[The Resource Grammar Library coverage map http://www.postcrashgames.com/gf_world/] .
|
|
||||||
|
|
||||||
Corrections and additions are welcome! Notice that only those parts of implementations
|
Corrections and additions are welcome! Notice that only those parts of implementations
|
||||||
that are currently available via https://github.com/GrammaticalFramework/gf-rgl/
|
that are currently available via https://github.com/GrammaticalFramework/gf-rgl/
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ the library, view all functions in a module's scope, and quickly jump to their d
|
|||||||
Other relevant documents:
|
Other relevant documents:
|
||||||
- [The RGL Status Document ../status.html]: the current status of different languages
|
- [The RGL Status Document ../status.html]: the current status of different languages
|
||||||
and the authors of each grammar
|
and the authors of each grammar
|
||||||
- [The Resource Grammar Library coverage map http://www.postcrashgames.com/gf_world/]
|
|
||||||
- [RGL Documentation and Publications ../rgl-publications.html]: links to publications and other documentation
|
- [RGL Documentation and Publications ../rgl-publications.html]: links to publications and other documentation
|
||||||
- [More modules ../gfdoc/sources.html]: extra modules, dictionaries, and
|
- [More modules ../gfdoc/sources.html]: extra modules, dictionaries, and
|
||||||
the internals of the resource grammar
|
the internals of the resource grammar
|
||||||
|
|||||||
@@ -290,6 +290,10 @@ fun UseDAP : DAP -> NP ;
|
|||||||
|
|
||||||
cat X ; -- for words that are difficult to classify, mainly for MorphoDict
|
cat X ; -- for words that are difficult to classify, mainly for MorphoDict
|
||||||
|
|
||||||
|
fun
|
||||||
|
UseComp_estar : Comp -> VP ; -- esta lleno, as opposed to es lleno
|
||||||
|
UseComp_ser : Comp -> VP ; -- es lleno, as opposed to esta lleno
|
||||||
|
|
||||||
fun
|
fun
|
||||||
CardCNCard : Card -> CN -> Card ; -- three million, four lakh, six dozen etc
|
CardCNCard : Card -> CN -> Card ; -- three million, four lakh, six dozen etc
|
||||||
|
|
||||||
|
|||||||
@@ -300,6 +300,9 @@ lin UseDAP dap = {
|
|||||||
p = NounP3 dap.p
|
p = NounP3 dap.p
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
lin UseComp_estar = UseComp ;
|
||||||
|
UseComp_ser = UseComp ;
|
||||||
|
|
||||||
lin GivenName = \n -> {
|
lin GivenName = \n -> {
|
||||||
s = n.s ;
|
s = n.s ;
|
||||||
gn = GSg (sex2gender n.g)
|
gn = GSg (sex2gender n.g)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ concrete AdjectiveChi of Adjective = CatChi ** open ResChi, Prelude in {
|
|||||||
PositA a = a ** {hasAdA = False} ;
|
PositA a = a ** {hasAdA = False} ;
|
||||||
|
|
||||||
ComparA a np = a ** {
|
ComparA a np = a ** {
|
||||||
s = table {_=> than_s ++ np.s ++ a.s!Attr};
|
s = table {_=> than_s ++ linNP np ++ a.s!Attr};
|
||||||
hasAdA = False
|
hasAdA = False
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -26,11 +26,11 @@ concrete AdjectiveChi of Adjective = CatChi ** open ResChi, Prelude in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
CAdvAP ad ap np = ap ** {
|
CAdvAP ad ap np = ap ** {
|
||||||
s = table {adjPlace => ad.s ++ np.s ++ ad.p ++ ap.s!adjPlace}
|
s = table {adjPlace => ad.s ++ linNP np ++ ad.p ++ ap.s!adjPlace}
|
||||||
};
|
};
|
||||||
|
|
||||||
ComplA2 a np = a ** {
|
ComplA2 a np = a ** {
|
||||||
s= table { adjPlace => appPrep a.c2 np.s ++ a.s!adjPlace};
|
s= table { adjPlace => appPrep a.c2 (linNP np) ++ a.s!adjPlace};
|
||||||
hasAdA = False
|
hasAdA = False
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ concrete AdverbChi of Adverb = CatChi **
|
|||||||
lin
|
lin
|
||||||
PositAdvAdj a = {s = a.s!Attr ++ "地" ; 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 ?
|
PrepNP prep np = ss (appPrep prep (linNP np)) ** {advType = prep.advType ; hasDe = prep.hasDe} ; --- should depend on np too ?
|
||||||
|
|
||||||
ComparAdvAdj cadv a np = ss (a.s!Attr ++ cadv.s ++ cadv.p ++ np.s) ** {advType = ATManner ; hasDe = False} ;
|
ComparAdvAdj cadv a np = ss (a.s!Attr ++ cadv.s ++ cadv.p ++ (linNP np)) ** {advType = ATManner ; hasDe = False} ;
|
||||||
|
|
||||||
ComparAdvAdjS cadv a s = ss (a.s!Attr ++ cadv.s ++ cadv.p ++ linS s) ** {advType = ATManner ; hasDe = False} ;
|
ComparAdvAdjS cadv a s = ss (a.s!Attr ++ cadv.s ++ cadv.p ++ linS s) ** {advType = ATManner ; hasDe = False} ;
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ concrete CatChi of Cat = CommonX - [Tense, Temp, Ant, Adv] ** open ResChi, Prelu
|
|||||||
-- Noun
|
-- Noun
|
||||||
|
|
||||||
CN = ResChi.Noun ;
|
CN = ResChi.Noun ;
|
||||||
NP, Pron = ResChi.NP ;
|
NP = ResChi.NP ;
|
||||||
|
Pron = SS ;
|
||||||
Det = Determiner ;
|
Det = Determiner ;
|
||||||
Quant = Determiner ** {pl : Str} ;
|
Quant = Determiner ** {pl : Str} ;
|
||||||
Predet = {s : Str} ; ----
|
Predet = {s : Str} ; ----
|
||||||
@@ -79,7 +80,7 @@ concrete CatChi of Cat = CommonX - [Tense, Temp, Ant, Adv] ** open ResChi, Prelu
|
|||||||
N = ResChi.Noun ;
|
N = ResChi.Noun ;
|
||||||
N2 = ResChi.Noun ** {c2 : Preposition} ;
|
N2 = ResChi.Noun ** {c2 : Preposition} ;
|
||||||
N3 = ResChi.Noun ** {c2,c3 : Preposition} ;
|
N3 = ResChi.Noun ** {c2,c3 : Preposition} ;
|
||||||
GN, SN, PN = ResChi.NP ;
|
GN, SN, PN = SS ;
|
||||||
|
|
||||||
-- overridden
|
-- overridden
|
||||||
|
|
||||||
@@ -91,4 +92,5 @@ linref
|
|||||||
S = linS ;
|
S = linS ;
|
||||||
Prep = linPrep ;
|
Prep = linPrep ;
|
||||||
VP = infVP ;
|
VP = infVP ;
|
||||||
|
NP = \np -> np.det ++ np.s ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin
|
|||||||
postJiu = ss.postJiu}
|
postJiu = ss.postJiu}
|
||||||
} ;
|
} ;
|
||||||
ConjAdv c as = conjunctDistrSS (c.s ! CSent) as ** {advType = as.advType ; hasDe = as.hasDe} ; ---- ??
|
ConjAdv c as = conjunctDistrSS (c.s ! CSent) as ** {advType = as.advType ; hasDe = as.hasDe} ; ---- ??
|
||||||
ConjNP c = conjunctDistrSS (c.s ! CPhr CNPhrase) ;
|
ConjNP c nps = conjunctDistrSS (c.s ! CPhr CNPhrase) nps ** {det = []} ;
|
||||||
ConjAP c as = conjunctDistrTable AdjPlace (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) ;
|
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} ;
|
||||||
@@ -28,8 +28,8 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin
|
|||||||
|
|
||||||
BaseAdv x y = twoSS x y ** {advType = x.advType ; hasDe = y.hasDe} ; ---- ??
|
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} ; ---- ??
|
ConsAdv x xs = consrSS duncomma x xs ** {advType = x.advType ; hasDe = xs.hasDe} ; ---- ??
|
||||||
BaseNP = twoSS ;
|
BaseNP np1 np2 = twoSS (mergeNP np1) (mergeNP np2) ;
|
||||||
ConsNP = consrSS duncomma ;
|
ConsNP np nps = consrSS duncomma (mergeNP np) nps ;
|
||||||
BaseAP x y = twoTable AdjPlace x y ** {monoSyl = y.monoSyl} ;
|
BaseAP x y = twoTable AdjPlace x y ** {monoSyl = y.monoSyl} ;
|
||||||
ConsAP x xs = consrTable AdjPlace duncomma x xs ** {monoSyl = xs.monoSyl} ;
|
ConsAP x xs = consrTable AdjPlace duncomma x xs ** {monoSyl = xs.monoSyl} ;
|
||||||
BaseRS = twoSS ;
|
BaseRS = twoSS ;
|
||||||
@@ -46,5 +46,8 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin
|
|||||||
[RS] = {s1,s2 : Str} ;
|
[RS] = {s1,s2 : Str} ;
|
||||||
[CN] = {s1,s2 : Str ; c : Str} ;
|
[CN] = {s1,s2 : Str ; c : Str} ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
mergeNP : ResChi.NP -> SS = \np -> ss (linNP np) ;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ lin
|
|||||||
monthYearAdv m y = lin Adv {s = y.s ++ "年" ++ m.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} ;
|
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 (R.mkNP i.s) ;
|
||||||
intMonthday i = lin NP i ;
|
intMonthday i = lin NP (R.mkNP i.s) ;
|
||||||
|
|
||||||
lincat Language = N ;
|
lincat Language = N ;
|
||||||
|
|
||||||
|
|||||||
@@ -111,6 +111,24 @@ lin
|
|||||||
s2 = inflVerb verb
|
s2 = inflVerb verb
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
InflectionPN = \n -> {
|
||||||
|
t = "v" ;
|
||||||
|
s1 = heading1 "Proper Name" ;
|
||||||
|
s2 = n.s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionGN = \n -> {
|
||||||
|
t = "v" ;
|
||||||
|
s1 = heading1 "Given Name" ;
|
||||||
|
s2 = n.s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionSN = \n -> {
|
||||||
|
t = "v" ;
|
||||||
|
s1 = heading1 "Surname Name" ;
|
||||||
|
s2 = n.s
|
||||||
|
} ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
inflVerb : Verb -> Str = \verb ->
|
inflVerb : Verb -> Str = \verb ->
|
||||||
let vtbl = useVerb verb
|
let vtbl = useVerb verb
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ concrete ExtendChi of Extend = CatChi **
|
|||||||
, MkVPI2, BaseVPI2, ConsVPI2, ConjVPI2, ComplVPI2
|
, MkVPI2, BaseVPI2, ConsVPI2, ConjVPI2, ComplVPI2
|
||||||
, ProDrop, ComplDirectVS, ComplDirectVQ
|
, ProDrop, ComplDirectVS, ComplDirectVQ
|
||||||
, PassVPSlash, PassAgentVPSlash
|
, PassVPSlash, PassAgentVPSlash
|
||||||
, GerundAdv, GerundNP ]
|
, GerundAdv, GerundNP, ByVP ]
|
||||||
with (Grammar=GrammarChi) ** open
|
with (Grammar=GrammarChi) ** open
|
||||||
Prelude
|
Prelude
|
||||||
, Coordination
|
, Coordination
|
||||||
@@ -27,7 +27,7 @@ concrete ExtendChi of Extend = CatChi **
|
|||||||
|
|
||||||
lin
|
lin
|
||||||
PassVPSlash vps = insertAdv (mkNP passive_s) vps ;
|
PassVPSlash vps = insertAdv (mkNP passive_s) vps ;
|
||||||
PassAgentVPSlash vps np = insertAdv (ss (appPrep S.by8agent_Prep np.s)) (insertAdv (mkNP passive_s) vps) ;
|
PassAgentVPSlash vps np = insertAdv (ss (appPrep S.by8agent_Prep (linNP np))) (insertAdv (mkNP passive_s) vps) ;
|
||||||
|
|
||||||
MkVPS t p vp = {s = t.s ++ p.s ++ (mkClause [] vp).s ! p.p ! t.t} ;
|
MkVPS t p vp = {s = t.s ++ p.s ++ (mkClause [] vp).s ! p.p ! t.t} ;
|
||||||
ConjVPS c = conjunctDistrSS (c.s ! CSent) ;
|
ConjVPS c = conjunctDistrSS (c.s ! CSent) ;
|
||||||
@@ -35,16 +35,16 @@ concrete ExtendChi of Extend = CatChi **
|
|||||||
ConsVPS = consrSS duncomma ;
|
ConsVPS = consrSS duncomma ;
|
||||||
|
|
||||||
-- : NP -> VPS -> S ; -- she [has walked and won't sleep]
|
-- : NP -> VPS -> S ; -- she [has walked and won't sleep]
|
||||||
PredVPS np vps = {preJiu = np.s ; postJiu = vps.s} ;
|
PredVPS np vps = {preJiu = (linNP np) ; postJiu = vps.s} ;
|
||||||
|
|
||||||
-- : NP -> VPS -> QS ; -- has she walked
|
-- : NP -> VPS -> QS ; -- has she walked
|
||||||
SQuestVPS np vps = {s = \\_ => np.s ++ vps.s ++ question_s} ;
|
SQuestVPS np vps = {s = \\_ => linNP np ++ vps.s ++ question_s} ;
|
||||||
|
|
||||||
-- : IP -> VPS -> QS ; -- who has walked
|
-- : IP -> VPS -> QS ; -- who has walked
|
||||||
-- QuestVPS ip vps = -- TODO: probably need to change structure of VPS
|
-- QuestVPS ip vps = -- TODO: probably need to change structure of VPS
|
||||||
|
|
||||||
-- : RP -> VPS -> RS ; -- which won't sleep
|
-- : RP -> VPS -> RS ; -- which won't sleep
|
||||||
RelVPS rp vps = {s = rp.s ! True ++ vps.s} ;
|
RelVPS rp vps = {s = rp.s ! True ++ vps.s ++ "的"} ;
|
||||||
|
|
||||||
MkVPI vp = {s = (mkClause [] vp).s ! Pos ! APlain} ;
|
MkVPI vp = {s = (mkClause [] vp).s ! Pos ! APlain} ;
|
||||||
ConjVPI c = conjunctDistrSS (c.s ! CSent) ;
|
ConjVPI c = conjunctDistrSS (c.s ! CSent) ;
|
||||||
@@ -68,7 +68,11 @@ concrete ExtendChi of Extend = CatChi **
|
|||||||
GerundAdv vp = mkAdv (infVP vp) ;
|
GerundAdv vp = mkAdv (infVP vp) ;
|
||||||
GerundNP vp = ResChi.mkNP (infVP vp) ;
|
GerundNP vp = ResChi.mkNP (infVP vp) ;
|
||||||
|
|
||||||
GenNP np = {s,pl = np.s ++ possessive_s ; detType = DTPoss} ;
|
ByVP vp =
|
||||||
|
let adv : Adv = GerundAdv vp
|
||||||
|
in adv ** {s = adv.s ++ "来" ; advType = ATTime} ;
|
||||||
|
|
||||||
|
GenNP np = {s,pl = linNP np ++ possessive_s ; detType = DTPoss} ;
|
||||||
GenRP nu cn = {s = \\_ => cn.s ++ relative_s} ;
|
GenRP nu cn = {s = \\_ => cn.s ++ relative_s} ;
|
||||||
|
|
||||||
ProDrop pron = pron ** {s = []} ;
|
ProDrop pron = pron ** {s = []} ;
|
||||||
|
|||||||
@@ -11,21 +11,21 @@ concrete ExtraChi of ExtraChiAbs = CatChi **
|
|||||||
|
|
||||||
lin
|
lin
|
||||||
PassVPSlash vps = insertAdv (mkNP passive_s) vps ;
|
PassVPSlash vps = insertAdv (mkNP passive_s) vps ;
|
||||||
PassAgentVPSlash vps np = insertAdv (ss (appPrep S.by8agent_Prep np.s)) (insertAdv (mkNP passive_s) vps) ;
|
PassAgentVPSlash vps np = insertAdv (ss (appPrep S.by8agent_Prep (linNP np))) (insertAdv (mkNP passive_s) vps) ;
|
||||||
|
|
||||||
MkVPS t p vp = {s = t.s ++ p.s ++ (mkClause [] vp).s ! p.p ! t.t} ;
|
MkVPS t p vp = {s = t.s ++ p.s ++ (mkClause [] vp).s ! p.p ! t.t} ;
|
||||||
ConjVPS c = conjunctDistrSS (c.s ! CSent) ;
|
ConjVPS c = conjunctDistrSS (c.s ! CSent) ;
|
||||||
BaseVPS = twoSS ;
|
BaseVPS = twoSS ;
|
||||||
ConsVPS = consrSS duncomma ;
|
ConsVPS = consrSS duncomma ;
|
||||||
|
|
||||||
PredVPS np vps = {preJiu = np.s ; postJiu = vps.s} ;
|
PredVPS np vps = {preJiu = (linNP np) ; postJiu = vps.s} ;
|
||||||
|
|
||||||
MkVPI vp = {s = (mkClause [] vp).s ! Pos ! APlain} ; --- ?? almost just a copy of VPS
|
MkVPI vp = {s = (mkClause [] vp).s ! Pos ! APlain} ; --- ?? almost just a copy of VPS
|
||||||
ConjVPI c = conjunctDistrSS (c.s ! CSent) ;
|
ConjVPI c = conjunctDistrSS (c.s ! CSent) ;
|
||||||
BaseVPI = twoSS ;
|
BaseVPI = twoSS ;
|
||||||
ConsVPI = consrSS duncomma ;
|
ConsVPI = consrSS duncomma ;
|
||||||
|
|
||||||
GenNP np = {s,pl = np.s ++ possessive_s ; detType = DTPoss} ;
|
GenNP np = {s,pl = linNP np ++ possessive_s ; detType = DTPoss} ;
|
||||||
|
|
||||||
GenRP nu cn = {s = \\_ => cn.s ++ relative_s} ; ---- ??
|
GenRP nu cn = {s = \\_ => cn.s ++ relative_s} ; ---- ??
|
||||||
|
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ concrete IdiomChi of Idiom = CatChi ** open Prelude, ResChi in {
|
|||||||
-- GenericCl vp = mkClause "有人" vp ; (meaning: there is a person)
|
-- GenericCl vp = mkClause "有人" vp ; (meaning: there is a person)
|
||||||
|
|
||||||
---- it is John who did it
|
---- it is John who did it
|
||||||
CleftNP np rs = mkClause rs.s copula np.s ; -- did it + de + is I
|
CleftNP np rs = mkClause rs.s copula (linNP np) ; -- did it + de + is I
|
||||||
|
|
||||||
CleftAdv ad s = mkClause (linS s ++ possessive_s) copula ad.s ; -- she sleeps + de + is here
|
CleftAdv ad s = mkClause (linS s ++ possessive_s) copula ad.s ; -- she sleeps + de + is here
|
||||||
|
|
||||||
ExistNP np = mkClause [] (regVerb you_s) np.s ; ---- infl of you
|
ExistNP np = mkClause [] (regVerb you_s) (linNP np) ; ---- infl of you
|
||||||
|
|
||||||
ExistIP ip = {s = \\_ => (mkClause [] (regVerb you_s) ip.s).s} ; ---- infl of you
|
ExistIP ip = {s = \\_ => (mkClause [] (regVerb you_s) ip.s).s} ; ---- infl of you
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ concrete IdiomChi of Idiom = CatChi ** open Prelude, ResChi in {
|
|||||||
|
|
||||||
SelfAdvVP vp = insertAdv (ss reflPron) vp ;
|
SelfAdvVP vp = insertAdv (ss reflPron) vp ;
|
||||||
SelfAdVVP vp = insertAdv (ss reflPron) vp ;
|
SelfAdVVP vp = insertAdv (ss reflPron) vp ;
|
||||||
SelfNP np = {s = np.s ++ reflPron} ;
|
SelfNP np = np ** {s = linNP np ++ reflPron} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,28 +1,33 @@
|
|||||||
concrete NounChi of Noun = CatChi ** open ResChi, Prelude in {
|
concrete NounChi of Noun = CatChi ** open ResChi, Prelude in {
|
||||||
|
|
||||||
lin
|
lin
|
||||||
DetCN det cn = case det.detType of {
|
DetCN det cn = cn ** {
|
||||||
DTFull Sg => {s = det.s ++ cn.c ++ cn.s} ; -- this house
|
det = case det.detType of {
|
||||||
DTFull Pl => {s = det.s ++ xie_s ++ cn.s} ; -- these houses
|
DTFull Sg => det.s ++ cn.c ; -- this house
|
||||||
DTNum => {s = det.s ++ cn.c ++ cn.s} ; -- (these) five houses
|
DTFull Pl => det.s ++ xie_s ; -- these houses
|
||||||
DTPoss => {s = det.s ++ cn.s} -- our (five) houses
|
DTNum => det.s ++ cn.c ; -- (these) five houses
|
||||||
} ;
|
DTPoss => det.s -- our (five) houses
|
||||||
UsePN pn = pn ;
|
}
|
||||||
UsePron p = p ;
|
} ;
|
||||||
|
|
||||||
DetNP det = {s = case det.detType of {
|
UsePN pn = pn ** {det = []} ;
|
||||||
|
UsePron p = p ** {det = []} ;
|
||||||
|
|
||||||
|
DetNP det = {
|
||||||
|
s = [] ;
|
||||||
|
det = case det.detType of {
|
||||||
DTFull Pl => det.s ++ xie_s ;
|
DTFull Pl => det.s ++ xie_s ;
|
||||||
DTPoss => det.s ;
|
DTPoss => det.s ;
|
||||||
_ => det.s ++ ge_s
|
_ => det.s ++ ge_s
|
||||||
} ;
|
} ;
|
||||||
} ; ----
|
} ; ----
|
||||||
|
|
||||||
PredetNP pred np = mkNP (pred.s ++ np.s) ; ---- possessive_s ++ np.s) ;
|
PredetNP pred np = np ** {s = pred.s ++ np.s} ; ---- possessive_s ++ np.s) ;
|
||||||
|
|
||||||
PPartNP np v2 = mkNP ((predV v2 v2.part).verb.s ++ possessive_s ++ np.s) ; ---- ??
|
PPartNP np v2 = np ** {s = (predV v2 v2.part).verb.s ++ possessive_s ++ np.s} ; ---- ??
|
||||||
|
|
||||||
AdvNP np adv = mkNP (adv.s ++ possessiveIf adv.hasDe ++ np.s) ;
|
AdvNP np adv = np ** {s = adv.s ++ possessiveIf adv.hasDe ++ np.s} ;
|
||||||
ExtAdvNP np adv = mkNP (adv.s ++ possessiveIf adv.hasDe ++ embedInCommas np.s) ; ---- commas?
|
ExtAdvNP np adv = np ** {s = 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 {
|
||||||
@@ -70,15 +75,15 @@ concrete NounChi of Noun = CatChi ** open ResChi, Prelude in {
|
|||||||
DefArt = mkQuant [] [] DTPoss ; -- use that_Quant if you want the_s
|
DefArt = mkQuant [] [] DTPoss ; -- use that_Quant if you want the_s
|
||||||
IndefArt = mkQuant yi_s [] DTNum ; -- (DTFull Sg) ; -- empty in the plural
|
IndefArt = mkQuant yi_s [] DTNum ; -- (DTFull Sg) ; -- empty in the plural
|
||||||
|
|
||||||
MassNP cn = cn ;
|
MassNP cn = mkNP cn.s ;
|
||||||
|
|
||||||
UseN n = n ;
|
UseN n = n ;
|
||||||
UseN2 n = n ;
|
UseN2 n = n ;
|
||||||
Use2N3 f = {s = f.s ; c = f.c ; c2 = f.c2} ;
|
Use2N3 f = {s = f.s ; c = f.c ; c2 = f.c2} ;
|
||||||
Use3N3 f = {s = f.s ; c = f.c ; c2 = f.c3} ;
|
Use3N3 f = {s = f.s ; c = f.c ; c2 = f.c3} ;
|
||||||
|
|
||||||
ComplN2 f x = {s = appPrep f.c2 x.s ++ f.s ; c = f.c} ;
|
ComplN2 f x = {s = appPrep f.c2 (linNP x) ++ f.s ; c = f.c} ;
|
||||||
ComplN3 f x = {s = appPrep f.c2 x.s ++ f.s ; c = f.c ; c2 = f.c3} ;
|
ComplN3 f x = {s = appPrep f.c2 (linNP x) ++ f.s ; c = f.c ; c2 = f.c3} ;
|
||||||
|
|
||||||
AdjCN ap cn = case ap.monoSyl of {
|
AdjCN ap cn = case ap.monoSyl of {
|
||||||
True => {s = ap.s ! Attr ++ cn.s ; c = cn.c} ;
|
True => {s = ap.s ! Attr ++ cn.s ; c = cn.c} ;
|
||||||
@@ -88,13 +93,13 @@ 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.hasDe ++ 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 = linNP np ++ cn.s ; c = cn.c} ;
|
||||||
|
|
||||||
RelNP np rs = mkNP (rs.s ++ np.s) ;
|
RelNP np rs = np ** {s = rs.s ++ np.s} ;
|
||||||
|
|
||||||
PossNP cn np = {s = np.s ++ possessive_s ++ cn.s ; c = cn.c} ;
|
PossNP cn np = {s = linNP np ++ possessive_s ++ cn.s ; c = cn.c} ;
|
||||||
PartNP cn np = {s = np.s ++ possessive_s ++ cn.s ; c = cn.c} ;
|
PartNP cn np = {s = linNP np ++ possessive_s ++ cn.s ; c = cn.c} ;
|
||||||
|
|
||||||
CountNP det np = {s = det.s ++ ge_s ++ possessive_s ++ np.s} ; --- classifier from NP?
|
CountNP det np = np ** {det = det.s ++ ge_s ++ possessive_s ++ np.det} ; --- classifier from NP?
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ oper
|
|||||||
emptyPrep : Preposition = mkPrep [] ;
|
emptyPrep : Preposition = mkPrep [] ;
|
||||||
|
|
||||||
mkpNP : Str -> CatChi.NP
|
mkpNP : Str -> CatChi.NP
|
||||||
= \s -> lin NP {s = word s} ;
|
= \s -> lin NP {s = word s ; det = []} ;
|
||||||
mkAdV : Str -> AdV
|
mkAdV : Str -> AdV
|
||||||
= \s -> lin AdV {s = word s} ;
|
= \s -> lin AdV {s = word s} ;
|
||||||
mkAdN : Str -> AdN
|
mkAdN : Str -> AdN
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ concrete PhraseChi of Phrase = CatChi ** open Prelude, ResChi in {
|
|||||||
|
|
||||||
UttIP ip = ip ;
|
UttIP ip = ip ;
|
||||||
UttIAdv iadv = iadv ;
|
UttIAdv iadv = iadv ;
|
||||||
UttNP np = np ;
|
UttNP np = ss (linNP np) ;
|
||||||
UttCN cn = cn ;
|
UttCN cn = cn ;
|
||||||
UttAP ap = {s = ap.s!Attr} ;
|
UttAP ap = {s = ap.s!Attr} ;
|
||||||
UttCard x = x ;
|
UttCard x = x ;
|
||||||
@@ -23,6 +23,6 @@ concrete PhraseChi of Phrase = CatChi ** open Prelude, ResChi in {
|
|||||||
PConjConj conj = ss (conj.s ! CSent).s2 ;
|
PConjConj conj = ss (conj.s ! CSent).s2 ;
|
||||||
|
|
||||||
NoVoc = {s = []} ;
|
NoVoc = {s = []} ;
|
||||||
VocNP np = {s = np.s ++ chcomma} ; ---- ??
|
VocNP np = {s = linNP np ++ chcomma} ; ---- ??
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,11 +14,11 @@ concrete QuestionChi of Question = CatChi **
|
|||||||
s = \\_,p,a => ip.s ++ vp.prePart ++ useVerb vp.verb ! p ! a ++ vp.compl
|
s = \\_,p,a => ip.s ++ vp.prePart ++ useVerb vp.verb ! p ! a ++ vp.compl
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
QuestSlash ip cls = {s = \\_ => (mkClauseCompl cls.np (insertObj (ss (appPrep cls.c2 ip.s)) cls.vp) []).s} ;
|
QuestSlash ip cls = {s = \\_ => (mkClauseCompl cls.np (insertObj (mkNP (appPrep cls.c2 ip.s)) cls.vp) []).s} ;
|
||||||
|
|
||||||
QuestIAdv iadv cl = {s = \\_ => (mkClauseCompl cl.np (insertAdv iadv cl.vp) []).s} ;
|
QuestIAdv iadv cl = {s = \\_ => (mkClauseCompl cl.np (insertAdv iadv cl.vp) []).s} ;
|
||||||
|
|
||||||
QuestIComp icomp np = {s = \\_,p,a => np.s ++ icomp.s} ; ---- order
|
QuestIComp icomp np = {s = \\_,p,a => linNP np ++ icomp.s} ; ---- order
|
||||||
|
|
||||||
PrepIP p ip = ss (appPrep p ip.s) ;
|
PrepIP p ip = ss (appPrep p ip.s) ;
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ concrete RelativeChi of Relative = CatChi ** open ResChi, Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
} ; ---- ??
|
} ; ---- ??
|
||||||
RelSlash rp slash = {s = \\p,a => slash.s ! p ! a ++ appPrep slash.c2 (rp.s ! False)} ;
|
RelSlash rp slash = {s = \\p,a => slash.s ! p ! a ++ appPrep slash.c2 (rp.s ! False)} ;
|
||||||
FunRP p np rp = {s = \\a => appPrep p np.s ++ rp.s ! a} ; ---- ??
|
FunRP p np rp = {s = \\a => appPrep p (linNP np) ++ rp.s ! a} ; ---- ??
|
||||||
IdRP = {s = table {True => [] ; False => relative_s}} ;
|
IdRP = {s = table {True => [] ; False => relative_s}} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,7 +112,8 @@ oper
|
|||||||
isAdj : Bool ; -- whether it is an adjectival predication and behaves differently in relative
|
isAdj : Bool ; -- whether it is an adjectival predication and behaves differently in relative
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
NP = {s : Str} ;
|
NP = {det,s : Str} ; -- keep Det separate, because RelNP may put in a RS and that goes before the Det
|
||||||
|
linNP : NP -> Str = \np -> np.det ++ np.s ;
|
||||||
|
|
||||||
-- for morphology
|
-- for morphology
|
||||||
|
|
||||||
@@ -192,11 +193,11 @@ oper
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertObj : NP -> VP -> VP = \np,vp -> vp ** {
|
insertObj : NP -> VP -> VP = \np,vp -> vp ** {
|
||||||
compl = np.s ++ vp.compl ;
|
compl = linNP np ++ vp.compl ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertObjPost : NP -> VP -> VP = \np,vp -> vp ** {
|
insertObjPost : NP -> VP -> VP = \np,vp -> vp ** {
|
||||||
compl = vp.compl ++ np.s ;
|
compl = vp.compl ++ linNP np ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertAdv : SS -> VP -> VP = \adv,vp -> vp ** {
|
insertAdv : SS -> VP -> VP = \adv,vp -> vp ** {
|
||||||
@@ -215,7 +216,7 @@ oper
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertExtra : SS -> VP -> VP = \ext,vp ->
|
insertExtra : SS -> VP -> VP = \ext,vp ->
|
||||||
insertObjPost ext vp ;
|
insertObjPost (mkNP ext.s) vp ;
|
||||||
|
|
||||||
-- clauses: keep np and vp separate to enable insertion of IAdv
|
-- clauses: keep np and vp separate to enable insertion of IAdv
|
||||||
|
|
||||||
@@ -250,7 +251,7 @@ oper
|
|||||||
mkClauseCompl : Str -> VP -> Str -> Clause = \np,vp,compl -> {
|
mkClauseCompl : Str -> VP -> Str -> Clause = \np,vp,compl -> {
|
||||||
s = \\p,a => vp.topic ++ np ++ vp.prePart ++ useVerb vp.verb ! p ! a ++ vp.compl ++ compl ;
|
s = \\p,a => vp.topic ++ np ++ vp.prePart ++ useVerb vp.verb ! p ! a ++ vp.compl ++ compl ;
|
||||||
np = vp.topic ++ np ;
|
np = vp.topic ++ np ;
|
||||||
vp = insertObj (ss compl) vp ;
|
vp = insertObj (mkNP compl) vp ;
|
||||||
postJiu = \\p,a => vp.prePart ++ useVerb vp.verb ! p ! a ++ vp.compl ++ compl ;
|
postJiu = \\p,a => vp.prePart ++ useVerb vp.verb ! p ! a ++ vp.compl ++ compl ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -278,7 +279,8 @@ oper
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
pronNP : (s : Str) -> NP = \s -> {
|
pronNP : (s : Str) -> NP = \s -> {
|
||||||
s = word s
|
s = word s ;
|
||||||
|
det = []
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
Preposition = {prepPre : Str ; prepPost : Str ; advType : AdvType ; hasDe : Bool} ;
|
Preposition = {prepPre : Str ; prepPost : Str ; advType : AdvType ; hasDe : Bool} ;
|
||||||
@@ -316,7 +318,7 @@ oper
|
|||||||
|
|
||||||
-- added by AR
|
-- added by AR
|
||||||
|
|
||||||
mkNP : Str -> NP = ss ; -- not to be used in lexicon building
|
mkNP : Str -> NP = \s -> {s = s ; det = []} ; -- not to be used in lexicon building
|
||||||
|
|
||||||
appPrep : Preposition -> Str -> Str = \prep,s ->
|
appPrep : Preposition -> Str -> Str = \prep,s ->
|
||||||
prep.prepPre ++ s ++ prep.prepPost ;
|
prep.prepPre ++ s ++ prep.prepPost ;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ concrete SentenceChi of Sentence = CatChi **
|
|||||||
|
|
||||||
lin
|
lin
|
||||||
|
|
||||||
PredVP np vp = mkClause np.s vp ;
|
PredVP np vp = mkClause (linNP np) vp ;
|
||||||
|
|
||||||
PredSCVP sc vp = mkClause sc.s vp ;
|
PredSCVP sc vp = mkClause sc.s vp ;
|
||||||
|
|
||||||
@@ -17,10 +17,10 @@ concrete SentenceChi of Sentence = CatChi **
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
SlashVP np vp =
|
SlashVP np vp =
|
||||||
mkClauseCompl np.s vp []
|
mkClauseCompl (linNP np) vp []
|
||||||
** {c2 = vp.c2} ;
|
** {c2 = vp.c2} ;
|
||||||
|
|
||||||
SlashVS np vs sslash = <mkClause np.s vs sslash.s : Clause> ** {c2 = sslash.c2} ;
|
SlashVS np vs sslash = <mkClause (linNP np) vs sslash.s : Clause> ** {c2 = sslash.c2} ;
|
||||||
|
|
||||||
|
|
||||||
-- yet another reason for discontinuity of clauses
|
-- yet another reason for discontinuity of clauses
|
||||||
|
|||||||
@@ -142,8 +142,8 @@ either7or_DConj = {s = table { -- modified by chenpeng 11.19
|
|||||||
conjType = NotJiu ;
|
conjType = NotJiu ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
everybody_NP = ssword "每个人" ; -- [mark] "每个人": 每(every)+个(classifier)+人(person)
|
everybody_NP = mkNP (ssword "每个人").s ; -- [mark] "每个人": 每(every)+个(classifier)+人(person)
|
||||||
everything_NP = ssword "每件事" ; -- [mark] "每件事": 每(every)+件(classifier)+事(thing)
|
everything_NP = mkNP (ssword "每件事").s ; -- [mark] "每件事": 每(every)+件(classifier)+事(thing)
|
||||||
everywhere_Adv = mkAdv "到处" ;
|
everywhere_Adv = mkAdv "到处" ;
|
||||||
here7from_Adv = mkAdv "从这里" ; -- from here
|
here7from_Adv = mkAdv "从这里" ; -- from here
|
||||||
here7to_Adv = mkAdv "到这里" ; -- to here
|
here7to_Adv = mkAdv "到这里" ; -- to here
|
||||||
@@ -161,13 +161,13 @@ if_then_Conj = {s = table { -- added by chenpeng 11.19
|
|||||||
} ;
|
} ;
|
||||||
conjType = Jiu ;
|
conjType = Jiu ;
|
||||||
} ;
|
} ;
|
||||||
nobody_NP = ssword "没人" ;
|
nobody_NP = mkNP (ssword "没人").s ;
|
||||||
nothing_NP = ssword "没有什么" ;
|
nothing_NP = mkNP (ssword "没有什么").s ;
|
||||||
on_Prep = mkPrep "在" "上" ;
|
on_Prep = mkPrep "在" "上" ;
|
||||||
only_Predet = ssword "只有" ; -- only John
|
only_Predet = ssword "只有" ; -- only John
|
||||||
so_AdA = ssword "如此" ;
|
so_AdA = ssword "如此" ;
|
||||||
somebody_NP = ssword "某人" ;
|
somebody_NP = mkNP (ssword "某人").s ;
|
||||||
something_NP = ssword "某事" ; -- [mark] in sent, it depends on the context
|
something_NP = mkNP (ssword "某事").s ; -- [mark] in sent, it depends on the context
|
||||||
somewhere_Adv = mkAdv "某处" ;
|
somewhere_Adv = mkAdv "某处" ;
|
||||||
that_Subj = mkSubj [] chcomma ; -- that + S [mark] comma
|
that_Subj = mkSubj [] chcomma ; -- that + S [mark] comma
|
||||||
there7from_Adv = mkAdv "从那里" ; -- from there
|
there7from_Adv = mkAdv "从那里" ; -- from there
|
||||||
|
|||||||
@@ -11,12 +11,12 @@ concrete SymbolChi of Symbol = CatChi ** open Prelude, ResChi in {
|
|||||||
NumPN i = i ;
|
NumPN i = i ;
|
||||||
CNIntNP cn i = {
|
CNIntNP cn i = {
|
||||||
s = cn.s ++ i.s ;
|
s = cn.s ++ i.s ;
|
||||||
c = cn.c
|
det = cn.c
|
||||||
} ;
|
} ;
|
||||||
CNSymbNP det cn xs = ss (det.s ++ cn.s ++ xs.s) ; ----
|
CNSymbNP det cn xs = {det = det.s ; s = cn.s ++ xs.s} ; ----
|
||||||
CNNumNP cn i = {
|
CNNumNP cn i = {
|
||||||
s = cn.s ++ i.s ;
|
s = cn.s ++ i.s ;
|
||||||
c = cn.c
|
det = cn.c
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
SymbS sy = simpleS sy.s ;
|
SymbS sy = simpleS sy.s ;
|
||||||
|
|||||||
@@ -7,14 +7,14 @@ concrete VerbChi of Verb = CatChi ** open ResChi, Prelude in {
|
|||||||
|
|
||||||
SlashV2a v = predV v v.part ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
SlashV2a v = predV v v.part ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
||||||
|
|
||||||
Slash2V3 v np = insertAdv (mkNP (ba_s ++ np.s)) (predV v v.part) ** {c2 = v.c3 ; isPre = v.hasPrep} ; -- slot for third argument
|
Slash2V3 v np = insertAdv (mkNP (ba_s ++ linNP np)) (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
|
Slash3V3 v np = insertObj (mkNP (appPrep v.c3 (linNP np))) (predV v v.part) ** {c2 = v.c2 ; isPre = True} ; -- slot for ba object
|
||||||
|
|
||||||
SlashV2A v ap = insertObj {s = ap.s ! Pred} (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
SlashV2A v ap = insertObj (mkNP (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} ;
|
SlashV2V v vp = insertObj (mkNP (infVP vp)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
||||||
SlashV2S v s = insertObj (ss (say_s ++ linS s)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
SlashV2S v s = insertObj (mkNP (say_s ++ linS s)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
||||||
SlashV2Q v q = insertObj (ss (say_s ++ q.s ! False)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
SlashV2Q v q = insertObj (mkNP (say_s ++ q.s ! False)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
||||||
|
|
||||||
ComplVV v vp = {
|
ComplVV v vp = {
|
||||||
verb = v ;
|
verb = v ;
|
||||||
@@ -23,14 +23,14 @@ concrete VerbChi of Verb = CatChi ** open ResChi, Prelude in {
|
|||||||
isAdj = False ;
|
isAdj = False ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ComplVS v s = insertObj (ss (linS s)) (predV v []) ;
|
ComplVS v s = insertObj (mkNP (linS s)) (predV v []) ;
|
||||||
ComplVQ v q = insertObj (ss (q.s ! False)) (predV v []) ;
|
ComplVQ v q = insertObj (mkNP (q.s ! False)) (predV v []) ;
|
||||||
ComplVA v ap = insertObj {s = ap.s ! Pred} (predV v []) ;
|
ComplVA v ap = insertObj (mkNP (ap.s ! Pred)) (predV v []) ;
|
||||||
|
|
||||||
ComplSlash vp np = case vp.isPre of {
|
ComplSlash vp np = case vp.isPre of {
|
||||||
--- True => insertAdv (mkNP (ba_s ++ np.s)) vp ; --- ba or vp.c2 ?
|
--- True => insertAdv (mkNP (ba_s ++ np.s)) vp ; --- ba or vp.c2 ?
|
||||||
True => insertPP (mkNP (appPrep vp.c2 np.s)) vp ; --- ba or vp.c2 ?
|
True => insertPP (mkNP (appPrep vp.c2 (linNP np))) vp ; --- ba or vp.c2 ?
|
||||||
False => insertObj (mkNP (appPrep vp.c2 np.s)) vp
|
False => insertObj (mkNP (appPrep vp.c2 (linNP np))) vp
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
UseComp comp = comp ;
|
UseComp comp = comp ;
|
||||||
@@ -44,13 +44,13 @@ concrete VerbChi of Verb = CatChi ** open ResChi, Prelude in {
|
|||||||
(insertObj (mkNP (infVP vp)) (predV v v.part)) ** {c2 = vp.c2 ; isPre = vp.isPre} ;
|
(insertObj (mkNP (infVP vp)) (predV v v.part)) ** {c2 = vp.c2 ; isPre = vp.isPre} ;
|
||||||
|
|
||||||
AdvVP vp adv = case adv.advType of {
|
AdvVP vp adv = case adv.advType of {
|
||||||
ATManner => insertObj (ss (deVAdv_s ++ adv.s)) vp ; -- he sleeps *well*
|
ATManner => insertObj (mkNP (deVAdv_s ++ adv.s)) vp ; -- he sleeps *well*
|
||||||
ATPlace True => insertAdvPost adv vp ; -- he today *in the house* sleeps
|
ATPlace True => insertAdvPost adv vp ; -- he today *in the house* sleeps
|
||||||
ATPlace False => insertAdvPost (ss (zai_V.s ++ adv.s)) vp ; -- he today *here* sleeps
|
ATPlace False => insertAdvPost (ss (zai_V.s ++ adv.s)) vp ; -- he today *here* sleeps
|
||||||
ATTime | ATPoss => insertTopic adv vp -- *today* he here sleeps
|
ATTime | ATPoss => insertTopic adv vp -- *today* he here sleeps
|
||||||
} ;
|
} ;
|
||||||
ExtAdvVP vp adv = case adv.advType of { ---- ExtAdvVP also ?
|
ExtAdvVP vp adv = case adv.advType of { ---- ExtAdvVP also ?
|
||||||
ATManner => insertObj (ss (deVAdv_s ++ adv.s)) vp ; -- he sleeps *well*
|
ATManner => insertObj (mkNP (deVAdv_s ++ adv.s)) vp ; -- he sleeps *well*
|
||||||
ATPlace True => insertAdvPost adv vp ; -- he today *in the house* sleeps
|
ATPlace True => insertAdvPost adv vp ; -- he today *in the house* sleeps
|
||||||
ATPlace False => insertAdvPost (ss (zai_V.s ++ adv.s)) vp ; -- he today *here* sleeps
|
ATPlace False => insertAdvPost (ss (zai_V.s ++ adv.s)) vp ; -- he today *here* sleeps
|
||||||
ATTime | ATPoss => insertTopic adv vp -- *today* he here sleeps
|
ATTime | ATPoss => insertTopic adv vp -- *today* he here sleeps
|
||||||
@@ -73,17 +73,17 @@ concrete VerbChi of Verb = CatChi ** open ResChi, Prelude in {
|
|||||||
|
|
||||||
CompNP np = insertObj np (predV copula []) ; ----
|
CompNP np = insertObj np (predV copula []) ; ----
|
||||||
|
|
||||||
CompCN cn = insertObj cn (predV copula []) ; ----
|
CompCN cn = insertObj (mkNP cn.s) (predV copula []) ; ----
|
||||||
|
|
||||||
CompAdv adv = case adv.advType of {
|
CompAdv adv = case adv.advType of {
|
||||||
ATPlace True => insertObj adv (predV noVerb []) ;
|
ATPlace True => insertObj (mkNP adv.s) (predV noVerb []) ;
|
||||||
_ => insertObj adv (predV zai_V []) ---- for all others ??
|
_ => insertObj (mkNP adv.s) (predV zai_V []) ---- for all others ??
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
VPSlashPrep vp prep = vp ** {c2 = prep ; isPre = True} ;
|
VPSlashPrep vp prep = vp ** {c2 = prep ; isPre = True} ;
|
||||||
|
|
||||||
AdvVPSlash vp adv = case adv.advType of {
|
AdvVPSlash vp adv = case adv.advType of {
|
||||||
ATManner => insertObj (ss (deVAdv_s ++ adv.s)) vp ; -- he sleeps well
|
ATManner => insertObj (mkNP (deVAdv_s ++ adv.s)) vp ; -- he sleeps well
|
||||||
ATPlace True => insertAdv adv vp ; -- he sleeps on the table
|
ATPlace True => insertAdv adv vp ; -- he sleeps on the table
|
||||||
_ => insertAdv (ss (zai_V.s ++ adv.s)) vp -- he sleeps in the house / today
|
_ => insertAdv (ss (zai_V.s ++ adv.s)) vp -- he sleeps in the house / today
|
||||||
} ** {c2 = vp.c2 ; isPre = vp.isPre} ;
|
} ** {c2 = vp.c2 ; isPre = vp.isPre} ;
|
||||||
|
|||||||
@@ -136,6 +136,10 @@ lin
|
|||||||
lincat
|
lincat
|
||||||
X = {s : Str} ;
|
X = {s : Str} ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
UseComp_estar = UseComp ;
|
||||||
|
UseComp_ser = UseComp ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
CardCNCard = variants {} ;
|
CardCNCard = variants {} ;
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,7 @@ concrete ExtendFre of Extend =
|
|||||||
[
|
[
|
||||||
---- iFem_Pron, youFem_Pron, weFem_Pron, youPlFem_Pron, theyFem_Pron, youPolFem_Pron, youPolPl_Pron, youPolPlFem_Pron,
|
---- iFem_Pron, youFem_Pron, weFem_Pron, youPlFem_Pron, theyFem_Pron, youPolFem_Pron, youPolPl_Pron, youPolPlFem_Pron,
|
||||||
ExistCN, ExistMassCN, ExistPluralCN,
|
ExistCN, ExistMassCN, ExistPluralCN,
|
||||||
PassVPSlash, PassAgentVPSlash
|
PassVPSlash, PassAgentVPSlash, ApposNP
|
||||||
] -- put the names of your own definitions here
|
] -- put the names of your own definitions here
|
||||||
with
|
with
|
||||||
(Grammar = GrammarFre) **
|
(Grammar = GrammarFre) **
|
||||||
@@ -53,6 +53,12 @@ oper
|
|||||||
comp = \\a => vps.comp ! a ++ (let agr = complAgr a in vps.s.s ! VPart agr.g agr.n) ++ agent ;
|
comp = \\a => vps.comp ! a ++ (let agr = complAgr a in vps.s.s ! VPart agr.g agr.n) ++ agent ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
lin ApposNP np1 np2 = np1 ** { -- guessed by KA
|
||||||
|
s = \\c => np1.s ! c ** {ton =(np1.s ! c).ton ++ "," ++ (np2.s ! Nom).ton;
|
||||||
|
comp =(np1.s ! c).comp ++ "," ++ (np2.s ! Nom).comp
|
||||||
|
} ;
|
||||||
|
} ;
|
||||||
|
|
||||||
lin GivenName, MaleSurname, FemaleSurname = \n -> n ;
|
lin GivenName, MaleSurname, FemaleSurname = \n -> n ;
|
||||||
lin FullName gn sn = {
|
lin FullName gn sn = {
|
||||||
s = gn.s ++ sn.s ;
|
s = gn.s ++ sn.s ;
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ concrete ExtendGer of Extend =
|
|||||||
VPS, ListVPS, VPI, ListVPI,
|
VPS, ListVPS, VPI, ListVPI,
|
||||||
MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS,
|
MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS,
|
||||||
MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV,
|
MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV,
|
||||||
CardCNCard, PassVPSlash, PassAgentVPSlash, CompoundN
|
CardCNCard, CompoundN,
|
||||||
|
PassVPSlash, PassAgentVPSlash, PastPartAP, PastPartAgentAP
|
||||||
]
|
]
|
||||||
with
|
with
|
||||||
(Grammar = GrammarGer) **
|
(Grammar = GrammarGer) **
|
||||||
@@ -160,6 +161,28 @@ lin PassVPSlash vp =
|
|||||||
lin PassAgentVPSlash vp np = ---- "von" here, "durch" in StructuralGer
|
lin PassAgentVPSlash vp np = ---- "von" here, "durch" in StructuralGer
|
||||||
insertObj (\\_ => (PastPartAgentAP (lin VPSlash vp) (lin NP np)).s ! APred) (predV werdenPass) ;
|
insertObj (\\_ => (PastPartAgentAP (lin VPSlash vp) (lin NP np)).s ! APred) (predV werdenPass) ;
|
||||||
|
|
||||||
|
lin PastPartAP vp =
|
||||||
|
let a = agrP3 Sg in {
|
||||||
|
s = \\af => (vp.nn ! a).p1 ++ (vp.nn ! a).p2 ++ (vp.nn ! a).p3 ++ vp.a2 ++ vp.adj
|
||||||
|
++ vp.inf.inpl.p2 ++ (vp.inf.extr ! a) ++ vp.s.s ! VPastPart af ;
|
||||||
|
isPre = True ;
|
||||||
|
c = <[],[]> ;
|
||||||
|
ext = vp.ext
|
||||||
|
} ;
|
||||||
|
|
||||||
|
lin PastPartAgentAP vp np =
|
||||||
|
let a = agrP3 Sg ;
|
||||||
|
agent = appPrepNP von_Prep np
|
||||||
|
in {
|
||||||
|
s = \\af => (vp.nn ! a).p1 ++ (vp.nn ! a).p2 ++ (vp.nn ! a).p3
|
||||||
|
++ vp.a2 ++ agent ++ vp.adj ++ vp.inf.inpl.p2
|
||||||
|
++ vp.c2.s -- junk if not TV
|
||||||
|
++ vp.ext ++ (vp.inf.extr ! a) ++ vp.s.s ! VPastPart af ;
|
||||||
|
isPre = True ;
|
||||||
|
c = <[],[]> ;
|
||||||
|
ext = []
|
||||||
|
} ;
|
||||||
|
|
||||||
lin CompoundN a x =
|
lin CompoundN a x =
|
||||||
let s = a.co in
|
let s = a.co in
|
||||||
lin N {
|
lin N {
|
||||||
|
|||||||
@@ -579,11 +579,12 @@ mkV2 : overload {
|
|||||||
gabst = verbST gab ;
|
gabst = verbST gab ;
|
||||||
gaben = pluralN gab ;
|
gaben = pluralN gab ;
|
||||||
gabt = verbT gab
|
gabt = verbT gab
|
||||||
in
|
in case geben of {
|
||||||
MorphoGer.mkV
|
_ + "n" => MorphoGer.mkV
|
||||||
geben gebe gibst gibt gebt gib gab gabst gaben gabt gaebe gegeben
|
geben gebe gibst gibt gebt gib gab gabst gaben gabt gaebe gegeben
|
||||||
[] VHaben ** {lock_V = <>} ;
|
[] VHaben ** {lock_V = <>} ;
|
||||||
|
_ => Predef.error (geben + ": invalid infinitive form, should end with 'n'")
|
||||||
|
} ;
|
||||||
regV fragen =
|
regV fragen =
|
||||||
let
|
let
|
||||||
frag = stemVerb fragen ;
|
frag = stemVerb fragen ;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
concrete ExtendMay of Extend = CatMay
|
concrete ExtendMay of Extend = CatMay
|
||||||
** ExtendFunctor - [
|
** ExtendFunctor - [
|
||||||
VPS -- finite VP's with tense and polarity
|
VPS -- finite VP's with tense and polarity
|
||||||
, ListVPS
|
, ListVPS, BaseVPS, ConsVPS, ConjVPS
|
||||||
, VPI, MkVPI, ComplVPIVV
|
, VPI, MkVPI, ComplVPIVV
|
||||||
, ListVPI -- infinitive VP's (TODO: with anteriority and polarity)
|
, ListVPI -- infinitive VP's (TODO: with anteriority and polarity)
|
||||||
, MkVPS
|
, MkVPS
|
||||||
@@ -18,6 +18,7 @@ concrete ExtendMay of Extend = CatMay
|
|||||||
,GenModNP, GenNP, GenRP
|
,GenModNP, GenNP, GenRP
|
||||||
,CompoundN
|
,CompoundN
|
||||||
,GerundNP, GerundAdv
|
,GerundNP, GerundAdv
|
||||||
|
,ByVP
|
||||||
|
|
||||||
|
|
||||||
-- VPS2 ; -- have loved (binary version of VPS)
|
-- VPS2 ; -- have loved (binary version of VPS)
|
||||||
@@ -38,11 +39,11 @@ concrete ExtendMay of Extend = CatMay
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- BaseVPS : VPS -> VPS -> ListVPS ;
|
-- BaseVPS : VPS -> VPS -> ListVPS ;
|
||||||
BaseVPS vps vps2 = twoSS vps vps2 ;
|
BaseVPS = twoSS ;
|
||||||
-- ConsVPS : VPS -> ListVPS -> ListVPS ;
|
-- ConsVPS : VPS -> ListVPS -> ListVPS ;
|
||||||
ConsVPS str listvps vps = consSS "," listvps vps ;
|
ConsVPS = consrSS ",";
|
||||||
-- ConjVPS : Conj -> [VPS] -> VPS ; -- has walked and won't sleep
|
-- ConjVPS : Conj -> [VPS] -> VPS ; -- has walked and won't sleep
|
||||||
ConjVPS conj listvps = conjunctX conj listvps ;
|
ConjVPS = conjunctDistrSS ;
|
||||||
-- PredVPS : NP -> VPS -> S ; -- she [has walked and won't sleep]
|
-- PredVPS : NP -> VPS -> S ; -- she [has walked and won't sleep]
|
||||||
PredVPS np vps = {
|
PredVPS np vps = {
|
||||||
s = np.s ! Bare ++ vps.s ;
|
s = np.s ! Bare ++ vps.s ;
|
||||||
@@ -99,6 +100,7 @@ concrete ExtendMay of Extend = CatMay
|
|||||||
|
|
||||||
GerundAdv vp = ss (linVP vp) ;
|
GerundAdv vp = ss (linVP vp) ;
|
||||||
|
|
||||||
|
ByVP vp = cc2 by8means_Prep (GerundAdv vp) ;
|
||||||
|
|
||||||
-- PassVPSlash : VPS -> VP ;
|
-- PassVPSlash : VPS -> VP ;
|
||||||
-- be begged to sleep
|
-- be begged to sleep
|
||||||
|
|||||||
@@ -4,5 +4,5 @@ concrete AllSpa of AllSpaAbs =
|
|||||||
LangSpa,
|
LangSpa,
|
||||||
IrregSpa,
|
IrregSpa,
|
||||||
ExtendSpa
|
ExtendSpa
|
||||||
---- ExtraSpa
|
-- ExtraSpa
|
||||||
** {} ;
|
** {} ;
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ concrete ExtendSpa of Extend = CatSpa ** ExtendRomanceFunctor -
|
|||||||
youPolFem_Pron,
|
youPolFem_Pron,
|
||||||
youPolPlFem_Pron,
|
youPolPlFem_Pron,
|
||||||
youPolPl_Pron,
|
youPolPl_Pron,
|
||||||
PassVPSlash, PassAgentVPSlash
|
PassVPSlash, PassAgentVPSlash,
|
||||||
|
UseComp_estar, UseComp_ser
|
||||||
] -- don't forget to put the names of your own
|
] -- don't forget to put the names of your own
|
||||||
-- definitions here
|
-- definitions here
|
||||||
with
|
with
|
||||||
@@ -31,7 +32,8 @@ concrete ExtendSpa of Extend = CatSpa ** ExtendRomanceFunctor -
|
|||||||
MorphoSpa,
|
MorphoSpa,
|
||||||
Coordination,
|
Coordination,
|
||||||
Prelude,
|
Prelude,
|
||||||
ParadigmsSpa in {
|
ParadigmsSpa,
|
||||||
|
(I=IrregSpa) in {
|
||||||
-- put your own definitions here
|
-- put your own definitions here
|
||||||
|
|
||||||
lin
|
lin
|
||||||
@@ -101,7 +103,10 @@ concrete ExtendSpa of Extend = CatSpa ** ExtendRomanceFunctor -
|
|||||||
cop = serCopula
|
cop = serCopula
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
lin GivenName, MaleSurname, FemaleSurname = \n -> n ;
|
lin UseComp_estar comp = insertComplement comp.s (predV I.estar_V) ;
|
||||||
|
UseComp_ser comp = insertComplement comp.s (predV copula) ;
|
||||||
|
|
||||||
|
lin GivenName, MaleSurname, FemaleSurname, PlSurname = \n -> n ;
|
||||||
lin FullName gn sn = {
|
lin FullName gn sn = {
|
||||||
s = gn.s ++ sn.s ;
|
s = gn.s ++ sn.s ;
|
||||||
g = gn.g
|
g = gn.g
|
||||||
@@ -121,4 +126,6 @@ oper
|
|||||||
comp = \\a => vps.comp ! a ++ (let agr = complAgr a in vps.s.s ! VPart agr.g agr.n) ++ agent ;
|
comp = \\a => vps.comp ! a ++ (let agr = complAgr a in vps.s.s ! VPart agr.g agr.n) ++ agent ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
lin AnaphPron np = agr2pron ! np.a ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ concrete ExtraSpa of ExtraSpaAbs = ExtraRomanceSpa **
|
|||||||
mkClause [] True False np.a (insertComplement (\\_ => (np.s ! Nom).ton) (predV (mkV "existir"))) ;
|
mkClause [] True False np.a (insertComplement (\\_ => (np.s ! Nom).ton) (predV (mkV "existir"))) ;
|
||||||
|
|
||||||
UseComp_estar comp = insertComplement comp.s (predV I.estar_V) ;
|
UseComp_estar comp = insertComplement comp.s (predV I.estar_V) ;
|
||||||
|
UseComp_ser comp = insertComplement comp.s (predV copula) ;
|
||||||
|
|
||||||
cual_IComp = {
|
cual_IComp = {
|
||||||
s = aagrForms "cual" "cual" "cuáles" "cuáles" ;
|
s = aagrForms "cual" "cual" "cuáles" "cuáles" ;
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ abstract ExtraSpaAbs = ExtraRomanceAbs ** {
|
|||||||
PassVPSlash_ser : VPSlash -> VP ;
|
PassVPSlash_ser : VPSlash -> VP ;
|
||||||
|
|
||||||
UseComp_estar : Comp -> VP ; -- esta lleno, as opposed to es lleno
|
UseComp_estar : Comp -> VP ; -- esta lleno, as opposed to es lleno
|
||||||
|
UseComp_ser : Comp -> VP ; -- es lleno, as opposed to esta lleno
|
||||||
|
|
||||||
cual_IComp : IComp ; -- cual es ...
|
cual_IComp : IComp ; -- cual es ...
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user