From e054739dc0f1957125dc3d941b906b4e49a84bf4 Mon Sep 17 00:00:00 2001 From: aarne Date: Sat, 8 Mar 2014 13:11:09 +0000 Subject: [PATCH] more chunks; makefile for PredEngSwe translator --- lib/src/experimental/Chunk.gf | 26 ++++++++++++++++++++++---- lib/src/experimental/ChunkEng.gf | 25 ++++++++++++++++++++++++- lib/src/experimental/ChunkSwe.gf | 26 ++++++++++++++++++++++++-- lib/src/experimental/Makefile | 4 ++++ lib/src/experimental/NDPredEng.gf | 2 +- lib/src/experimental/NDPredSwe.gf | 2 +- lib/src/experimental/NDPredTrans.probs | 23 +++++++++++++++++++++-- lib/src/experimental/Pred.gf | 7 ++++++- lib/src/experimental/PredEng.gf | 2 +- lib/src/experimental/PredFunctor.gf | 5 ++++- lib/src/experimental/PredSwe.gf | 2 +- 11 files changed, 109 insertions(+), 15 deletions(-) create mode 100644 lib/src/experimental/Makefile diff --git a/lib/src/experimental/Chunk.gf b/lib/src/experimental/Chunk.gf index 239a3a810..9fa2448d9 100644 --- a/lib/src/experimental/Chunk.gf +++ b/lib/src/experimental/Chunk.gf @@ -38,15 +38,33 @@ fun RP_Gen_Chunk : RP -> Chunk ; RP_Acc_Chunk : RP -> Chunk ; Subj_Chunk : Subj -> Chunk ; - VP_np_Chunk : PrVP_np -> Chunk ; - VP_none_Chunk : PrVP_none -> Chunk ; - VP_s_Chunk : PrVP_s -> Chunk ; + VP_np_Chunk, + VP_none_Chunk, + VP_s_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 ; copula_Chunk : Chunk ; copula_neg_Chunk : Chunk ; + copula_inf_Chunk : Chunk ; past_copula_Chunk : Chunk ; past_copula_neg_Chunk : Chunk ; future_Chunk : Chunk ; diff --git a/lib/src/experimental/ChunkEng.gf b/lib/src/experimental/ChunkEng.gf index 882fb8d9c..8e7e85870 100644 --- a/lib/src/experimental/ChunkEng.gf +++ b/lib/src/experimental/ChunkEng.gf @@ -43,7 +43,10 @@ lin RP_Acc_Chunk rp = ss (rp.s ! RPrep Masc) ; ---- RP_Gen_Chunk rp = ss (rp.s ! RC Neutr (NCase Gen)) ; 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) in 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_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_PlP1_Chunk = ss "ourselves" ; + refl_PlP2_Chunk = ss "yourselves" ; + refl_PlP3_Chunk = ss "themselves" ; neg_Chunk = ss "not" | ss "doesn't" | ss "don't" ; copula_Chunk = ss "is" | ss "are" | ss "am" ; copula_neg_Chunk = ss "isn't" | ss "aren't" ; diff --git a/lib/src/experimental/ChunkSwe.gf b/lib/src/experimental/ChunkSwe.gf index 808bd43ba..80c6d07b4 100644 --- a/lib/src/experimental/ChunkSwe.gf +++ b/lib/src/experimental/ChunkSwe.gf @@ -43,7 +43,10 @@ lin RP_Acc_Chunk rp = ss (rp.s ! Utr ! Sg ! RNom) ; RP_Gen_Chunk rp = ss (rp.s ! Utr ! Sg ! RGen) ; 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 in 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 ) ; - 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" ; copula_Chunk = ss "är" ; copula_neg_Chunk = ss "är inte" ; diff --git a/lib/src/experimental/Makefile b/lib/src/experimental/Makefile new file mode 100644 index 000000000..a71ef998f --- /dev/null +++ b/lib/src/experimental/Makefile @@ -0,0 +1,4 @@ +all: translator + +translator: + gf -s -make -literal=Symb -probs=NDPredTrans.probs -name=TransEngSwe NDTransEng.gf NDTransSwe.gf diff --git a/lib/src/experimental/NDPredEng.gf b/lib/src/experimental/NDPredEng.gf index 0ce69a03e..bc7b899c7 100644 --- a/lib/src/experimental/NDPredEng.gf +++ b/lib/src/experimental/NDPredEng.gf @@ -1,5 +1,5 @@ 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 (PredInterface = PredInstanceEng), (Pred = PredEng) ; diff --git a/lib/src/experimental/NDPredSwe.gf b/lib/src/experimental/NDPredSwe.gf index 5f71ad6e6..19eefc7fe 100644 --- a/lib/src/experimental/NDPredSwe.gf +++ b/lib/src/experimental/NDPredSwe.gf @@ -1,5 +1,5 @@ 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 (PredInterface = PredInstanceSwe), (Pred = PredSwe) ; diff --git a/lib/src/experimental/NDPredTrans.probs b/lib/src/experimental/NDPredTrans.probs index 18f50db5f..b21bf0625 100644 --- a/lib/src/experimental/NDPredTrans.probs +++ b/lib/src/experimental/NDPredTrans.probs @@ -12991,7 +12991,8 @@ ComparAdvAdjS 9.395582197250852e-6 ConjAdv 9.865361307113396e-4 PositAdvAdj 3.606964005524602e-2 PrepNP 0.8085086392378303 -SubjS 9.395582197250852e-6 +SubjUttPost 9.395582197250852e-6 +SubjUttPre 9.395582197250852e-6 a_fortiori_Adv 9.395582197250852e-6 a_la_carte_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 Subj_Chunk 5.751177721092363e-4 VP_none_Chunk 0.1 -VP_np_Chunk 0.01 +VP_np_Chunk 0.05 VP_s_Chunk 0.01 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 PhrChunk 0.01 OneChunk 0.8 PlusChunk 0.2 +refl_SgP1_Chunk 5.751177721092363e-4 +refl_SgP2_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 copula_Chunk 5.751177721092363e-4 copula_neg_Chunk 5.751177721092363e-4 +copula_inf_Chunk 5.751177721092363e-4 past_copula_Chunk 5.751177721092363e-4 past_copula_neg_Chunk 5.751177721092363e-4 future_Chunk 5.751177721092363e-4 diff --git a/lib/src/experimental/Pred.gf b/lib/src/experimental/Pred.gf index 945d747b1..43edb6113 100644 --- a/lib/src/experimental/Pred.gf +++ b/lib/src/experimental/Pred.gf @@ -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 Arg ; @@ -114,4 +114,9 @@ fun 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 ; + } \ No newline at end of file diff --git a/lib/src/experimental/PredEng.gf b/lib/src/experimental/PredEng.gf index 7dd261ff1..e26da81fc 100644 --- a/lib/src/experimental/PredEng.gf +++ b/lib/src/experimental/PredEng.gf @@ -1,5 +1,5 @@ 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 - [ -- for all these, special qforms added in Eng PassUseV, diff --git a/lib/src/experimental/PredFunctor.gf b/lib/src/experimental/PredFunctor.gf index dcb5abe67..f6c913e68 100644 --- a/lib/src/experimental/PredFunctor.gf +++ b/lib/src/experimental/PredFunctor.gf @@ -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 PredInterface, ParamX, @@ -363,4 +363,7 @@ lin 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) ; + } \ No newline at end of file diff --git a/lib/src/experimental/PredSwe.gf b/lib/src/experimental/PredSwe.gf index 84c6f2860..2698cea46 100644 --- a/lib/src/experimental/PredSwe.gf +++ b/lib/src/experimental/PredSwe.gf @@ -1,5 +1,5 @@ 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 with (PredInterface = PredInstanceSwe)