Merge branch 'GrammaticalFramework:master' into master

This commit is contained in:
Meowyam
2023-05-26 14:58:37 +08:00
committed by GitHub
33 changed files with 92124 additions and 92041 deletions

View File

@@ -7,8 +7,6 @@ Aarne Ranta
The following table gives the languages currently available in the
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
that are currently available via https://github.com/GrammaticalFramework/gf-rgl/

View File

@@ -32,7 +32,6 @@ the library, view all functions in a module's scope, and quickly jump to their d
Other relevant documents:
- [The RGL Status Document ../status.html]: the current status of different languages
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
- [More modules ../gfdoc/sources.html]: extra modules, dictionaries, and
the internals of the resource grammar

View File

@@ -290,6 +290,10 @@ fun UseDAP : DAP -> NP ;
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
CardCNCard : Card -> CN -> Card ; -- three million, four lakh, six dozen etc

View File

@@ -300,6 +300,9 @@ lin UseDAP dap = {
p = NounP3 dap.p
} ;
lin UseComp_estar = UseComp ;
UseComp_ser = UseComp ;
lin GivenName = \n -> {
s = n.s ;
gn = GSg (sex2gender n.g)

View File

@@ -5,7 +5,7 @@ concrete AdjectiveChi of Adjective = CatChi ** open ResChi, Prelude in {
PositA a = a ** {hasAdA = False} ;
ComparA a np = a ** {
s = table {_=> than_s ++ np.s ++ a.s!Attr};
s = table {_=> than_s ++ linNP np ++ a.s!Attr};
hasAdA = False
};
@@ -26,11 +26,11 @@ concrete AdjectiveChi of Adjective = CatChi ** open ResChi, Prelude in {
};
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 ** {
s= table { adjPlace => appPrep a.c2 np.s ++ a.s!adjPlace};
s= table { adjPlace => appPrep a.c2 (linNP np) ++ a.s!adjPlace};
hasAdA = False
};

View File

@@ -4,9 +4,9 @@ concrete AdverbChi of Adverb = CatChi **
lin
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} ;

View File

@@ -43,7 +43,8 @@ concrete CatChi of Cat = CommonX - [Tense, Temp, Ant, Adv] ** open ResChi, Prelu
-- Noun
CN = ResChi.Noun ;
NP, Pron = ResChi.NP ;
NP = ResChi.NP ;
Pron = SS ;
Det = Determiner ;
Quant = Determiner ** {pl : Str} ;
Predet = {s : Str} ; ----
@@ -79,7 +80,7 @@ concrete CatChi of Cat = CommonX - [Tense, Temp, Ant, Adv] ** open ResChi, Prelu
N = ResChi.Noun ;
N2 = ResChi.Noun ** {c2 : Preposition} ;
N3 = ResChi.Noun ** {c2,c3 : Preposition} ;
GN, SN, PN = ResChi.NP ;
GN, SN, PN = SS ;
-- overridden
@@ -91,4 +92,5 @@ linref
S = linS ;
Prep = linPrep ;
VP = infVP ;
NP = \np -> np.det ++ np.s ;
}

View File

@@ -11,7 +11,7 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin
postJiu = ss.postJiu}
} ;
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
ConjRS c = conjunctDistrSS (c.s ! CSent) ;
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} ; ---- ??
ConsAdv x xs = consrSS duncomma x xs ** {advType = x.advType ; hasDe = xs.hasDe} ; ---- ??
BaseNP = twoSS ;
ConsNP = consrSS duncomma ;
BaseNP np1 np2 = twoSS (mergeNP np1) (mergeNP np2) ;
ConsNP np nps = consrSS duncomma (mergeNP np) nps ;
BaseAP x y = twoTable AdjPlace x y ** {monoSyl = y.monoSyl} ;
ConsAP x xs = consrTable AdjPlace duncomma x xs ** {monoSyl = xs.monoSyl} ;
BaseRS = twoSS ;
@@ -46,5 +46,8 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin
[RS] = {s1,s2 : Str} ;
[CN] = {s1,s2 : Str ; c : Str} ;
oper
mergeNP : ResChi.NP -> SS = \np -> ss (linNP np) ;
}

