forked from GitHub/gf-rgl
remove the obsolete Parse grammar
This commit is contained in:
@@ -1,165 +0,0 @@
|
||||
--# -path=alltenses:../english:../translator:../abstract
|
||||
concrete ParseBul of ParseEngAbs =
|
||||
TenseX - [IAdv, CAdv],
|
||||
CatBul,
|
||||
NounBul - [PPartNP],
|
||||
AdjectiveBul,
|
||||
NumeralBul,
|
||||
SymbolBul [PN, Symb, String, CN, Card, NP, MkSymb, SymbPN, CNNumNP],
|
||||
ConjunctionBul,
|
||||
VerbBul - [SlashV2V, PassV2, UseCopula, ComplVV],
|
||||
AdverbBul,
|
||||
PhraseBul,
|
||||
SentenceBul,
|
||||
QuestionBul,
|
||||
RelativeBul,
|
||||
IdiomBul [NP, VP, Tense, Cl, ProgrVP, ExistNP],
|
||||
ExtraBul [NP, Quant, VPSlash, VP, Tense, GenNP, PassVPSlash,
|
||||
Temp, Pol, Conj, VPS, ListVPS, S, MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS,
|
||||
VPI, VPIForm, VPIInf, VPIPresPart, ListVPI, VV, MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV,
|
||||
ComplSlashPartLast,
|
||||
ClSlash, RCl, EmptyRelSlash],
|
||||
DocumentationBul,
|
||||
DictionaryBul **
|
||||
open ResBul, Prelude in {
|
||||
|
||||
flags
|
||||
literal=Symb ;
|
||||
coding = utf8 ;
|
||||
|
||||
lin
|
||||
CompoundCN num noun cn = {
|
||||
s = \\nf => num.s ! CFNeut Indef ++ (noun.rel ! nform2aform nf cn.g) ++ (cn.s ! (indefNForm nf)) ;
|
||||
g = cn.g
|
||||
} ;
|
||||
|
||||
GerundN v = {
|
||||
s = \\nform => v.s ! Imperf ! VNoun nform ;
|
||||
rel = \\aform => v.s ! Imperf ! VPresPart aform ++
|
||||
case v.vtype of {
|
||||
VMedial c => reflClitics ! c;
|
||||
_ => []
|
||||
};
|
||||
g = ANeut
|
||||
} ;
|
||||
|
||||
GerundAP v = {
|
||||
s = \\aform => v.s ! Imperf ! VPresPart aform ++
|
||||
case v.vtype of {
|
||||
VMedial c => reflClitics ! c;
|
||||
_ => []
|
||||
};
|
||||
adv = v.s ! Imperf ! VPresPart (ASg Neut Indef);
|
||||
isPre = True
|
||||
} ;
|
||||
|
||||
PastPartAP v = {
|
||||
s = \\aform => v.s ! Perf ! VPassive aform ;
|
||||
adv = v.s ! Perf ! VPassive (ASg Neut Indef);
|
||||
isPre = True
|
||||
} ;
|
||||
|
||||
PositAdVAdj a = {s = a.adv} ;
|
||||
|
||||
that_RP = {
|
||||
s = whichRP
|
||||
} ;
|
||||
|
||||
UseQuantPN q pn = { s = table {
|
||||
RObj Dat => "на" ++ pn.s;
|
||||
_ => pn.s
|
||||
} ;
|
||||
a = {gn = GSg pn.g; p = P3};
|
||||
p = q.p
|
||||
} ;
|
||||
|
||||
PastPartRS ant pol vp = {
|
||||
s = \\agr =>
|
||||
ant.s ++ pol.s ++
|
||||
vp.ad.s ++
|
||||
case pol.p of {Pos => ""; Neg => "не"} ++
|
||||
case ant.a of {Simul => ""; Anter => auxBe ! VPerfect (aform agr.gn Indef (RObj Acc))} ++
|
||||
vp.s ! Perf ! VPassive (aform agr.gn Indef (RObj Acc)) ++
|
||||
case vp.vtype of {
|
||||
VMedial c => reflClitics ! c;
|
||||
_ => []
|
||||
} ++
|
||||
vp.compl1 ! agr ++ vp.compl2 ! agr ;
|
||||
} ;
|
||||
|
||||
PresPartRS ant pol vp = {
|
||||
s = \\agr =>
|
||||
ant.s ++ pol.s ++
|
||||
vp.ad.s ++
|
||||
case pol.p of {Pos => ""; Neg => "не"} ++
|
||||
case ant.a of {Simul => ""; Anter => auxBe ! VPerfect (aform agr.gn Indef (RObj Acc))} ++
|
||||
vp.s ! Imperf ! VPresPart (aform agr.gn Indef (RObj Acc)) ++
|
||||
case vp.vtype of {
|
||||
VMedial c => reflClitics ! c;
|
||||
_ => []
|
||||
} ++
|
||||
vp.compl ! agr ;
|
||||
} ;
|
||||
|
||||
SlashV2V vv ant p vp =
|
||||
insertSlashObj2 (\\agr => ant.s ++ p.s ++ vv.c3.s ++
|
||||
daComplex ant.a (orPol p.p vp.p) vp ! Perf ! agr)
|
||||
Pos
|
||||
(slashV vv vv.c2) ;
|
||||
|
||||
ComplVV vv ant p vp =
|
||||
insertObj (\\agr => ant.s ++ p.s ++
|
||||
case vv.typ of {
|
||||
VVInf => daComplex ant.a p.p vp ! Perf ! agr;
|
||||
VVGerund => gerund vp ! Imperf ! agr
|
||||
}) vp.p
|
||||
(predV vv) ;
|
||||
|
||||
PredVPosv np vp = {
|
||||
s = \\t,a,p,o =>
|
||||
let
|
||||
subj = np.s ! (case vp.vtype of {
|
||||
VNormal => RSubj ;
|
||||
VMedial _ => RSubj ;
|
||||
VPhrasal c => RObj c}) ;
|
||||
verb : Bool => Str
|
||||
= \\q => vpTenses vp ! t ! a ! p ! np.a ! q ! Perf ;
|
||||
compl = vp.compl ! np.a
|
||||
in case o of {
|
||||
Main => compl ++ subj ++ verb ! False ;
|
||||
Inv => verb ! False ++ compl ++ subj ;
|
||||
Quest => compl ++ subj ++ verb ! True
|
||||
}
|
||||
} ;
|
||||
|
||||
CompS s = {s = \\_ => "че" ++ s.s; p = Pos} ;
|
||||
CompQS qs = {s = \\_ => qs.s ! QIndir; p = Pos} ;
|
||||
CompVP ant p vp = {s = let p' = case vp.p of {
|
||||
Neg => Neg;
|
||||
Pos => p.p
|
||||
}
|
||||
in \\agr => ant.s ++ p.s ++
|
||||
daComplex ant.a p' vp ! Perf ! agr;
|
||||
p = Pos
|
||||
} ;
|
||||
|
||||
VPSlashVS vs vp =
|
||||
let vp = insertObj (daComplex Simul Pos vp ! Perf) vp.p (predV vs)
|
||||
in { s = vp.s;
|
||||
ad = vp.ad;
|
||||
compl1 = \\_ => "";
|
||||
compl2 = vp.compl;
|
||||
vtype = vp.vtype;
|
||||
p = vp.p;
|
||||
c2 = {s=""; c=Acc}
|
||||
} ;
|
||||
|
||||
ApposNP np1 np2 = {
|
||||
s = \\role => np1.s ! role ++ comma ++ np2.s ! RSubj ;
|
||||
a = np1.a ;
|
||||
p = np1.p
|
||||
} ;
|
||||
|
||||
UttAdV adv = adv;
|
||||
|
||||
}
|
||||
@@ -1,175 +0,0 @@
|
||||
--# -path=.:../abstract:../translator
|
||||
|
||||
concrete ParseEng of ParseEngAbs =
|
||||
TenseX - [Pol, PNeg, PPos, SC],
|
||||
CatEng,
|
||||
NounEng - [PPartNP],
|
||||
AdjectiveEng,
|
||||
NumeralEng,
|
||||
SymbolEng [PN, Symb, String, CN, Card, NP, MkSymb, SymbPN, CNNumNP],
|
||||
ConjunctionEng,
|
||||
VerbEng - [SlashV2V, PassV2, UseCopula, ComplVV, ComplVS],
|
||||
AdverbEng,
|
||||
PhraseEng,
|
||||
SentenceEng - [UseCl], -- replaced by UseCl | ContractedUseCl
|
||||
QuestionEng,
|
||||
RelativeEng,
|
||||
IdiomEng [NP, VP, Tense, Cl, ProgrVP, ExistNP, SelfAdvVP, SelfAdVVP, SelfNP],
|
||||
ConstructionEng,
|
||||
DocumentationEng,
|
||||
ExtraEng [NP, Quant, VPSlash, VP, Tense, GenNP, PassVPSlash, PassAgentVPSlash,
|
||||
Temp, Pol, Conj, VPS, ListVPS, S, Num, CN, RP, MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS, GenRP,
|
||||
VPI, VPIForm, VPIInf, VPIPresPart, ListVPI, VV, MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV,
|
||||
ComplSlashPartLast,
|
||||
ClSlash, RCl, EmptyRelSlash, VS, V2S, ComplBareVS, SlashBareV2S],
|
||||
|
||||
DictionaryEng **
|
||||
open MorphoEng, ResEng, ParadigmsEng, (G = GrammarEng), (E = ExtraEng), Prelude in {
|
||||
|
||||
flags
|
||||
literal=Symb ;
|
||||
|
||||
-- exceptional linearizations
|
||||
lin
|
||||
UseCl t p cl = G.UseCl t p cl | E.ContractedUseCl t p cl ;
|
||||
|
||||
lin
|
||||
myself_NP = regNP "myself" singular ;
|
||||
yourselfSg_NP = regNP "yourself" singular ;
|
||||
himself_NP = regNP "himself" singular ;
|
||||
herself_NP = regNP "herself" singular ;
|
||||
itself_NP = regNP "itself" singular ;
|
||||
ourselves_NP = regNP "ourselves" plural ;
|
||||
yourselfPl_NP = regNP "yourself" plural ;
|
||||
themselves_NP = regNP "themselves" plural ;
|
||||
|
||||
CompoundSgCN cn1 cn2 = {
|
||||
s = \\n,c => cn1.s ! Sg ! Nom ++ cn2.s ! n ! c ;
|
||||
g = cn2.g
|
||||
} ;
|
||||
|
||||
CompoundPlCN cn1 cn2 = {
|
||||
s = \\n,c => cn1.s ! Pl ! Nom ++ cn2.s ! n ! c ;
|
||||
g = cn2.g
|
||||
} ;
|
||||
|
||||
DashSgN n1 n2 = {
|
||||
s = \\n,c => n1.s ! Sg ! Nom ++ "-" ++ n2.s ! n ! c ;
|
||||
g = n2.g
|
||||
} ;
|
||||
|
||||
DashPlN n1 n2 = {
|
||||
s = \\n,c => n1.s ! Pl ! Nom ++ "-" ++ n2.s ! n ! c ;
|
||||
g = n2.g
|
||||
} ;
|
||||
|
||||
GerundN v = {
|
||||
s = \\n,c => v.s ! VPresPart ;
|
||||
g = Neutr
|
||||
} ;
|
||||
|
||||
GerundAP v = {
|
||||
s = \\agr => v.s ! VPresPart ;
|
||||
isPre = True
|
||||
} ;
|
||||
|
||||
PastPartAP vp = {
|
||||
s = \\a => vp.ad ! a ++ vp.ptp ++ vp.p ++ vp.c2 ++ vp.s2 ! a ++ vp.ext ;
|
||||
isPre = vp.isSimple -- depends on whether there are complements
|
||||
} ;
|
||||
|
||||
OrdCompar a = {s = \\c => a.s ! AAdj Compar c } ;
|
||||
|
||||
PositAdVAdj a = {s = a.s ! AAdv} ;
|
||||
|
||||
UseQuantPN q pn = {s = \\c => q.s ! False ! Sg ++ pn.s ! npcase2case c ; a = agrgP3 Sg pn.g} ;
|
||||
|
||||
SlashV2V v ant p vp = insertObjc (\\a => v.c3 ++ ant.s ++ p.s ++
|
||||
infVP v.typ vp ant.a p.p a)
|
||||
(predVc v) ;
|
||||
|
||||
SlashSlashV2V v ant p vp = insertObjc (\\a => v.c3 ++ ant.s ++ p.s ++
|
||||
infVP v.typ vp ant.a p.p a)
|
||||
(predVc v) ;
|
||||
|
||||
SlashVPIV2V v p vpi = insertObjc (\\a => p.s ++
|
||||
v.c3 ++
|
||||
vpi.s ! VVAux ! a)
|
||||
(predVc v) ;
|
||||
ComplVV v a p vp = insertObj (\\agr => a.s ++ p.s ++
|
||||
infVP v.typ vp a.a p.p agr)
|
||||
(predVV v) ;
|
||||
ComplVS vs s = G.ComplVS vs s | ComplBareVS vs s ;
|
||||
|
||||
PredVPosv np vp = {
|
||||
s = \\t,a,b,o =>
|
||||
let
|
||||
verb = vp.s ! t ! a ! b ! o ! np.a ;
|
||||
compl = vp.s2 ! np.a
|
||||
in
|
||||
case o of {
|
||||
ODir _ => compl ++ frontComma ++ np.s ! npNom ++ verb.aux ++ vp.ad ! np.a ++ verb.fin ++ verb.adv ++ verb.inf ;
|
||||
OQuest => verb.aux ++ compl ++ frontComma ++ np.s ! npNom ++ verb.adv ++ vp.ad ! np.a ++ verb.fin ++ verb.inf
|
||||
}
|
||||
} ;
|
||||
|
||||
PredVPovs np vp = {
|
||||
s = \\t,a,b,o =>
|
||||
let
|
||||
verb = vp.s ! t ! a ! b ! o ! np.a ;
|
||||
compl = vp.s2 ! np.a
|
||||
in
|
||||
case o of {
|
||||
ODir _ => compl ++ frontComma ++ verb.aux ++ verb.adv ++ vp.ad ! np.a ++ verb.fin ++ verb.inf ++ np.s ! npNom ;
|
||||
OQuest => verb.aux ++ compl ++ verb.adv ++ vp.ad ! np.a ++ verb.fin ++ verb.inf ++ np.s ! npNom
|
||||
}
|
||||
} ;
|
||||
|
||||
that_RP = {
|
||||
s = \\_ => "that" ;
|
||||
a = RNoAg
|
||||
} ;
|
||||
|
||||
who_RP = {
|
||||
s = \\_ => "who" ;
|
||||
a = RNoAg
|
||||
} ;
|
||||
|
||||
CompS s = {s = \\_ => "that" ++ s.s} ;
|
||||
CompQS qs = {s = \\_ => qs.s ! QIndir} ;
|
||||
CompVP ant p vp = {s = \\a => ant.s ++ p.s ++
|
||||
infVP VVInf vp ant.a p.p a} ;
|
||||
|
||||
VPSlashVS vs vp =
|
||||
insertObj (\\a => infVP VVInf vp Simul CPos a) (predV vs) **
|
||||
{c2 = ""; missingAdv = False; gapInMiddle = False} ;
|
||||
|
||||
PastPartRS ant pol vps = {
|
||||
s = \\agr => vps.ad ! agr ++ vps.ptp ++ vps.s2 ! agr ;
|
||||
c = npNom
|
||||
} ;
|
||||
|
||||
PresPartRS ant pol vp = {
|
||||
s = \\agr => vp.ad ! agr ++ vp.prp ++ vp.p ++ vp.s2 ! agr;
|
||||
c = npNom
|
||||
} ;
|
||||
|
||||
ApposNP np1 np2 = {
|
||||
s = \\c => np1.s ! c ++ frontComma ++ np2.s ! npNom ++ finalComma ;
|
||||
a = np1.a
|
||||
} ;
|
||||
|
||||
NameCN pn cn = {
|
||||
s = \\n,c => pn.s ! npcase2case npNom ++ cn.s ! n ! c ;
|
||||
g = cn.g
|
||||
} ;
|
||||
|
||||
AdAdV = cc2 ;
|
||||
|
||||
UttAdV adv = adv;
|
||||
|
||||
lin
|
||||
PPos = {s = [] ; p = CPos} ;
|
||||
PNeg = {s = [] ; p = CNeg True} | {s = [] ; p = CNeg False} ;
|
||||
|
||||
}
|
||||
@@ -1,126 +0,0 @@
|
||||
--# -path=.:../english/:../scandinavian:alltenses:../abstract:../translator
|
||||
concrete ParseSwe of ParseEngAbs =
|
||||
TenseSwe,
|
||||
NounSwe - [PPartNP],
|
||||
AdjectiveSwe,
|
||||
NumeralSwe,
|
||||
SymbolSwe [PN, Symb, String, CN, Card, NP, MkSymb, SymbPN, CNNumNP],
|
||||
ConjunctionSwe,
|
||||
VerbSwe - [SlashV2V, PassV2, UseCopula, ComplVV],
|
||||
AdverbSwe,
|
||||
PhraseSwe,
|
||||
SentenceSwe,
|
||||
QuestionSwe,
|
||||
RelativeSwe,
|
||||
IdiomSwe [NP, VP, Tense, Cl, ProgrVP, ExistNP, SelfAdvVP, SelfAdVVP, SelfNP],
|
||||
ConstructionSwe,
|
||||
DocumentationSwe,
|
||||
ExtraSwe [NP, Quant, VPSlash, VP, Tense, GenNP, PassVPSlash, PassAgentVPSlash,
|
||||
Temp, Pol, Conj, VPS, ListVPS, S, Num, CN, RP, MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS, GenRP,
|
||||
VPI, VPIForm, VPIInf, VPIPresPart, ListVPI, VV, MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV,
|
||||
ClSlash, RCl, EmptyRelSlash],
|
||||
|
||||
DictionarySwe **
|
||||
open MorphoSwe, ResSwe, ParadigmsSwe, SyntaxSwe, CommonScand, (E = ExtraSwe), Prelude in {
|
||||
|
||||
flags
|
||||
literal=Symb ;
|
||||
|
||||
lin
|
||||
{-
|
||||
myself_NP = regNP "myself" singular ;
|
||||
yourselfSg_NP = regNP "yourself" singular ;
|
||||
himself_NP = regNP "himself" singular ;
|
||||
herself_NP = regNP "herself" singular ;
|
||||
itself_NP = regNP "itself" singular ;
|
||||
ourself_NP = regNP "ourself" plural ;
|
||||
yourselfPl_NP = regNP "yourself" plural ;
|
||||
themself_NP = regNP "themself" plural ;
|
||||
themselves_NP = regNP "themselves" plural ;
|
||||
-}
|
||||
|
||||
CompoundCN num noun cn = {
|
||||
s = \\n,d,c => num.s ! cn.g ++ noun.co ++ BIND ++ cn.s ! n ! d ! c ;
|
||||
g = cn.g ;
|
||||
isMod = False
|
||||
} ;
|
||||
|
||||
DashCN noun1 noun2 = {
|
||||
s = \\n,d,c => noun1.co ++ BIND ++ noun2.s ! n ! d ! c ;
|
||||
g = noun2.g ;
|
||||
co = noun1.co ++ BIND ++ noun2.co ---- add s if not already there
|
||||
} ;
|
||||
|
||||
GerundN v = {
|
||||
s = \\n,d,c => v.s ! VI (VPtPres n d c) ;
|
||||
g = Neutr ;
|
||||
co = v.s ! VI (VPtPres Sg Indef Nom) ;
|
||||
} ;
|
||||
|
||||
GerundAP v = {
|
||||
s = \\_ => v.s ! VI (VPtPres Sg Indef Nom) ;
|
||||
isPre = True
|
||||
} ;
|
||||
|
||||
PastPartAP v = {
|
||||
s = \\afpos => v.s ! VI (VPtPret afpos Nom) ;
|
||||
isPre = True
|
||||
} ;
|
||||
|
||||
|
||||
OrdCompar a = {
|
||||
s = case a.isComp of {
|
||||
True => "mera" ++ a.s ! AF (APosit (Weak Sg)) Nom ;
|
||||
_ => a.s ! AF ACompar Nom
|
||||
} ;
|
||||
isDet = True
|
||||
} ;
|
||||
|
||||
PositAdVAdj a = {s = a.s ! adverbForm} ;
|
||||
|
||||
UseQuantPN q pn = {
|
||||
s = \\c => q.s ! Sg ! True ! False ! pn.g ++ pn.s ! caseNP c ;
|
||||
a = agrP3 pn.g Sg
|
||||
} ;
|
||||
|
||||
SlashV2V v ant p vp = predV v ** {
|
||||
n3 = \\a => v.c3.s ++ ant.s ++ p.s ++ infVPPlus vp a ant.a p.p ;
|
||||
c2 = v.c2
|
||||
} ;
|
||||
|
||||
SlashVPIV2V v p vpi = predV v ** {
|
||||
n3 = \\a => v.c3.s ++ p.s ++ negation ! p.p ++ vpi.s ! VPIInf ! a ;
|
||||
c2 = v.c2
|
||||
} ;
|
||||
|
||||
ComplVV v ant pol vp = insertObjPost (\\a => v.c2.s ++ ant.s ++ pol.s ++ infVPPlus vp a ant.a pol.p) (predV v) ;
|
||||
|
||||
|
||||
PredVPosv np vp = mkCl np vp ; ---- TODO restructure all this using Extra.Foc
|
||||
PredVPovs np vp = mkCl np vp ; ----
|
||||
|
||||
that_RP = which_RP ; -- som
|
||||
who_RP = which_RP ;
|
||||
|
||||
CompS s = {s = \\_ => "att" ++ s.s ! Sub} ;
|
||||
CompQS qs = {s = \\_ => qs.s ! QIndir} ;
|
||||
CompVP ant p vp = {s = \\a => ant.s ++ p.s ++ infVPPlus vp a ant.a p.p} ;
|
||||
|
||||
-- VPSlashVS : VS -> VP -> VPSlash
|
||||
---VPSlashVS vs vp =
|
||||
--- insertObj (\\a => infVP VVInf vp Simul CPos a) (predV vs) **
|
||||
--- {c2 = ""; gapInMiddle = False} ;
|
||||
|
||||
PastPartRS ant pol vps = mkRS ant pol (mkRCl which_RP <lin VP vps : VP> ) ; ---- maybe as participle construction?
|
||||
|
||||
PresPartRS ant pol vp = mkRS ant pol (mkRCl which_RP vp) ; --- probably not as participle construction
|
||||
|
||||
ApposNP np1 np2 = {
|
||||
s = \\c => np1.s ! c ++ comma ++ np2.s ! NPNom ;
|
||||
a = np1.a
|
||||
} ;
|
||||
|
||||
AdAdV = cc2 ;
|
||||
|
||||
UttAdV adv = adv;
|
||||
}
|
||||
Reference in New Issue
Block a user