mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-22 09:32:53 -06:00
more chunks; makefile for PredEngSwe translator
This commit is contained in:
@@ -38,15 +38,33 @@ fun
|
|||||||
RP_Gen_Chunk : RP -> Chunk ;
|
RP_Gen_Chunk : RP -> Chunk ;
|
||||||
RP_Acc_Chunk : RP -> Chunk ;
|
RP_Acc_Chunk : RP -> Chunk ;
|
||||||
Subj_Chunk : Subj -> Chunk ;
|
Subj_Chunk : Subj -> Chunk ;
|
||||||
VP_np_Chunk : PrVP_np -> Chunk ;
|
VP_np_Chunk,
|
||||||
VP_none_Chunk : PrVP_none -> Chunk ;
|
VP_none_Chunk,
|
||||||
VP_s_Chunk : PrVP_s -> Chunk ;
|
VP_s_Chunk,
|
||||||
VP_v_Chunk : PrVP_v -> Chunk ;
|
VP_v_Chunk : PrVP_v -> Chunk ;
|
||||||
|
VP_np_inf_Chunk,
|
||||||
|
VP_none_inf_Chunk,
|
||||||
|
VP_s_inf_Chunk,
|
||||||
|
VP_v_inf_Chunk : PrVP_v -> Chunk ;
|
||||||
|
V_np_prespart_Chunk,
|
||||||
|
V_none_prespart_Chunk,
|
||||||
|
V_s_prespart_Chunk,
|
||||||
|
V_v_prespart_Chunk : PrV_np -> Chunk ;
|
||||||
|
V_np_pastpart_Chunk,
|
||||||
|
V_none_pastpart_Chunk,
|
||||||
|
V_s_pastpart_Chunk,
|
||||||
|
V_v_pastpart_Chunk : PrV_v -> Chunk ;
|
||||||
|
|
||||||
refl_SgP3_Chunk : Chunk ;
|
refl_SgP1_Chunk,
|
||||||
|
refl_SgP2_Chunk,
|
||||||
|
refl_SgP3_Chunk,
|
||||||
|
refl_PlP1_Chunk,
|
||||||
|
refl_PlP2_Chunk,
|
||||||
|
refl_PlP3_Chunk : Chunk ;
|
||||||
neg_Chunk : Chunk ;
|
neg_Chunk : Chunk ;
|
||||||
copula_Chunk : Chunk ;
|
copula_Chunk : Chunk ;
|
||||||
copula_neg_Chunk : Chunk ;
|
copula_neg_Chunk : Chunk ;
|
||||||
|
copula_inf_Chunk : Chunk ;
|
||||||
past_copula_Chunk : Chunk ;
|
past_copula_Chunk : Chunk ;
|
||||||
past_copula_neg_Chunk : Chunk ;
|
past_copula_neg_Chunk : Chunk ;
|
||||||
future_Chunk : Chunk ;
|
future_Chunk : Chunk ;
|
||||||
|
|||||||
@@ -43,7 +43,10 @@ lin
|
|||||||
RP_Acc_Chunk rp = ss (rp.s ! RPrep Masc) ; ----
|
RP_Acc_Chunk rp = ss (rp.s ! RPrep Masc) ; ----
|
||||||
RP_Gen_Chunk rp = ss (rp.s ! RC Neutr (NCase Gen)) ;
|
RP_Gen_Chunk rp = ss (rp.s ! RC Neutr (NCase Gen)) ;
|
||||||
Subj_Chunk subj = subj ;
|
Subj_Chunk subj = subj ;
|
||||||
VP_none_Chunk, VP_np_Chunk, VP_s_Chunk, VP_v_VChunk = \vp ->
|
VP_none_Chunk,
|
||||||
|
VP_np_Chunk,
|
||||||
|
VP_s_Chunk,
|
||||||
|
VP_v_Chunk = \vp ->
|
||||||
let verb = vp.v ! (PI.VASgP1 | PI.VASgP3 | PI.VAPl)
|
let verb = vp.v ! (PI.VASgP1 | PI.VASgP3 | PI.VAPl)
|
||||||
in
|
in
|
||||||
allAgrSS (\a ->
|
allAgrSS (\a ->
|
||||||
@@ -51,7 +54,27 @@ lin
|
|||||||
vp.adj ! a ++ vp.c1 ++ vp.obj1.p1 ! a ++ vp.c2 ++ vp.obj2.p1 ! a ++ vp.adv ++ vp.ext
|
vp.adj ! a ++ vp.c1 ++ vp.obj1.p1 ! a ++ vp.c2 ++ vp.obj2.p1 ! a ++ vp.adv ++ vp.ext
|
||||||
) ;
|
) ;
|
||||||
|
|
||||||
|
VP_none_inf_Chunk,
|
||||||
|
VP_np_inf_Chunk,
|
||||||
|
VP_s_inf_Chunk,
|
||||||
|
VP_v_inf_Chunk = \vp -> allAgrSS (\a -> PI.infVP (VVInf | VVAux) a vp) ;
|
||||||
|
V_np_prespart_Chunk,
|
||||||
|
V_none_prespart_Chunk,
|
||||||
|
V_s_prespart_Chunk,
|
||||||
|
V_v_prespart_Chunk = \v -> ss (PI.vPresPart v PI.defaultAgr) ;
|
||||||
|
V_np_pastpart_Chunk,
|
||||||
|
V_none_pastpart_Chunk,
|
||||||
|
V_s_pastpart_Chunk,
|
||||||
|
V_v_pastpart_Chunk = \v -> ss (PI.vPastPart v PI.defaultAgr) ;
|
||||||
|
copula_inf_Chunk = ss "to be" | ss "be" ;
|
||||||
|
|
||||||
|
|
||||||
|
refl_SgP1_Chunk = ss "myself" ;
|
||||||
|
refl_SgP2_Chunk = ss "yourself" ;
|
||||||
refl_SgP3_Chunk = ss "himself" | ss "herself" | ss "itself" ;
|
refl_SgP3_Chunk = ss "himself" | ss "herself" | ss "itself" ;
|
||||||
|
refl_PlP1_Chunk = ss "ourselves" ;
|
||||||
|
refl_PlP2_Chunk = ss "yourselves" ;
|
||||||
|
refl_PlP3_Chunk = ss "themselves" ;
|
||||||
neg_Chunk = ss "not" | ss "doesn't" | ss "don't" ;
|
neg_Chunk = ss "not" | ss "doesn't" | ss "don't" ;
|
||||||
copula_Chunk = ss "is" | ss "are" | ss "am" ;
|
copula_Chunk = ss "is" | ss "are" | ss "am" ;
|
||||||
copula_neg_Chunk = ss "isn't" | ss "aren't" ;
|
copula_neg_Chunk = ss "isn't" | ss "aren't" ;
|
||||||
|
|||||||
@@ -43,7 +43,10 @@ lin
|
|||||||
RP_Acc_Chunk rp = ss (rp.s ! Utr ! Sg ! RNom) ;
|
RP_Acc_Chunk rp = ss (rp.s ! Utr ! Sg ! RNom) ;
|
||||||
RP_Gen_Chunk rp = ss (rp.s ! Utr ! Sg ! RGen) ;
|
RP_Gen_Chunk rp = ss (rp.s ! Utr ! Sg ! RGen) ;
|
||||||
Subj_Chunk subj = subj ;
|
Subj_Chunk subj = subj ;
|
||||||
VP_none_Chunk, VP_np_Chunk, VP_s_Chunk, VP_v_VChunk = \vp ->
|
VP_none_Chunk,
|
||||||
|
VP_np_Chunk,
|
||||||
|
VP_s_Chunk,
|
||||||
|
VP_v_Chunk = \vp ->
|
||||||
let verb = vp.v ! PI.UUnit
|
let verb = vp.v ! PI.UUnit
|
||||||
in
|
in
|
||||||
allAgrSS (\a ->
|
allAgrSS (\a ->
|
||||||
@@ -51,7 +54,26 @@ lin
|
|||||||
vp.adj ! a ++ vp.c1 ++ vp.obj1.p1 ! a ++ vp.c2 ++ vp.obj2.p1 ! a ++ vp.adv ++ vp.ext
|
vp.adj ! a ++ vp.c1 ++ vp.obj1.p1 ! a ++ vp.c2 ++ vp.obj2.p1 ! a ++ vp.adv ++ vp.ext
|
||||||
) ;
|
) ;
|
||||||
|
|
||||||
refl_SgP3_Chunk = ss "sig" | ss "själv" ;
|
VP_none_inf_Chunk,
|
||||||
|
VP_np_inf_Chunk,
|
||||||
|
VP_s_inf_Chunk,
|
||||||
|
VP_v_inf_Chunk = \vp -> allAgrSS (\a -> PI.infVP PI.UUnit a vp) ;
|
||||||
|
V_np_prespart_Chunk,
|
||||||
|
V_none_prespart_Chunk,
|
||||||
|
V_s_prespart_Chunk,
|
||||||
|
V_v_prespart_Chunk = \v -> ss (PI.vPresPart v PI.defaultAgr) ;
|
||||||
|
V_np_pastpart_Chunk,
|
||||||
|
V_none_pastpart_Chunk,
|
||||||
|
V_s_pastpart_Chunk,
|
||||||
|
V_v_pastpart_Chunk = \v -> ss (PI.vPastPart v PI.defaultAgr) ;
|
||||||
|
copula_inf_Chunk = ss "att vara" | ss "vara" ;
|
||||||
|
|
||||||
|
refl_SgP1_Chunk = ss "mig själv" ;
|
||||||
|
refl_SgP2_Chunk = ss "dig själv" ;
|
||||||
|
refl_SgP3_Chunk = ss "sig själv" ;
|
||||||
|
refl_PlP1_Chunk = ss "oss själva" ;
|
||||||
|
refl_PlP2_Chunk = ss "er själva" ;
|
||||||
|
refl_PlP3_Chunk = ss "sig själva" ;
|
||||||
neg_Chunk = ss "inte" ;
|
neg_Chunk = ss "inte" ;
|
||||||
copula_Chunk = ss "är" ;
|
copula_Chunk = ss "är" ;
|
||||||
copula_neg_Chunk = ss "är inte" ;
|
copula_neg_Chunk = ss "är inte" ;
|
||||||
|
|||||||
4
lib/src/experimental/Makefile
Normal file
4
lib/src/experimental/Makefile
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
all: translator
|
||||||
|
|
||||||
|
translator:
|
||||||
|
gf -s -make -literal=Symb -probs=NDPredTrans.probs -name=TransEngSwe NDTransEng.gf NDTransSwe.gf
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
concrete NDPredEng of Pred =
|
concrete NDPredEng of Pred =
|
||||||
CatEng [Ant,NP,Utt,IP,IAdv,IComp,Conj,RS,RP] **
|
CatEng [Ant,NP,Utt,IP,IAdv,IComp,Conj,RS,RP,Subj] **
|
||||||
NDPredFunctor with
|
NDPredFunctor with
|
||||||
(PredInterface = PredInstanceEng),
|
(PredInterface = PredInstanceEng),
|
||||||
(Pred = PredEng) ;
|
(Pred = PredEng) ;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
concrete NDPredSwe of Pred =
|
concrete NDPredSwe of Pred =
|
||||||
CatSwe [Ant,NP,Utt,IP,IAdv,IComp,Conj,RS,RP] **
|
CatSwe [Ant,NP,Utt,IP,IAdv,IComp,Conj,RS,RP,Subj] **
|
||||||
NDPredFunctor with
|
NDPredFunctor with
|
||||||
(PredInterface = PredInstanceSwe),
|
(PredInterface = PredInstanceSwe),
|
||||||
(Pred = PredSwe) ;
|
(Pred = PredSwe) ;
|
||||||
|
|||||||
@@ -12991,7 +12991,8 @@ ComparAdvAdjS 9.395582197250852e-6
|
|||||||
ConjAdv 9.865361307113396e-4
|
ConjAdv 9.865361307113396e-4
|
||||||
PositAdvAdj 3.606964005524602e-2
|
PositAdvAdj 3.606964005524602e-2
|
||||||
PrepNP 0.8085086392378303
|
PrepNP 0.8085086392378303
|
||||||
SubjS 9.395582197250852e-6
|
SubjUttPost 9.395582197250852e-6
|
||||||
|
SubjUttPre 9.395582197250852e-6
|
||||||
a_fortiori_Adv 9.395582197250852e-6
|
a_fortiori_Adv 9.395582197250852e-6
|
||||||
a_la_carte_Adv 9.395582197250852e-6
|
a_la_carte_Adv 9.395582197250852e-6
|
||||||
a_la_mode_Adv 9.395582197250852e-6
|
a_la_mode_Adv 9.395582197250852e-6
|
||||||
@@ -65239,17 +65240,35 @@ RP_Gen_Chunk 3.649803628461909e-4
|
|||||||
RP_Acc_Chunk 3.649803628461909e-4
|
RP_Acc_Chunk 3.649803628461909e-4
|
||||||
Subj_Chunk 5.751177721092363e-4
|
Subj_Chunk 5.751177721092363e-4
|
||||||
VP_none_Chunk 0.1
|
VP_none_Chunk 0.1
|
||||||
VP_np_Chunk 0.01
|
VP_np_Chunk 0.05
|
||||||
VP_s_Chunk 0.01
|
VP_s_Chunk 0.01
|
||||||
VP_v_Chunk 0.1
|
VP_v_Chunk 0.1
|
||||||
|
VP_none_inf_Chunk 0.01
|
||||||
|
VP_np_inf_Chunk 0.005
|
||||||
|
VP_s_inf_Chunk 0.001
|
||||||
|
VP_v_inf_Chunk 0.01
|
||||||
|
V_none_prespart_Chunk 0.01
|
||||||
|
V_np_prespart_Chunk 0.005
|
||||||
|
V_s_prespart_Chunk 0.001
|
||||||
|
V_v_prespart_Chunk 0.01
|
||||||
|
V_none_pastpart_Chunk 0.01
|
||||||
|
V_np_pastpart_Chunk 0.005
|
||||||
|
V_s_pastpart_Chunk 0.001
|
||||||
|
V_v_pastpart_Chunk 0.01
|
||||||
PhrUtt 0.99
|
PhrUtt 0.99
|
||||||
PhrChunk 0.01
|
PhrChunk 0.01
|
||||||
OneChunk 0.8
|
OneChunk 0.8
|
||||||
PlusChunk 0.2
|
PlusChunk 0.2
|
||||||
|
refl_SgP1_Chunk 5.751177721092363e-4
|
||||||
|
refl_SgP2_Chunk 5.751177721092363e-4
|
||||||
refl_SgP3_Chunk 5.751177721092363e-4
|
refl_SgP3_Chunk 5.751177721092363e-4
|
||||||
|
refl_PlP1_Chunk 5.751177721092363e-4
|
||||||
|
refl_PlP2_Chunk 5.751177721092363e-4
|
||||||
|
refl_PlP3_Chunk 5.751177721092363e-4
|
||||||
neg_Chunk 5.751177721092363e-4
|
neg_Chunk 5.751177721092363e-4
|
||||||
copula_Chunk 5.751177721092363e-4
|
copula_Chunk 5.751177721092363e-4
|
||||||
copula_neg_Chunk 5.751177721092363e-4
|
copula_neg_Chunk 5.751177721092363e-4
|
||||||
|
copula_inf_Chunk 5.751177721092363e-4
|
||||||
past_copula_Chunk 5.751177721092363e-4
|
past_copula_Chunk 5.751177721092363e-4
|
||||||
past_copula_neg_Chunk 5.751177721092363e-4
|
past_copula_neg_Chunk 5.751177721092363e-4
|
||||||
future_Chunk 5.751177721092363e-4
|
future_Chunk 5.751177721092363e-4
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
abstract Pred = Cat [Ant,NP,Utt,IP,IAdv,Conj,RS,RP] ** {
|
abstract Pred = Cat [Ant,NP,Utt,IP,IAdv,Conj,RS,RP,Subj] ** {
|
||||||
|
|
||||||
cat
|
cat
|
||||||
Arg ;
|
Arg ;
|
||||||
@@ -114,4 +114,9 @@ fun
|
|||||||
|
|
||||||
ComplAdv : (a : Arg) -> PrAdv (aNP a) -> NP -> PrAdv a ; -- typically: formation of preposition phrase
|
ComplAdv : (a : Arg) -> PrAdv (aNP a) -> NP -> PrAdv a ; -- typically: formation of preposition phrase
|
||||||
|
|
||||||
|
-- subjunction ; we want to preserve the order in translation
|
||||||
|
|
||||||
|
SubjUttPre : Subj -> PrCl aNone -> Utt -> Utt ;
|
||||||
|
SubjUttPost : Subj -> PrCl aNone -> Utt -> Utt ;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
concrete PredEng of Pred =
|
concrete PredEng of Pred =
|
||||||
CatEng [Ant,NP,Utt,IP,IAdv,IComp,Conj,RP,RS] **
|
CatEng [Ant,NP,Utt,IP,IAdv,IComp,Conj,RP,RS,Subj] **
|
||||||
PredFunctor - [
|
PredFunctor - [
|
||||||
-- for all these, special qforms added in Eng
|
-- for all these, special qforms added in Eng
|
||||||
PassUseV,
|
PassUseV,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
incomplete concrete PredFunctor of Pred = Cat [Ant,NP,Utt,IP,IAdv,IComp,Conj,RP,RS] **
|
incomplete concrete PredFunctor of Pred = Cat [Ant,NP,Utt,IP,IAdv,IComp,Conj,RP,RS,Subj] **
|
||||||
open
|
open
|
||||||
PredInterface,
|
PredInterface,
|
||||||
ParamX,
|
ParamX,
|
||||||
@@ -363,4 +363,7 @@ lin
|
|||||||
|
|
||||||
ComplAdv x p np = {s = appComplCase p.c1 np ; isAdV = p.isAdV ; c1 = noComplCase} ;
|
ComplAdv x p np = {s = appComplCase p.c1 np ; isAdV = p.isAdV ; c1 = noComplCase} ;
|
||||||
|
|
||||||
|
SubjUttPre subj cl utt = ss (subj.s ++ declSubordCl cl ++ ("," | []) ++ utt.s) ; ----- inv for S
|
||||||
|
SubjUttPost subj cl utt = ss (utt.s ++ ("," | []) ++ subj.s ++ declSubordCl cl) ;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
concrete PredSwe of Pred =
|
concrete PredSwe of Pred =
|
||||||
CatSwe [Ant,NP,Utt,IP,IAdv,IComp,Conj,RP,RS,Imp] **
|
CatSwe [Ant,NP,Utt,IP,IAdv,IComp,Conj,RP,RS,Imp,Subj] **
|
||||||
PredFunctor - [RelVP,RelSlash] ---- incompatible arity: to be fixed in RGL
|
PredFunctor - [RelVP,RelSlash] ---- incompatible arity: to be fixed in RGL
|
||||||
with
|
with
|
||||||
(PredInterface = PredInstanceSwe)
|
(PredInterface = PredInstanceSwe)
|
||||||
|
|||||||
Reference in New Issue
Block a user