View File

@@ -1,6 +1,6 @@
--# -path=.:../abstract
concrete ConstructionChi of Construction = CatChi **
concrete ConstructionChi of Construction = CatChi **
open SyntaxChi, ParadigmsChi, (L = LexiconChi), (E = ExtraChi), (G = GrammarChi), (R = ResChi), Prelude in {
flags coding=utf8 ;
@@ -24,9 +24,9 @@ lin
-- some more things
weather_adjCl ap = mkCl (mkVP (lin AP ap)) ;
is_right_VP = mkVP (ParadigmsChi.mkA "对") ;
is_wrong_VP = mkVP (ParadigmsChi.mkA "错") ;
is_right_VP = mkVP (ParadigmsChi.mkA "对") ;
is_wrong_VP = mkVP (ParadigmsChi.mkA "错") ;
n_units_AP card cn a = mkAP (lin AdA (mkUtt (mkNP <lin Card card : Card> (lin CN cn)))) (lin A a) ; ----
@@ -47,8 +47,8 @@ lin
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 ;
intYear i = lin NP (R.mkNP i.s) ;
intMonthday i = lin NP (R.mkNP i.s) ;
lincat Language = N ;
@@ -74,9 +74,9 @@ lin friday_Weekday = mkN "星期五" ;
lin saturday_Weekday = mkN "星期六" ;
lin sunday_Weekday = mkN "星期日" ;
lin january_Month = mkN "一月" ;
lin february_Month = mkN "二月" ;
lin march_Month = mkN "三月" ;
lin january_Month = mkN "一月" ;
lin february_Month = mkN "二月" ;
lin march_Month = mkN "三月" ;
lin april_Month = mkN "四月" ;
lin may_Month = mkN "五月" ;
lin june_Month = mkN "六月" ;

View File

@@ -111,6 +111,24 @@ lin
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
inflVerb : Verb -> Str = \verb ->
let vtbl = useVerb verb

View File

@@ -11,7 +11,7 @@ concrete ExtendChi of Extend = CatChi **
, MkVPI2, BaseVPI2, ConsVPI2, ConjVPI2, ComplVPI2
, ProDrop, ComplDirectVS, ComplDirectVQ
, PassVPSlash, PassAgentVPSlash
, GerundAdv, GerundNP ]
, GerundAdv, GerundNP, ByVP ]
with (Grammar=GrammarChi) ** open
Prelude
, Coordination
@@ -27,7 +27,7 @@ concrete ExtendChi of Extend = CatChi **
lin
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} ;
ConjVPS c = conjunctDistrSS (c.s ! CSent) ;
@@ -35,16 +35,16 @@ concrete ExtendChi of Extend = CatChi **
ConsVPS = consrSS duncomma ;
-- : 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
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
-- QuestVPS ip vps = -- TODO: probably need to change structure of VPS
-- : 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} ;
ConjVPI c = conjunctDistrSS (c.s ! CSent) ;
@@ -68,7 +68,11 @@ concrete ExtendChi of Extend = CatChi **
GerundAdv vp = mkAdv (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} ;
ProDrop pron = pron ** {s = []} ;

View File

@@ -11,21 +11,21 @@ concrete ExtraChi of ExtraChiAbs = CatChi **
lin
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} ;
ConjVPS c = conjunctDistrSS (c.s ! CSent) ;
BaseVPS = twoSS ;
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
ConjVPI c = conjunctDistrSS (c.s ! CSent) ;
BaseVPI = twoSS ;
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} ; ---- ??

View File

