forked from GitHub/gf-core
working through translator/Extensions with some reorganization and generalizations
This commit is contained in:
@@ -28,6 +28,7 @@ This will take a long time (ten minutes or more) and will probably require at le
|
|||||||
```
|
```
|
||||||
with obviously the possibility to vary the source and the target language.
|
with obviously the possibility to vary the source and the target language.
|
||||||
|
|
||||||
|
|
||||||
4. To modify the sources, work on the files in
|
4. To modify the sources, work on the files in
|
||||||
```
|
```
|
||||||
GF/lib/src/translator/
|
GF/lib/src/translator/
|
||||||
|
|||||||
@@ -95,4 +95,9 @@ abstract Extra = Cat ** {
|
|||||||
ComplBareVS : VS -> S -> VP ; -- say she runs
|
ComplBareVS : VS -> S -> VP ; -- say she runs
|
||||||
SlashBareV2S : V2S -> S -> VPSlash ; -- answer (to him) it is good
|
SlashBareV2S : V2S -> S -> VPSlash ; -- answer (to him) it is good
|
||||||
|
|
||||||
|
-- front the extraposed part
|
||||||
|
|
||||||
|
FrontExtPredVP : NP -> VP -> Cl ; -- I am here, she said
|
||||||
|
InvFrontExtPredVP : NP -> VP -> Cl ; -- I am here, said she
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,8 +89,8 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
|
|||||||
IAdvAdv adv = {s = "how" ++ adv.s} ;
|
IAdvAdv adv = {s = "how" ++ adv.s} ;
|
||||||
|
|
||||||
PartVP vp = {
|
PartVP vp = {
|
||||||
s = \\a => vp.ad ! a ++ vp.prp ++ vp.s2 ! a ;
|
s = \\a => vp.ad ! a ++ vp.prp ++ vp.s2 ! a ++ vp.ext ;
|
||||||
isPre = False ---- depends on whether there are complements
|
isPre = vp.isSimple -- depends on whether there are complements
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
EmbedPresPart vp = {s = infVP VVPresPart vp Simul CPos (agrP3 Sg)} ; --- agr
|
EmbedPresPart vp = {s = infVP VVPresPart vp Simul CPos (agrP3 Sg)} ; --- agr
|
||||||
@@ -162,6 +162,7 @@ lin
|
|||||||
inf = be.inf ;
|
inf = be.inf ;
|
||||||
ad = \\_ => [] ;
|
ad = \\_ => [] ;
|
||||||
s2 = \\a => vps.ad ! a ++ ppt ++ vps.p ++ ag ++ vps.s2 ! a ++ vps.c2 ; ---- place of agent
|
s2 = \\a => vps.ad ! a ++ ppt ++ vps.p ++ ag ++ vps.s2 ! a ++ vps.c2 ; ---- place of agent
|
||||||
|
isSimple = False ;
|
||||||
ext = vps.ext
|
ext = vps.ext
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -210,6 +211,36 @@ lin
|
|||||||
|
|
||||||
CompoundCN a b = {s = \\n,c => a.s ! Sg ! Nom ++ b.s ! n ! c ; g = b.g} ;
|
CompoundCN a b = {s = \\n,c => a.s ! Sg ! Nom ++ b.s ! n ! c ; g = b.g} ;
|
||||||
|
|
||||||
|
FrontExtPredVP np vp = {
|
||||||
|
s = \\t,a,b,o =>
|
||||||
|
let
|
||||||
|
subj = np.s ! npNom ;
|
||||||
|
agr = np.a ;
|
||||||
|
verb = vp.s ! t ! a ! b ! o ! agr ;
|
||||||
|
compl = vp.s2 ! agr
|
||||||
|
in
|
||||||
|
case o of {
|
||||||
|
ODir _ => vp.ext ++ frontComma ++ subj ++ verb.aux ++ verb.adv ++ vp.ad ! agr ++ verb.fin ++ verb.inf ++ vp.p ++ compl ;
|
||||||
|
OQuest => verb.aux ++ subj ++ verb.adv ++ vp.ad ! agr ++ verb.fin ++ verb.inf ++ vp.p ++ compl ++ vp.ext
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InvFrontExtPredVP np vp = {
|
||||||
|
s = \\t,a,b,o =>
|
||||||
|
let
|
||||||
|
subj = np.s ! npNom ;
|
||||||
|
agr = np.a ;
|
||||||
|
verb = vp.s ! t ! a ! b ! o ! agr ;
|
||||||
|
compl = vp.s2 ! agr
|
||||||
|
in
|
||||||
|
case o of {
|
||||||
|
ODir _ => vp.ext ++ verb.aux ++ verb.adv ++ vp.ad ! agr ++ verb.fin ++ subj ++ verb.inf ++ vp.p ++ compl ;
|
||||||
|
OQuest => verb.aux ++ subj ++ verb.adv ++ vp.ad ! agr ++ verb.fin ++ verb.inf ++ vp.p ++ compl ++ vp.ext
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
oper
|
oper
|
||||||
unc : CPolarity -> CPolarity = \x -> case x of {
|
unc : CPolarity -> CPolarity = \x -> case x of {
|
||||||
CNeg _ => CNeg False ;
|
CNeg _ => CNeg False ;
|
||||||
|
|||||||
@@ -237,7 +237,8 @@ param
|
|||||||
inf : Str ; -- the infinitive form ; VerbForms would be the logical place
|
inf : Str ; -- the infinitive form ; VerbForms would be the logical place
|
||||||
ad : Agr => Str ; -- sentence adverb (can be Xself, hence Agr)
|
ad : Agr => Str ; -- sentence adverb (can be Xself, hence Agr)
|
||||||
s2 : Agr => Str ; -- complement
|
s2 : Agr => Str ; -- complement
|
||||||
ext : Str -- extreposed field such as S, QS, VP
|
ext : Str ; -- extreposed field such as S, QS, VP
|
||||||
|
isSimple : Bool -- regulates the place of participle used as adjective
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
@@ -293,6 +294,7 @@ param
|
|||||||
inf = verb.s ! VInf ;
|
inf = verb.s ! VInf ;
|
||||||
ad = \\_ => [] ;
|
ad = \\_ => [] ;
|
||||||
ext = [] ;
|
ext = [] ;
|
||||||
|
isSimple = True ; ---- but really depends on whether p == []
|
||||||
s2 = \\a => if_then_Str verb.isRefl (reflPron ! a) []
|
s2 = \\a => if_then_Str verb.isRefl (reflPron ! a) []
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -351,6 +353,7 @@ param
|
|||||||
inf = verb.inf ;
|
inf = verb.inf ;
|
||||||
ad = \\_ => [] ;
|
ad = \\_ => [] ;
|
||||||
ext = [] ;
|
ext = [] ;
|
||||||
|
isSimple = True ;
|
||||||
s2 = \\_ => []
|
s2 = \\_ => []
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -374,6 +377,7 @@ param
|
|||||||
inf = vp.inf ;
|
inf = vp.inf ;
|
||||||
ad = vp.ad ;
|
ad = vp.ad ;
|
||||||
s2 = \\a => vp.s2 ! a ++ obj ! a ;
|
s2 = \\a => vp.s2 ! a ++ obj ! a ;
|
||||||
|
isSimple = False ;
|
||||||
ext = vp.ext
|
ext = vp.ext
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -385,6 +389,7 @@ param
|
|||||||
inf = vp.inf ;
|
inf = vp.inf ;
|
||||||
ad = vp.ad ;
|
ad = vp.ad ;
|
||||||
s2 = \\a => obj ! a ++ vp.s2 ! a ;
|
s2 = \\a => obj ! a ++ vp.s2 ! a ;
|
||||||
|
isSimple = False ;
|
||||||
ext = vp.ext
|
ext = vp.ext
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -402,6 +407,7 @@ param
|
|||||||
inf = vp.inf ;
|
inf = vp.inf ;
|
||||||
ad = vp.ad ;
|
ad = vp.ad ;
|
||||||
s2 = \\a => obj ! a ++ vp.s2 ! a ++ vp.p ; -- and put it here ; corresponds to insertObjPre
|
s2 = \\a => obj ! a ++ vp.s2 ! a ++ vp.p ; -- and put it here ; corresponds to insertObjPre
|
||||||
|
isSimple = False ;
|
||||||
ext = vp.ext
|
ext = vp.ext
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -417,6 +423,7 @@ param
|
|||||||
inf = vp.inf ;
|
inf = vp.inf ;
|
||||||
ad = \\a => vp.ad ! a ++ ad ! a ;
|
ad = \\a => vp.ad ! a ++ ad ! a ;
|
||||||
s2 = \\a => vp.s2 ! a ;
|
s2 = \\a => vp.s2 ! a ;
|
||||||
|
isSimple = False ;
|
||||||
ext = vp.ext
|
ext = vp.ext
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -428,6 +435,7 @@ param
|
|||||||
inf = vp.inf ;
|
inf = vp.inf ;
|
||||||
ad = vp.ad ;
|
ad = vp.ad ;
|
||||||
s2 = vp.s2 ;
|
s2 = vp.s2 ;
|
||||||
|
isSimple = False ;
|
||||||
ext = vp.ext ++ e --- there should be at most one, one might think; but: I would say that it will be raining if I saw clouds
|
ext = vp.ext ++ e --- there should be at most one, one might think; but: I would say that it will be raining if I saw clouds
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,11 @@ fun
|
|||||||
ConjVPS : Conj -> [VPS] -> VPS ;
|
ConjVPS : Conj -> [VPS] -> VPS ;
|
||||||
PredVPS : NP -> VPS -> S ;
|
PredVPS : NP -> VPS -> S ;
|
||||||
|
|
||||||
|
---- merge VPS and VPI
|
||||||
|
---- MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS,
|
||||||
|
---- VPIForm, VPIInf, VPIPresPart, MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV,
|
||||||
|
|
||||||
|
|
||||||
-- generalizing Grammar
|
-- generalizing Grammar
|
||||||
|
|
||||||
PassVPSlash : VPSlash -> VP ; -- be forced to sleep
|
PassVPSlash : VPSlash -> VP ; -- be forced to sleep
|
||||||
@@ -28,6 +33,9 @@ fun
|
|||||||
|
|
||||||
ComplVV : VV -> Ant -> Pol -> VP -> VP ; -- want not to have slept
|
ComplVV : VV -> Ant -> Pol -> VP -> VP ; -- want not to have slept
|
||||||
|
|
||||||
|
PredFrontVS : Temp -> NP -> VS -> S -> S ; -- I am here, she said -- no negation
|
||||||
|
PredFrontVQ : Temp -> NP -> VQ -> QS -> S ; -- are you here, she asked -- no negation; direct order
|
||||||
|
|
||||||
---- merge?
|
---- merge?
|
||||||
SlashV2V : V2V -> Ant -> Pol -> VP -> VPSlash ; -- force (her) not to have slept
|
SlashV2V : V2V -> Ant -> Pol -> VP -> VPSlash ; -- force (her) not to have slept
|
||||||
SlashVPIV2V : V2V -> Pol -> VPI -> VPSlash ; -- force (her) not to sleep and dream
|
SlashVPIV2V : V2V -> Pol -> VPI -> VPSlash ; -- force (her) not to sleep and dream
|
||||||
@@ -39,40 +47,18 @@ fun
|
|||||||
GenIP : IP -> IQuant ; -- whose
|
GenIP : IP -> IQuant ; -- whose
|
||||||
GenRP : Num -> CN -> RP ; -- whose car(s)
|
GenRP : Num -> CN -> RP ; -- whose car(s)
|
||||||
|
|
||||||
---- should be covered by variants
|
CompoundCN : N -> CN -> CN ; -- control system / controls system / control-system
|
||||||
---- ComplBareVS : VS -> S -> VP ; -- know you go
|
|
||||||
---- SlashBareV2S : V2S -> S -> VPSlash ; -- answer (to him) it is good
|
|
||||||
---- ComplSlashPartLast : VPSlash -> NP -> VP ;
|
|
||||||
|
|
||||||
---- merge VPS and VPI
|
GerundCN : VP -> CN ; -- publishing of the document (can get a determiner)
|
||||||
---- MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS,
|
GerundNP : VP -> NP ; -- publishing the document (by nature definite)
|
||||||
---- VPIForm, VPIInf, VPIPresPart, MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV,
|
GerundAdv : VP -> Adv ; -- publishing the document (prepositionless adverb)
|
||||||
|
|
||||||
|
PresPartAP : VP -> AP ; -- sleeping (man), (man) sleeping in the car
|
||||||
|
|
||||||
---- merge these two? --- Sg/Pl CN CN CN --- four wheel drive, random number generator
|
PastPartAP : VPSlash -> AP ; -- lost (opportunity) ; (opportunity) lost in space
|
||||||
CompoundCN : Num -> N -> CN -> CN ;
|
PastPartAgentAP : VPSlash -> NP -> AP ; -- (opportunity) lost by the company
|
||||||
DashCN : N -> N -> N ;
|
|
||||||
|
|
||||||
---- merge ?
|
UseQuantPN : Quant -> PN -> NP; -- this John
|
||||||
---- NominalizeVPSlashNP : VPSlash -> NP -> NP ; -- publishing of the document
|
|
||||||
---- EmbedPresPart : VP -> SC ; -- looking at Mary (is fun)
|
|
||||||
GerundN : V -> N ; -- sleeping
|
|
||||||
|
|
||||||
---- merge ?
|
|
||||||
---- PartVP : VP -> AP ; -- (man) looking at Mary
|
|
||||||
GerundAP : V -> AP ; -- sleeping (man)
|
|
||||||
|
|
||||||
PastPartAP : V2 -> AP ; -- lost (opportunity) --- gen to VPSLash
|
|
||||||
|
|
||||||
---- why is this needed?
|
|
||||||
OrdCompar : A -> Ord ; -- (my) better (side)
|
|
||||||
|
|
||||||
UseQuantPN : Quant -> PN -> NP; -- this John
|
|
||||||
|
|
||||||
SlashSlashV2V : V2V -> Ant -> Pol -> VPSlash -> VPSlash ; ---- what is this?
|
|
||||||
|
|
||||||
---- eliminate as topicalizations
|
|
||||||
PredVPosv,PredVPovs : NP -> VP -> Cl ;
|
|
||||||
|
|
||||||
---- merge with IdRP?
|
---- merge with IdRP?
|
||||||
that_RP : RP ;
|
that_RP : RP ;
|
||||||
@@ -95,5 +81,35 @@ fun
|
|||||||
CompS : S -> Comp ; -- (the fact is) that she sleeps
|
CompS : S -> Comp ; -- (the fact is) that she sleeps
|
||||||
CompQS : QS -> Comp ; -- (the question is) who sleeps
|
CompQS : QS -> Comp ; -- (the question is) who sleeps
|
||||||
CompVP : Ant -> Pol -> VP -> Comp ; -- (she is) to go
|
CompVP : Ant -> Pol -> VP -> Comp ; -- (she is) to go
|
||||||
|
|
||||||
|
SlashSlashV2V : V2V -> Ant -> Pol -> VPSlash -> VPSlash ; -- induce them to sell (it) -- analogous to Verb.SlashVV
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{-
|
||||||
|
-- changes from ParseEngAbs
|
||||||
|
|
||||||
|
ComplBareVS -> ComplVS -- as variant
|
||||||
|
SlashBareV2S -> SlashV2S -- as variant
|
||||||
|
ComplSlashPartLast -> ComplSlash -- as variant
|
||||||
|
|
||||||
|
CompoundCN Sg/Pl -> CompoundCN -- as variants
|
||||||
|
DashCN -> CompoundCN -- as variant
|
||||||
|
|
||||||
|
GerundN -> GerundCN -- special case: now CN
|
||||||
|
-> GerundNP -- an NP version without determiner
|
||||||
|
-> GerundAdv -- an Adv version without determiner or preposition
|
||||||
|
|
||||||
|
GerundAP -> PresPartAP -- special case: now with a VP argument
|
||||||
|
|
||||||
|
PastPartAP -> PastPartAP -- now with VPSlash argument
|
||||||
|
-> PastPartAgentAP -- VPSlash + by NP
|
||||||
|
|
||||||
|
OrdCompar -> UseComparA -- the only use in PTB reduces to this standard RGL function
|
||||||
|
|
||||||
|
PredVPosv -> PredFrontVS, PredFrontVQ -- restricted to the special case actually occurring in PTB
|
||||||
|
PredVPovs -> -- inversion treated as variant: I am here, said she
|
||||||
|
|
||||||
|
|
||||||
|
-}
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ lin
|
|||||||
EmptyRelSlash = E.EmptyRelSlash ;
|
EmptyRelSlash = E.EmptyRelSlash ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
CompoundCN num noun cn = {
|
CompoundCN noun cn = {
|
||||||
s = \\nf => num.s ! CFNeut Indef ++ (noun.rel ! nform2aform nf cn.g) ++ (cn.s ! (indefNForm nf)) ;
|
s = \\nf => (noun.rel ! nform2aform nf cn.g) ++ (cn.s ! (indefNForm nf)) ;
|
||||||
g = cn.g
|
g = cn.g
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -44,8 +44,7 @@ lin
|
|||||||
|
|
||||||
-- but_Subj = {s = "pero" ; m = Indic} ; ---- strange to have this as Subj
|
-- but_Subj = {s = "pero" ; m = Indic} ; ---- strange to have this as Subj
|
||||||
|
|
||||||
CompoundCN num noun cn = {s = num.s ++ noun.s ++ cn.s ; c = cn.c} ; ----
|
CompoundCN noun cn = {s = noun.s ++ cn.s ; c = cn.c} ; ----
|
||||||
DashCN noun cn = {s = noun.s ++ cn.s ; c = cn.c} ; ----
|
|
||||||
|
|
||||||
GerundN v = {
|
GerundN v = {
|
||||||
s = v.s ;
|
s = v.s ;
|
||||||
@@ -59,7 +58,7 @@ DashCN noun cn = {s = noun.s ++ cn.s ; c = cn.c} ; ----
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
PastPartAP v = {
|
PastPartAP v = {
|
||||||
s = v.s ++ de_s ;
|
s = v.verb.s ++ de_s ; ----
|
||||||
monoSyl = False ;
|
monoSyl = False ;
|
||||||
hasAdA = True ; ---
|
hasAdA = True ; ---
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -33,32 +33,48 @@ lin
|
|||||||
EmptyRelSlash = E.EmptyRelSlash ;
|
EmptyRelSlash = E.EmptyRelSlash ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
CompoundCN num noun cn = {
|
CompoundCN noun cn = {
|
||||||
s = \\n,c => num.s ! Nom ++ noun.s ! num.n ! Nom ++ cn.s ! n ! c ;
|
s = (\\n,c => noun.s ! Sg ! Nom ++ cn.s ! n ! c)
|
||||||
|
| (\\n,c => noun.s ! Pl ! Nom ++ cn.s ! n ! c)
|
||||||
|
| (\\n,c => noun.s ! Sg ! Nom ++ Predef.BIND ++ "-" ++ Predef.BIND ++ cn.s ! n ! c)
|
||||||
|
| (\\n,c => noun.s ! Pl ! Nom ++ Predef.BIND ++ "-" ++ Predef.BIND ++ cn.s ! n ! c)
|
||||||
|
;
|
||||||
g = cn.g
|
g = cn.g
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
DashCN noun1 noun2 = {
|
|
||||||
s = \\n,c => noun1.s ! Sg ! Nom ++ "-" ++ noun2.s ! n ! c ;
|
|
||||||
g = noun2.g
|
|
||||||
} ;
|
|
||||||
|
|
||||||
GerundN v = {
|
GerundCN vp = {
|
||||||
s = \\n,c => v.s ! VPresPart ;
|
s = \\n,c => vp.ad ! AgP3Sg Neutr ++ vp.prp ++
|
||||||
g = Neutr
|
case <n,c> of {
|
||||||
} ;
|
<Sg,Nom> => "" ;
|
||||||
|
<Sg,Gen> => Predef.BIND ++ "'s" ;
|
||||||
GerundAP v = {
|
<Pl,Nom> => Predef.BIND ++ "s" ;
|
||||||
s = \\agr => v.s ! VPresPart ;
|
<Pl,Gen> => Predef.BIND ++ "s'"
|
||||||
isPre = True
|
} ++
|
||||||
} ;
|
vp.s2 ! AgP3Sg Neutr ++ vp.ext ;
|
||||||
|
g = Neutr
|
||||||
|
} ;
|
||||||
|
|
||||||
PastPartAP v = {
|
GerundNP vp =
|
||||||
s = \\agr => v.s ! VPPart ;
|
let a = AgP3Sg Neutr
|
||||||
isPre = True
|
in
|
||||||
} ;
|
{s = \\_ => vp.ad ! a ++ vp.prp ++ vp.s2 ! a ++ vp.ext ; a = a} ;
|
||||||
|
|
||||||
OrdCompar a = {s = \\c => a.s ! AAdj Compar c } ;
|
GerundAdv vp =
|
||||||
|
let a = AgP3Sg Neutr
|
||||||
|
in
|
||||||
|
{s = vp.ad ! a ++ vp.prp ++ vp.s2 ! a ++ vp.ext} ;
|
||||||
|
|
||||||
|
PresPartAP = E.PartVP ;
|
||||||
|
|
||||||
|
PastPartAP vp = {
|
||||||
|
s = \\a => vp.ad ! a ++ vp.ptp ++ vp.c2 ++ vp.s2 ! a ++ vp.ext ;
|
||||||
|
isPre = vp.isSimple -- depends on whether there are complements
|
||||||
|
} ;
|
||||||
|
PastPartAgentAP vp np = {
|
||||||
|
s = \\a => vp.ad ! a ++ vp.ptp ++ vp.c2 ++ vp.s2 ! a ++ "by" ++ np.s ! NPAcc ++ vp.ext ;
|
||||||
|
isPre = vp.isSimple -- depends on whether there are complements
|
||||||
|
} ;
|
||||||
|
|
||||||
PositAdVAdj a = {s = a.s ! AAdv} ;
|
PositAdVAdj a = {s = a.s ! AAdv} ;
|
||||||
|
|
||||||
@@ -80,28 +96,18 @@ lin
|
|||||||
infVP v.typ vp a.a p.p agr)
|
infVP v.typ vp a.a p.p agr)
|
||||||
(predVV v) ;
|
(predVV v) ;
|
||||||
|
|
||||||
PredVPosv np vp = {
|
PredFrontVS t np vs s =
|
||||||
s = \\t,a,b,o =>
|
let
|
||||||
let
|
cl = mkClause (np.s ! npNom) np.a (predV vs) | E.InvFrontExtPredVP np (predV vs)
|
||||||
verb = vp.s ! t ! a ! b ! o ! np.a ;
|
in {
|
||||||
compl = vp.s2 ! np.a
|
s = s.s ++ frontComma ++ t.s ++ t.s ++ cl.s ! t.t ! t.a ! CPos ! oDir
|
||||||
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 = {
|
PredFrontVQ t np vs s =
|
||||||
s = \\t,a,b,o =>
|
let
|
||||||
let
|
cl = mkClause (np.s ! npNom) np.a (predV vs) | E.InvFrontExtPredVP np (predV vs)
|
||||||
verb = vp.s ! t ! a ! b ! o ! np.a ;
|
in {
|
||||||
compl = vp.s2 ! np.a
|
s = s.s ! QDir ++ frontComma ++ t.s ++ cl.s ! t.t ! t.a ! CPos ! oDir
|
||||||
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 = {
|
that_RP = {
|
||||||
|
|||||||
@@ -47,17 +47,12 @@ lin
|
|||||||
}
|
}
|
||||||
) ;
|
) ;
|
||||||
|
|
||||||
CompoundCN num noun cn = {
|
CompoundCN noun cn = {
|
||||||
s = \\nf => num.s ! Sg ! Nom ++ noun.s ! 10 ++ BIND ++ cn.s ! nf ;
|
s = \\nf => noun.s ! 10 ++ BIND ++ cn.s ! nf ;
|
||||||
h = cn.h
|
h = cn.h
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
DashCN noun1 noun2 = {
|
---- PastPartAP vp = {s = \\_,nf => (sverb2verbSep v).s ! PastPartPass (AN nf)} ;
|
||||||
s = \\nf => noun1.s ! 10 ++ BIND ++ noun2.s ! nf ;
|
|
||||||
h = noun2.h
|
|
||||||
} ;
|
|
||||||
|
|
||||||
PastPartAP v = {s = \\_,nf => (sverb2verbSep v).s ! PastPartPass (AN nf)} ;
|
|
||||||
|
|
||||||
PredVPosv np vp = mkCl np vp ; ----
|
PredVPosv np vp = mkCl np vp ; ----
|
||||||
|
|
||||||
|
|||||||
@@ -48,17 +48,12 @@ lin
|
|||||||
|
|
||||||
|
|
||||||
lin
|
lin
|
||||||
CompoundCN num noun cn = {
|
CompoundCN noun cn = {
|
||||||
s = \\n => cn.s ! n ++ elisDe ++ noun.s ! num.n ;
|
s = \\n => cn.s ! n ++ elisDe ++ noun.s ! Sg ;
|
||||||
g = cn.g
|
g = cn.g
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
{-
|
{-
|
||||||
DashCN noun1 noun2 = {
|
|
||||||
s = \\n,c => noun1.s ! Sg ! Nom ++ "-" ++ noun2.s ! n ! c ;
|
|
||||||
g = noun2.g
|
|
||||||
} ;
|
|
||||||
|
|
||||||
GerundN v = {
|
GerundN v = {
|
||||||
s = \\n,c => v.s ! VPresPart ;
|
s = \\n,c => v.s ! VPresPart ;
|
||||||
g = Neutr
|
g = Neutr
|
||||||
@@ -68,7 +63,7 @@ lin
|
|||||||
s = \\agr => v.s ! VPresPart ;
|
s = \\agr => v.s ! VPresPart ;
|
||||||
isPre = True
|
isPre = True
|
||||||
} ;
|
} ;
|
||||||
-}
|
-- }
|
||||||
|
|
||||||
PastPartAP v = {
|
PastPartAP v = {
|
||||||
s = table {
|
s = table {
|
||||||
@@ -78,7 +73,7 @@ lin
|
|||||||
isPre = True
|
isPre = True
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
{-
|
--{-
|
||||||
OrdCompar a = {s = \\c => a.s ! AAdj Compar c } ;
|
OrdCompar a = {s = \\c => a.s ! AAdj Compar c } ;
|
||||||
-}
|
-}
|
||||||
|
|
||||||
|
|||||||
@@ -63,17 +63,11 @@ lin
|
|||||||
PredVPosv = G.PredVP;
|
PredVPosv = G.PredVP;
|
||||||
PredVPovs = G.PredVP;
|
PredVPovs = G.PredVP;
|
||||||
|
|
||||||
CompoundCN num noun cn = {
|
CompoundCN noun cn = {
|
||||||
s = \\a,n,c => num.s ! noun.g ! Nom ++ glue (noun.s ! num.n ! Nom) (cn.s ! a ! n ! c) ;
|
s = \\a,n,c => glue (noun.s ! Sg ! Nom) (cn.s ! a ! n ! c) ;
|
||||||
g = cn.g
|
g = cn.g
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
DashCN noun1 noun2 = { -- type-checking
|
|
||||||
s = \\n,c => glue (noun1.s ! Sg ! Nom) (noun2.s ! n ! c) ;
|
|
||||||
g = noun2.g
|
|
||||||
} ;
|
|
||||||
|
|
||||||
GerundN v = { -- parsing
|
GerundN v = { -- parsing
|
||||||
s = \\n,c => v.s ! VInf False ; --- formalisieren, not formalisierung
|
s = \\n,c => v.s ! VInf False ; --- formalisieren, not formalisierung
|
||||||
g = Neutr
|
g = Neutr
|
||||||
|
|||||||
@@ -37,16 +37,11 @@ lin
|
|||||||
|
|
||||||
lin
|
lin
|
||||||
|
|
||||||
CompoundCN num noun cn = {
|
CompoundCN noun cn = {
|
||||||
s = \\n,c => num.s ++ cn.s ! n ! c ++ noun.s ! num.n ! Dir;
|
s = \\n,c => cn.s ! Sg ! Dir ++ noun.s ! n ! c;
|
||||||
g = cn.g
|
g = cn.g
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
DashCN noun1 noun2 = {
|
|
||||||
s = \\n,c => noun1.s ! n ! Dir ++ "-" ++ noun2.s ! n ! c ;
|
|
||||||
g = noun2.g
|
|
||||||
} ;
|
|
||||||
|
|
||||||
GerundN v = {
|
GerundN v = {
|
||||||
s = \\n,c => v.cvp ++ v.s ! Inf ; -- v.s ! VF Imperf Pers2_Casual n Masc ++ hwa (Ag Masc n Pers2_Casual) ; --the main verb of compound verbs
|
s = \\n,c => v.cvp ++ v.s ! Inf ; -- v.s ! VF Imperf Pers2_Casual n Masc ++ hwa (Ag Masc n Pers2_Casual) ; --the main verb of compound verbs
|
||||||
g = Masc
|
g = Masc
|
||||||
@@ -56,9 +51,9 @@ lin
|
|||||||
s = \\n,g,_,_ => v.cvp ++ v.s ! VF Imperf Pers2_Casual n g ++ hwa (Ag g n Pers2_Casual) ;
|
s = \\n,g,_,_ => v.cvp ++ v.s ! VF Imperf Pers2_Casual n g ++ hwa (Ag g n Pers2_Casual) ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PastPartAP v = {
|
---- PastPartAP v = {
|
||||||
s = \\n,g,_,_ => v.cvp ++ v.s ! VF Imperf Pers2_Casual n g ; -- the main verb of compound versb needs to be attached here
|
---- s = \\n,g,_,_ => v.cvp ++ v.s ! VF Imperf Pers2_Casual n g ; -- the main verb of compound versb needs to be attached here
|
||||||
} ;
|
---- } ;
|
||||||
|
|
||||||
OrdCompar a = {s = a.s ! Sg ! Masc ! Dir ! Compar ; n = Sg } ;
|
OrdCompar a = {s = a.s ! Sg ! Masc ! Dir ! Compar ; n = Sg } ;
|
||||||
|
|
||||||
|
|||||||
@@ -35,18 +35,12 @@ lin
|
|||||||
|
|
||||||
|
|
||||||
lin
|
lin
|
||||||
CompoundCN num noun cn = {
|
CompoundCN noun cn = {
|
||||||
s = \\n,d,c => num.s ! cn.g ++ noun.co ++ BIND ++ cn.s ! n ! d ! c ;
|
s = \\n,d,c => noun.co ++ BIND ++ cn.s ! n ! d ! c ;
|
||||||
g = cn.g ;
|
g = cn.g ;
|
||||||
isMod = False
|
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 = {
|
GerundN v = {
|
||||||
s = \\n,d,c => v.s ! VI (VPtPres n d c) ;
|
s = \\n,d,c => v.s ! VI (VPtPres n d c) ;
|
||||||
g = Neutr ;
|
g = Neutr ;
|
||||||
@@ -58,11 +52,7 @@ lin
|
|||||||
isPre = True
|
isPre = True
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PastPartAP v = {
|
---- PastPartAP vp
|
||||||
s = \\afpos => v.s ! VI (VPtPret afpos Nom) ;
|
|
||||||
isPre = True
|
|
||||||
} ;
|
|
||||||
|
|
||||||
|
|
||||||
OrdCompar a = {
|
OrdCompar a = {
|
||||||
s = case a.isComp of {
|
s = case a.isComp of {
|
||||||
|
|||||||
@@ -11,10 +11,16 @@ concrete TranslateEng of Translate =
|
|||||||
addGenitiveS
|
addGenitiveS
|
||||||
],
|
],
|
||||||
ConjunctionEng,
|
ConjunctionEng,
|
||||||
VerbEng - [SlashV2V, PassV2, UseCopula, ComplVV],
|
VerbEng - [
|
||||||
|
SlashV2V, PassV2, UseCopula, ComplVV, -- generalized in Extensions
|
||||||
|
ComplVS, SlashV2S, ComplSlash -- have variants in Eng
|
||||||
|
],
|
||||||
AdverbEng,
|
AdverbEng,
|
||||||
PhraseEng,
|
PhraseEng,
|
||||||
SentenceEng - [UseCl], -- replaced by UseCl | ContractedUseCl
|
SentenceEng - [
|
||||||
|
---- PredVP, -- to be replaced by PredVPS, QuestVPS, QuestIAdvVPS in Extensions
|
||||||
|
UseCl -- replaced by UseCl | ContractedUseCl
|
||||||
|
],
|
||||||
QuestionEng,
|
QuestionEng,
|
||||||
RelativeEng,
|
RelativeEng,
|
||||||
IdiomEng [NP, VP, Tense, Cl, ProgrVP, ExistNP, SelfAdvVP, SelfAdVVP, SelfNP],
|
IdiomEng [NP, VP, Tense, Cl, ProgrVP, ExistNP, SelfAdvVP, SelfAdVVP, SelfNP],
|
||||||
@@ -23,14 +29,21 @@ concrete TranslateEng of Translate =
|
|||||||
|
|
||||||
ExtensionsEng,
|
ExtensionsEng,
|
||||||
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 -- I am here
|
||||||
|
| E.ContractedUseCl t p cl -- I'm here
|
||||||
|
;
|
||||||
|
|
||||||
|
ComplVS vs s = G.ComplVS vs s | E.ComplBareVS vs s ;
|
||||||
|
SlashV2S vs s = G.SlashV2S vs s | E.SlashBareV2S vs s ;
|
||||||
|
ComplSlash vps np = G.ComplSlash vps np | E.ComplSlashPartLast vps np ;
|
||||||
|
|
||||||
PPos = {s = [] ; p = CPos} ;
|
PPos = {s = [] ; p = CPos} ;
|
||||||
PNeg = {s = [] ; p = CNeg True} | {s = [] ; p = CNeg False} ;
|
PNeg = {s = [] ; p = CNeg True} | {s = [] ; p = CNeg False} ;
|
||||||
|
|||||||
Reference in New Issue
Block a user