mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-25 02:38:55 -06:00
changes in the ParseEng grammar to bring it closer to the Translate grammar
This commit is contained in:
@@ -8,7 +8,7 @@ concrete ParseEng of ParseEngAbs =
|
|||||||
NumeralEng,
|
NumeralEng,
|
||||||
SymbolEng [PN, Symb, String, CN, Card, NP, MkSymb, SymbPN, CNNumNP],
|
SymbolEng [PN, Symb, String, CN, Card, NP, MkSymb, SymbPN, CNNumNP],
|
||||||
ConjunctionEng,
|
ConjunctionEng,
|
||||||
VerbEng - [SlashV2V, PassV2, UseCopula, ComplVV],
|
VerbEng - [SlashV2V, PassV2, UseCopula, ComplVV, ComplVS],
|
||||||
AdverbEng,
|
AdverbEng,
|
||||||
PhraseEng,
|
PhraseEng,
|
||||||
SentenceEng - [UseCl], -- replaced by UseCl | ContractedUseCl
|
SentenceEng - [UseCl], -- replaced by UseCl | ContractedUseCl
|
||||||
@@ -24,14 +24,14 @@ concrete ParseEng of ParseEngAbs =
|
|||||||
ClSlash, RCl, EmptyRelSlash, VS, V2S, ComplBareVS, SlashBareV2S],
|
ClSlash, RCl, EmptyRelSlash, VS, V2S, ComplBareVS, SlashBareV2S],
|
||||||
|
|
||||||
DictionaryEng **
|
DictionaryEng **
|
||||||
open MorphoEng, ResEng, ParadigmsEng, (S = SentenceEng), (E = ExtraEng), Prelude in {
|
open MorphoEng, ResEng, ParadigmsEng, (G = GrammarEng), (E = ExtraEng), Prelude in {
|
||||||
|
|
||||||
flags
|
flags
|
||||||
literal=Symb ;
|
literal=Symb ;
|
||||||
|
|
||||||
-- exceptional linearizations
|
-- exceptional linearizations
|
||||||
lin
|
lin
|
||||||
UseCl t p cl = S.UseCl t p cl | E.ContractedUseCl t p cl ;
|
UseCl t p cl = G.UseCl t p cl | E.ContractedUseCl t p cl ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
myself_NP = regNP "myself" singular ;
|
myself_NP = regNP "myself" singular ;
|
||||||
@@ -43,14 +43,24 @@ lin
|
|||||||
yourselfPl_NP = regNP "yourself" plural ;
|
yourselfPl_NP = regNP "yourself" plural ;
|
||||||
themselves_NP = regNP "themselves" plural ;
|
themselves_NP = regNP "themselves" plural ;
|
||||||
|
|
||||||
CompoundCN num noun cn = {
|
CompoundSgCN cn1 cn2 = {
|
||||||
s = \\n,c => num.s ! Nom ++ noun.s ! num.n ! Nom ++ cn.s ! n ! c ;
|
s = \\n,c => cn1.s ! Sg ! Nom ++ cn2.s ! n ! c ;
|
||||||
g = cn.g
|
g = cn2.g
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
DashCN noun1 noun2 = {
|
CompoundPlCN cn1 cn2 = {
|
||||||
s = \\n,c => noun1.s ! Sg ! Nom ++ "-" ++ noun2.s ! n ! c ;
|
s = \\n,c => cn1.s ! Pl ! Nom ++ cn2.s ! n ! c ;
|
||||||
g = noun2.g
|
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 = {
|
GerundN v = {
|
||||||
@@ -63,9 +73,9 @@ lin
|
|||||||
isPre = True
|
isPre = True
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PastPartAP v = {
|
PastPartAP vp = {
|
||||||
s = \\agr => v.s ! VPPart ;
|
s = \\a => vp.ad ! a ++ vp.ptp ++ vp.p ++ vp.c2 ++ vp.s2 ! a ++ vp.ext ;
|
||||||
isPre = True
|
isPre = vp.isSimple -- depends on whether there are complements
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
OrdCompar a = {s = \\c => a.s ! AAdj Compar c } ;
|
OrdCompar a = {s = \\c => a.s ! AAdj Compar c } ;
|
||||||
@@ -89,6 +99,7 @@ lin
|
|||||||
ComplVV v a p vp = insertObj (\\agr => a.s ++ p.s ++
|
ComplVV v a p vp = insertObj (\\agr => a.s ++ p.s ++
|
||||||
infVP v.typ vp a.a p.p agr)
|
infVP v.typ vp a.a p.p agr)
|
||||||
(predVV v) ;
|
(predVV v) ;
|
||||||
|
ComplVS vs s = G.ComplVS vs s | ComplBareVS vs s ;
|
||||||
|
|
||||||
PredVPosv np vp = {
|
PredVPosv np vp = {
|
||||||
s = \\t,a,b,o =>
|
s = \\t,a,b,o =>
|
||||||
@@ -148,6 +159,11 @@ lin
|
|||||||
a = np1.a
|
a = np1.a
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
NameCN pn cn = {
|
||||||
|
s = \\n,c => pn.s ! npcase2case npNom ++ cn.s ! n ! c ;
|
||||||
|
g = cn.g
|
||||||
|
} ;
|
||||||
|
|
||||||
AdAdV = cc2 ;
|
AdAdV = cc2 ;
|
||||||
|
|
||||||
UttAdV adv = adv;
|
UttAdV adv = adv;
|
||||||
|
|||||||
@@ -24,14 +24,15 @@ abstract ParseEngAbs =
|
|||||||
flags
|
flags
|
||||||
startcat=Phr;
|
startcat=Phr;
|
||||||
heuristic_search_factor=0.60;
|
heuristic_search_factor=0.60;
|
||||||
--- meta_prob=1.0e-5;
|
|
||||||
--- meta_token_prob=1.1965149246222233e-9;
|
|
||||||
|
|
||||||
fun CompoundCN : Num -> N -> CN -> CN ;
|
fun CompoundSgCN : CN -> CN -> CN ;
|
||||||
DashCN : N -> N -> N ;
|
CompoundPlCN : CN -> CN -> CN ;
|
||||||
|
DashSgN : N -> N -> N ;
|
||||||
|
DashPlN : N -> N -> N ;
|
||||||
GerundN : V -> N ;
|
GerundN : V -> N ;
|
||||||
|
|
||||||
GerundAP : V -> AP ;
|
GerundAP : V -> AP ;
|
||||||
PastPartAP : V2 -> AP ;
|
PastPartAP : VPSlash -> AP ;
|
||||||
myself_NP : NP ;
|
myself_NP : NP ;
|
||||||
yourselfSg_NP : NP ;
|
yourselfSg_NP : NP ;
|
||||||
himself_NP : NP ;
|
himself_NP : NP ;
|
||||||
@@ -68,7 +69,9 @@ fun CompoundCN : Num -> N -> CN -> CN ;
|
|||||||
PresPartRS : Ant -> Pol -> VP -> RS ;
|
PresPartRS : Ant -> Pol -> VP -> RS ;
|
||||||
|
|
||||||
ApposNP : NP -> NP -> NP ;
|
ApposNP : NP -> NP -> NP ;
|
||||||
|
|
||||||
|
NameCN : PN -> CN -> CN ;
|
||||||
|
|
||||||
AdAdV : AdA -> AdV -> AdV ;
|
AdAdV : AdA -> AdV -> AdV ;
|
||||||
|
|
||||||
UttAdV : AdV -> Utt;
|
UttAdV : AdV -> Utt;
|
||||||
|
|||||||
Reference in New Issue
Block a user