@@ -10,11 +10,11 @@ concrete IdiomChi of Idiom = CatChi ** open Prelude, ResChi in {
-- GenericCl vp = mkClause "有人" vp ; (meaning: there is a person)
---- 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
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
@@ -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 ;
SelfNP np = {s = np.s ++ reflPron} ;
SelfNP np = np ** {s = linNP np ++ reflPron} ;
}

View File

@@ -1,28 +1,33 @@
concrete NounChi of Noun = CatChi ** open ResChi, Prelude in {
lin
DetCN det cn = case det.detType of {
DTFull Sg => {s = det.s ++ cn.c ++ cn.s} ; -- this house
DTFull Pl => {s = det.s ++ xie_s ++ cn.s} ; -- these houses
DTNum => {s = det.s ++ cn.c ++ cn.s} ; -- (these) five houses
DTPoss => {s = det.s ++ cn.s} -- our (five) houses
} ;
UsePN pn = pn ;
UsePron p = p ;
DetCN det cn = cn ** {
det = case det.detType of {
DTFull Sg => det.s ++ cn.c ; -- this house
DTFull Pl => det.s ++ xie_s ; -- these houses
DTNum => det.s ++ cn.c ; -- (these) five houses
DTPoss => det.s -- our (five) houses
}
} ;
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 ;
DTPoss => det.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) ;
ExtAdvNP np adv = mkNP (adv.s ++ possessiveIf adv.hasDe ++ embedInCommas np.s) ; ---- commas?
AdvNP np adv = np ** {s = adv.s ++ possessiveIf adv.hasDe ++ np.s} ;
ExtAdvNP np adv = np ** {s = adv.s ++ possessiveIf adv.hasDe ++ embedInCommas np.s} ; ---- commas?
DetQuant quant num = {
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
IndefArt = mkQuant yi_s [] DTNum ; -- (DTFull Sg) ; -- empty in the plural
MassNP cn = cn ;
MassNP cn = mkNP cn.s ;
UseN n = n ;
UseN2 n = n ;
Use2N3 f = {s = f.s ; c = f.c ; c2 = f.c2} ;
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} ;
ComplN3 f x = {s = appPrep f.c2 x.s ++ f.s ; c = f.c ; c2 = f.c3} ;
ComplN2 f x = {s = appPrep f.c2 (linNP x) ++ f.s ; c = f.c} ;
ComplN3 f x = {s = appPrep f.c2 (linNP x) ++ f.s ; c = f.c ; c2 = f.c3} ;
AdjCN ap cn = case ap.monoSyl of {
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} ;
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} ;
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} ;
PartNP 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 = 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?
}

View File

@@ -184,7 +184,7 @@ oper
emptyPrep : Preposition = mkPrep [] ;
mkpNP : Str -> CatChi.NP
= \s -> lin NP {s = word s} ;
= \s -> lin NP {s = word s ; det = []} ;
mkAdV : Str -> AdV
= \s -> lin AdV {s = word s} ;
mkAdN : Str -> AdN

View File

@@ -11,7 +11,7 @@ concrete PhraseChi of Phrase = CatChi ** open Prelude, ResChi in {
UttIP ip = ip ;
UttIAdv iadv = iadv ;
UttNP np = np ;
UttNP np = ss (linNP np) ;
UttCN cn = cn ;
UttAP ap = {s = ap.s!Attr} ;
UttCard x = x ;
@@ -23,6 +23,6 @@ concrete PhraseChi of Phrase = CatChi ** open Prelude, ResChi in {
PConjConj conj = ss (conj.s ! CSent).s2 ;
NoVoc = {s = []} ;
VocNP np = {s = np.s ++ chcomma} ; ---- ??
VocNP np = {s = linNP np ++ chcomma} ; ---- ??
}

View File

@@ -14,11 +14,11 @@ concrete QuestionChi of Question = CatChi **
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} ;
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) ;

View File

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

View File

@@ -112,7 +112,8 @@ oper
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
@@ -192,11 +193,11 @@ oper
} ;
insertObj : NP -> VP -> VP = \np,vp -> vp ** {
compl = np.s ++ vp.compl ;
compl = linNP np ++ vp.compl ;
} ;
insertObjPost : NP -> VP -> VP = \np,vp -> vp ** {
compl = vp.compl ++ np.s ;
compl = vp.compl ++ linNP np ;
} ;
insertAdv : SS -> VP -> VP = \adv,vp -> vp ** {
@@ -215,7 +216,7 @@ oper
} ;
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
@@ -250,7 +251,7 @@ oper
mkClauseCompl : Str -> VP -> Str -> Clause = \np,vp,compl -> {
s = \\p,a => vp.topic ++ np ++ vp.prePart ++ useVerb vp.verb ! p ! a ++ vp.compl ++ compl ;
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 ;
} ;
@@ -278,7 +279,8 @@ oper
} ;
pronNP : (s : Str) -> NP = \s -> {
s = word s
s = word s ;
det = []
} ;
Preposition = {prepPre : Str ; prepPost : Str ; advType : AdvType ; hasDe : Bool} ;
@@ -316,7 +318,7 @@ oper
-- 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 ->
prep.prepPre ++ s ++ prep.prepPost ;

View File

@@ -5,7 +5,7 @@ concrete SentenceChi of Sentence = CatChi **
lin
PredVP np vp = mkClause np.s vp ;
PredVP np vp = mkClause (linNP np) vp ;
PredSCVP sc vp = mkClause sc.s vp ;
@@ -17,10 +17,10 @@ concrete SentenceChi of Sentence = CatChi **
} ;
SlashVP np vp =
mkClauseCompl np.s vp []
mkClauseCompl (linNP np) vp []
** {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

View File

@@ -142,8 +142,8 @@ either7or_DConj = {s = table { -- modified by chenpeng 11.19
conjType = NotJiu ;
} ;
everybody_NP = ssword "每个人" ; -- [mark] "每个人": 每(every)+个(classifier)+人(person)
everything_NP = ssword "每件事" ; -- [mark] "每件事": 每(every)+件(classifier)+事(thing)
everybody_NP = mkNP (ssword "每个人").s ; -- [mark] "每个人": 每(every)+个(classifier)+人(person)
everything_NP = mkNP (ssword "每件事").s ; -- [mark] "每件事": 每(every)+件(classifier)+事(thing)
everywhere_Adv = mkAdv "到处" ;
here7from_Adv = mkAdv "从这里" ; -- from here
here7to_Adv = mkAdv "到这里" ; -- to here
@@ -161,13 +161,13 @@ if_then_Conj = {s = table { -- added by chenpeng 11.19
} ;
conjType = Jiu ;
} ;
nobody_NP = ssword "没人" ;
nothing_NP = ssword "没有什么" ;
nobody_NP = mkNP (ssword "没人").s ;
nothing_NP = mkNP (ssword "没有什么").s ;
on_Prep = mkPrep "在" "上" ;
only_Predet = ssword "只有" ; -- only John
so_AdA = ssword "如此" ;
somebody_NP = ssword "某人" ;
something_NP = ssword "某事" ; -- [mark] in sent, it depends on the context
somebody_NP = mkNP (ssword "某人").s ;
something_NP = mkNP (ssword "某事").s ; -- [mark] in sent, it depends on the context
somewhere_Adv = mkAdv "某处" ;
that_Subj = mkSubj [] chcomma ; -- that + S [mark] comma
there7from_Adv = mkAdv "从那里" ; -- from there

View File

@@ -11,12 +11,12 @@ concrete SymbolChi of Symbol = CatChi ** open Prelude, ResChi in {
NumPN i = i ;
CNIntNP cn i = {
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 = {
s = cn.s ++ i.s ;
c = cn.c
det = cn.c
} ;
SymbS sy = simpleS sy.s ;

View File

@@ -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} ;
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
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 (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} ;
SlashV2S v s = insertObj (ss (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} ;
SlashV2S v s = insertObj (mkNP (say_s ++ linS s)) (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 = {
verb = v ;
@@ -23,14 +23,14 @@ concrete VerbChi of Verb = CatChi ** open ResChi, Prelude in {
isAdj = False ;
} ;
ComplVS v s = insertObj (ss (linS s)) (predV v []) ;
ComplVQ v q = insertObj (ss (q.s ! False)) (predV v []) ;
ComplVA v ap = insertObj {s = ap.s ! Pred} (predV v []) ;
ComplVS v s = insertObj (mkNP (linS s)) (predV v []) ;
ComplVQ v q = insertObj (mkNP (q.s ! False)) (predV v []) ;
ComplVA v ap = insertObj (mkNP (ap.s ! Pred)) (predV v []) ;
ComplSlash vp np = case vp.isPre of {
--- 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 ?
False => insertObj (mkNP (appPrep vp.c2 np.s)) vp
True => insertPP (mkNP (appPrep vp.c2 (linNP np))) vp ; --- ba or vp.c2 ?
False => insertObj (mkNP (appPrep vp.c2 (linNP np))) vp
} ;
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} ;
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 False => insertAdvPost (ss (zai_V.s ++ adv.s)) vp ; -- he today *here* sleeps
ATTime | ATPoss => insertTopic adv vp -- *today* he here sleeps
} ;
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 False => insertAdvPost (ss (zai_V.s ++ adv.s)) vp ; -- he today *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 []) ; ----
CompCN cn = insertObj cn (predV copula []) ; ----
CompCN cn = insertObj (mkNP cn.s) (predV copula []) ; ----
CompAdv adv = case adv.advType of {
ATPlace True => insertObj adv (predV noVerb []) ;
_ => insertObj adv (predV zai_V []) ---- for all others ??
ATPlace True => insertObj (mkNP adv.s) (predV noVerb []) ;
_ => insertObj (mkNP adv.s) (predV zai_V []) ---- for all others ??
} ;
VPSlashPrep vp prep = vp ** {c2 = prep ; isPre = True} ;
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
_ => insertAdv (ss (zai_V.s ++ adv.s)) vp -- he sleeps in the house / today
} ** {c2 = vp.c2 ; isPre = vp.isPre} ;

View File

@@ -136,6 +136,10 @@ lin
lincat
X = {s : Str} ;
lin
UseComp_estar = UseComp ;
UseComp_ser = UseComp ;
lin
CardCNCard = variants {} ;

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,7 @@ concrete ExtendFre of Extend =
[
---- iFem_Pron, youFem_Pron, weFem_Pron, youPlFem_Pron, theyFem_Pron, youPolFem_Pron, youPolPl_Pron, youPolPlFem_Pron,
ExistCN, ExistMassCN, ExistPluralCN,
PassVPSlash, PassAgentVPSlash
PassVPSlash, PassAgentVPSlash, ApposNP
] -- put the names of your own definitions here
with
(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 ;
} ;
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 FullName gn sn = {
s = gn.s ++ sn.s ;

View File

@@ -7,7 +7,8 @@ concrete ExtendGer of Extend =
VPS, ListVPS, VPI, ListVPI,
MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS,
MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV,
CardCNCard, PassVPSlash, PassAgentVPSlash, CompoundN
CardCNCard, CompoundN,
PassVPSlash, PassAgentVPSlash, PastPartAP, PastPartAgentAP
]
with
(Grammar = GrammarGer) **
@@ -160,6 +161,28 @@ lin PassVPSlash vp =
lin PassAgentVPSlash vp np = ---- "von" here, "durch" in StructuralGer
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 =
let s = a.co in
lin N {

View File

@@ -579,11 +579,12 @@ mkV2 : overload {
gabst = verbST gab ;
gaben = pluralN gab ;
gabt = verbT gab
in
MorphoGer.mkV
in case geben of {
_ + "n" => MorphoGer.mkV
geben gebe gibst gibt gebt gib gab gabst gaben gabt gaebe gegeben
[] VHaben ** {lock_V = <>} ;
_ => Predef.error (geben + ": invalid infinitive form, should end with 'n'")
} ;
regV fragen =
let
frag = stemVerb fragen ;

View File

@@ -3,7 +3,7 @@
concrete ExtendMay of Extend = CatMay
** ExtendFunctor - [
VPS -- finite VP's with tense and polarity
, ListVPS
, ListVPS, BaseVPS, ConsVPS, ConjVPS
, VPI, MkVPI, ComplVPIVV
, ListVPI -- infinitive VP's (TODO: with anteriority and polarity)
, MkVPS
@@ -18,6 +18,7 @@ concrete ExtendMay of Extend = CatMay
,GenModNP, GenNP, GenRP
,CompoundN
,GerundNP, GerundAdv
,ByVP
-- VPS2 ; -- have loved (binary version of VPS)
@@ -38,11 +39,11 @@ concrete ExtendMay of Extend = CatMay
} ;
-- BaseVPS : VPS -> VPS -> ListVPS ;
BaseVPS vps vps2 = twoSS vps vps2 ;
BaseVPS = twoSS ;
-- 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 listvps = conjunctX conj listvps ;
ConjVPS = conjunctDistrSS ;
-- PredVPS : NP -> VPS -> S ; -- she [has walked and won't sleep]
PredVPS np vps = {
s = np.s ! Bare ++ vps.s ;
@@ -99,6 +100,7 @@ concrete ExtendMay of Extend = CatMay
GerundAdv vp = ss (linVP vp) ;
ByVP vp = cc2 by8means_Prep (GerundAdv vp) ;
-- PassVPSlash : VPS -> VP ;
-- be begged to sleep

View File

@@ -4,5 +4,5 @@ concrete AllSpa of AllSpaAbs =
LangSpa,
IrregSpa,
ExtendSpa
---- ExtraSpa
-- ExtraSpa
** {} ;

View File

@@ -20,7 +20,8 @@ concrete ExtendSpa of Extend = CatSpa ** ExtendRomanceFunctor -
youPolFem_Pron,
youPolPlFem_Pron,
youPolPl_Pron,
PassVPSlash, PassAgentVPSlash
PassVPSlash, PassAgentVPSlash,
UseComp_estar, UseComp_ser
] -- don't forget to put the names of your own
-- definitions here
with
@@ -31,7 +32,8 @@ concrete ExtendSpa of Extend = CatSpa ** ExtendRomanceFunctor -
MorphoSpa,
Coordination,
Prelude,
ParadigmsSpa in {
ParadigmsSpa,
(I=IrregSpa) in {
-- put your own definitions here
lin
@@ -101,7 +103,10 @@ concrete ExtendSpa of Extend = CatSpa ** ExtendRomanceFunctor -
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 = {
s = gn.s ++ sn.s ;
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 ;
} ;
lin AnaphPron np = agr2pron ! np.a ;
} ;

View File

@@ -79,6 +79,7 @@ concrete ExtraSpa of ExtraSpaAbs = ExtraRomanceSpa **
mkClause [] True False np.a (insertComplement (\\_ => (np.s ! Nom).ton) (predV (mkV "existir"))) ;
UseComp_estar comp = insertComplement comp.s (predV I.estar_V) ;
UseComp_ser comp = insertComplement comp.s (predV copula) ;
cual_IComp = {
s = aagrForms "cual" "cual" "cuáles" "cuáles" ;

View File

@@ -33,6 +33,7 @@ abstract ExtraSpaAbs = ExtraRomanceAbs ** {
PassVPSlash_ser : VPSlash -> VP ;
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 ...