diff --git a/lib/src/experimental/Lift.gf b/lib/src/experimental/Lift.gf new file mode 100644 index 000000000..5a263139d --- /dev/null +++ b/lib/src/experimental/Lift.gf @@ -0,0 +1,32 @@ +abstract Lift = + RGLBase - [Pol,Tense] + ,Pred + ** { +fun + LiftV : V -> PrV aNone ; + LiftV2 : V2 -> PrV (aNP aNone) ; + LiftVS : VS -> PrV aS ; + LiftVQ : VQ -> PrV aQ ; + LiftVV : VV -> PrV aV ; + LiftVA : VA -> PrV aA ; + LiftVN : VA -> PrV aN ; ---- + + LiftV3 : V3 -> PrV (aNP (aNP aNone)) ; + LiftV2S : V2S -> PrV (aNP aS) ; + LiftV2Q : V2Q -> PrV (aNP aQ) ; + LiftV2V : V2V -> PrV (aNP aV) ; + LiftV2A : V2A -> PrV (aNP aA) ; + LiftV2N : V2A -> PrV (aNP aN) ; ---- + + LiftAP : AP -> PrAP aNone ; + LiftA2 : A2 -> PrAP (aNP aNone) ; + LiftCN : CN -> PrCN aNone ; + LiftN2 : N2 -> PrCN (aNP aNone) ; + + AppAPCN : PrAP aNone -> CN -> CN ; + + LiftAdv : Adv -> PrAdv aNone ; + LiftAdV : AdV -> PrAdv aNone ; + LiftPrep : Prep -> PrAdv (aNP aNone) ; + +} diff --git a/lib/src/experimental/LiftEng.gf b/lib/src/experimental/LiftEng.gf new file mode 100644 index 000000000..7bbd6bc74 --- /dev/null +++ b/lib/src/experimental/LiftEng.gf @@ -0,0 +1,41 @@ +concrete LiftEng of Lift = + RGLBaseEng - [Pol,Tense] + ,PredEng + + ** open ResEng, PredInstanceEng, Prelude, (Pr = PredEng) in { + +--flags literal=Symb ; + +oper + liftV : ResEng.Verb -> Pr.PrV = \v -> lin PrV {s = v.s ; p = v.p ; c1,c2 = [] ; isSubjectControl = False ; vtype = VTAct ; vvtype = VVInf} ; + +lin + LiftV v = liftV v ; + LiftV2 v = liftV v ** {c1 = v.c2} ; + LiftVS v = liftV v ; + LiftVQ v = liftV v ; + LiftVA v = liftV v ; ---- c1? + LiftVN v = liftV v ; ---- c1? + LiftVV v = {s = \\f => v.s ! VVF f ; p = v.p ; c1,c2 = [] ; isSubjectControl = False ; vtype = VTAct ; vvtype = VVInf} ; ---- c1? ---- VVF + + LiftV3 v = liftV v ** {c1 = v.c2 ; c2 = v.c3} ; + LiftV2S v = liftV v ** {c1 = v.c2} ; + LiftV2Q v = liftV v ** {c1 = v.c2} ; + LiftV2V v = liftV v ** {c1 = v.c2 ; c2 = v.c3 ; isSubjectControl = False ; vvtype = v.typ} ; ---- subj control should be defined in V2V + LiftV2A v = liftV v ** {c1 = v.c2} ; + LiftV2N v = liftV v ** {c1 = v.c2} ; + + + LiftAP ap = {s = \\a => ap.s ! a ; c1,c2 = [] ; obj1 = \\_ => []} ; --- isPre + LiftA2 a = {s = \\_ => a.s ! AAdj Posit Nom ; c1 = a.c2 ; c2 = [] ; obj1 = \\_ => []} ; --- isPre + LiftCN cn = {s = \\n => cn.s ! n ! Nom ; c1,c2 = [] ; obj1 = \\_ => []} ; + LiftN2 cn = {s = \\n => cn.s ! n ! Nom ; c1 = cn.c2 ; c2 = [] ; obj1 = \\_ => []} ; + + AppAPCN ap cn = {s = \\n,c => cn.s ! n ! c ++ ap.s ! agrgP3 n cn.g ++ ap.obj1 ! agrgP3 n cn.g ; g = cn.g} + | {s = \\n,c => ap.s ! agrgP3 n cn.g ++ ap.obj1 ! agrgP3 n cn.g ++ cn.s ! n ! c ; g = cn.g} ; ---- isPre + + LiftAdv a = a ** {isAdV = False ; c1 = []} ; + LiftAdV a = a ** {isAdV = True ; c1 = []} ; + LiftPrep p = {s = [] ; isAdV = False ; c1 = p.s} ; + +} diff --git a/lib/src/experimental/LiftSwe.gf b/lib/src/experimental/LiftSwe.gf new file mode 100644 index 000000000..047322adc --- /dev/null +++ b/lib/src/experimental/LiftSwe.gf @@ -0,0 +1,56 @@ +concrete LiftSwe of Lift = + RGLBaseSwe - [Pol,Tense] + ,PredSwe + + ** open CommonScand, ResSwe, PredInstanceSwe, Prelude in { + +--flags literal=Symb ; + +oper + liftV = PredInstanceSwe.liftV ; + +lin + LiftV v = liftV v ; + LiftV2 v = : PrVerb> ** {c1 = v.c2.s} ; + LiftVS v = liftV v ; + LiftVQ v = liftV v ; + LiftVA v = liftV v ; ---- c1? + LiftVN v = liftV v ; ---- c1? + LiftVV v = : PrVerb> ** {c1 = v.c2.s} ; + + LiftV3 v = : PrVerb> ** {c1 = v.c2.s ; c2 = v.c3.s} ; + + LiftV2S v = : PrVerb> ** {c1 = v.c2.s} ; + LiftV2Q v = : PrVerb> ** {c1 = v.c2.s} ; + LiftV2V v = : PrVerb> ** {c1 = v.c2.s ; c2 = v.c3.s} ; + LiftV2A v = : PrVerb> ** {c1 = v.c2.s} ; + LiftV2N v = : PrVerb> ** {c1 = v.c2.s} ; + + LiftAP ap = {s = \\a => ap.s ! agr2aformpos a ; c1,c2 = [] ; obj1 = \\_ => []} ; --- isPre + LiftA2 ap = {s = \\a => ap.s ! AF (APosit (agr2aformpos a)) Nom ; c1 = ap.c2.s ; c2 = [] ; obj1 = \\_ => []} ; --- isPre + + LiftCN cn = {s = \\n => cn.s ! n ! DIndef ! Nom ; c1,c2 = [] ; obj1 = \\_ => []} ; + LiftN2 cn = {s = \\n => cn.s ! n ! specDet DIndef ! Nom ; c1 = cn.c2.s ; c2 = [] ; obj1 = \\_ => []} ; + + AppAPCN ap cn = + {s = \\n,d,c => + let + agr = {n = n ; g = cn.g ; p = P3} + in (cn.s ! n ! d ! c) ++ (ap.s ! agr ++ ap.obj1 ! agr) ; -- flicka älskad av alla + g = cn.g ; + isMod = True + } + | {s = \\n,d,c => + let + agr = {n = n ; g = cn.g ; p = P3} + in (ap.obj1 ! agr ++ ap.s ! agr) ++ (cn.s ! n ! d ! c) ; -- av alla älskad flicka + g = cn.g ; + isMod = True + } ; + + LiftAdv a = a ** {isAdV = False ; c1 = []} ; + LiftAdV a = a ** {isAdV = True ; c1 = []} ; + LiftPrep p = {s = [] ; isAdV = False ; c1 = p.s} ; + +} + diff --git a/lib/src/experimental/NDLift.gf b/lib/src/experimental/NDLift.gf new file mode 100644 index 000000000..4127621cb --- /dev/null +++ b/lib/src/experimental/NDLift.gf @@ -0,0 +1,35 @@ +abstract NDLift = + RGLBase - [Pol,Tense] + ,NDPred + + ** { + +fun + LiftV : V -> PrV_none ; + LiftV2 : V2 -> PrV_np ; + LiftVS : VS -> PrV_s ; + LiftVQ : VQ -> PrV_q ; + LiftVV : VV -> PrV_v ; + LiftVA : VA -> PrV_a ; + LiftVN : VA -> PrV_n ; ---- + + LiftV3 : V3 -> PrV_np_np ; + LiftV2S : V2S -> PrV_np_s ; + LiftV2Q : V2Q -> PrV_np_q ; + LiftV2V : V2V -> PrV_np_v ; + LiftV2A : V2A -> PrV_np_a ; + LiftV2N : V2A -> PrV_np_n ; ---- + + LiftAP : AP -> PrAP_none ; + LiftA2 : A2 -> PrAP_np ; + LiftCN : CN -> PrCN_none ; + LiftN2 : N2 -> PrCN_np ; + + AppAPCN : PrAP_none -> CN -> CN ; + + LiftAdv : Adv -> PrAdv_none ; + LiftAdV : Adv -> PrAdv_none ; + LiftPrep : Prep -> PrAdv_np ; + + +} diff --git a/lib/src/experimental/NDLiftEng.gf b/lib/src/experimental/NDLiftEng.gf new file mode 100644 index 000000000..92e15bb73 --- /dev/null +++ b/lib/src/experimental/NDLiftEng.gf @@ -0,0 +1,5 @@ +concrete NDLiftEng of NDLift = + RGLBaseEng - [Pol,Tense] + ,NDPredEng + + ** NDLiftFunctor with (Lift = LiftEng) ; diff --git a/lib/src/experimental/NDLiftFunctor.gf b/lib/src/experimental/NDLiftFunctor.gf new file mode 100644 index 000000000..abe8f9b31 --- /dev/null +++ b/lib/src/experimental/NDLiftFunctor.gf @@ -0,0 +1,34 @@ +incomplete concrete NDLiftFunctor of NDLift = + RGLBase - [Pol,Tense] + ,NDPred + + ** open Lift in { + +lin + LiftV = Lift.LiftV ; + LiftV2 = Lift.LiftV2 ; + LiftVS = Lift.LiftVS ; + LiftVQ = Lift.LiftVQ ; + LiftVV = Lift.LiftVV ; + LiftVA = Lift.LiftVA ; + LiftVN = Lift.LiftVN ; + + LiftV3 = Lift.LiftV3 ; + LiftV2S = Lift.LiftV2S ; + LiftV2Q = Lift.LiftV2Q ; + LiftV2V = Lift.LiftV2V ; + LiftV2A = Lift.LiftV2A ; + LiftV2N = Lift.LiftV2N ; + + LiftAP = Lift.LiftAP ; + LiftA2 = Lift.LiftA2 ; + LiftCN = Lift.LiftCN ; + LiftN2 = Lift.LiftN2 ; + + AppAPCN = Lift.AppAPCN ; + + LiftAdv = Lift.LiftAdv ; + LiftAdV = Lift.LiftAdV ; + LiftPrep = Lift.LiftPrep ; + +} diff --git a/lib/src/experimental/NDLiftSwe.gf b/lib/src/experimental/NDLiftSwe.gf new file mode 100644 index 000000000..048d27105 --- /dev/null +++ b/lib/src/experimental/NDLiftSwe.gf @@ -0,0 +1,5 @@ +concrete NDLiftSwe of NDLift = + RGLBaseSwe - [Pol,Tense] + ,NDPredSwe + + ** NDLiftFunctor with (Lift = LiftSwe) ; diff --git a/lib/src/experimental/NDTrans.gf b/lib/src/experimental/NDTrans.gf index a126e47a6..f77b0ad3d 100644 --- a/lib/src/experimental/NDTrans.gf +++ b/lib/src/experimental/NDTrans.gf @@ -1,8 +1,7 @@ --# -path=.:../translator abstract NDTrans = - RGLBase - [Pol,Tense] - ,NDPred + NDLift ,Dictionary - [Pol,Tense] ** { @@ -12,27 +11,4 @@ flags meta_prob=1.0e-5; meta_token_prob=1.1965149246222233e-9; -fun - LiftV : V -> PrV_none ; - LiftV2 : V2 -> PrV_np ; - LiftVS : VS -> PrV_s ; - LiftVQ : VQ -> PrV_q ; - LiftVV : VV -> PrV_v ; - LiftVA : VA -> PrV_a ; - LiftVN : VA -> PrV_n ; ---- - - LiftV3 : V3 -> PrV_np_np ; - LiftV2S : V2S -> PrV_np_s ; - LiftV2Q : V2Q -> PrV_np_q ; - LiftV2V : V2V -> PrV_np_v ; - LiftV2A : V2A -> PrV_np_a ; - LiftV2N : V2A -> PrV_np_n ; ---- - - LiftAP : AP -> PrAP_none ; - LiftCN : CN -> PrCN_none ; - - LiftAdv : Adv -> PrAdv_none ; - LiftAdV : Adv -> PrAdv_none ; - LiftPrep : Prep -> PrAdv_np ; - } diff --git a/lib/src/experimental/NDTransEng.gf b/lib/src/experimental/NDTransEng.gf index fd95c8cac..fb5d91e27 100644 --- a/lib/src/experimental/NDTransEng.gf +++ b/lib/src/experimental/NDTransEng.gf @@ -1,8 +1,7 @@ --# -path=.:../translator concrete NDTransEng of NDTrans = - RGLBaseEng - [Pol,Tense] - ,NDPredEng + NDLiftEng ,DictionaryEng - [Pol,Tense] ** open ResEng, PredInstanceEng, Prelude, (Pr = PredEng) in { @@ -10,32 +9,4 @@ concrete NDTransEng of NDTrans = flags literal=Symb ; -oper - liftV : ResEng.Verb -> Pr.PrV = \v -> lin PrV {s = v.s ; p = v.p ; c1,c2 = [] ; isSubjectControl = False ; vtype = VTAct ; vvtype = VVInf} ; - -lin - LiftV v = liftV v ; - LiftV2 v = liftV v ** {c1 = v.c2} ; - LiftVS v = liftV v ; - LiftVQ v = liftV v ; - LiftVA v = liftV v ; ---- c1? - LiftVN v = liftV v ; ---- c1? - LiftVV v = lin PrV {s = \\f => v.s ! VVF f ; p = v.p ; c1,c2 = [] ; isSubjectControl = False ; vtype = VTAct ; vvtype = VVInf} ; ---- c1? ---- VVF - - LiftV3 v = liftV v ** {c1 = v.c2 ; c2 = v.c3} ; - LiftV2S v = liftV v ** {c1 = v.c2} ; - LiftV2Q v = liftV v ** {c1 = v.c2} ; - LiftV2V v = liftV v ** {c1 = v.c2 ; c2 = v.c3 ; isSubjectControl = False ; vvtype = v.typ} ; ---- subj control should be defined in V2V - LiftV2A v = liftV v ** {c1 = v.c2} ; - LiftV2N v = liftV v ** {c1 = v.c2} ; - - - LiftAP ap = ap ** {c1,c2 = [] ; obj1 = \\_ => []} ; --- isPre - LiftCN cn = lin PrCN {s = \\n => cn.s ! n ! Nom ; c1,c2 = [] ; obj1 = \\_ => []} ; - - LiftAdv a = a ** {isAdV = False ; c1 = []} ; - LiftAdV a = a ** {isAdV = True ; c1 = []} ; - LiftPrep p = lin PrAdv {s = [] ; isAdV = False ; c1 = p.s} ; - - } diff --git a/lib/src/experimental/NDTransSwe.gf b/lib/src/experimental/NDTransSwe.gf index 98b378da8..3a098e4f4 100644 --- a/lib/src/experimental/NDTransSwe.gf +++ b/lib/src/experimental/NDTransSwe.gf @@ -1,8 +1,7 @@ --# -path=.:../translator concrete NDTransSwe of NDTrans = - RGLBaseSwe - [Pol,Tense] - ,NDPredSwe + NDLiftSwe ,DictionarySwe - [Pol,Tense] ** open CommonScand, ResSwe, PredInstanceSwe, (Pr=PredSwe), Prelude in { @@ -10,33 +9,5 @@ concrete NDTransSwe of NDTrans = flags literal=Symb ; -oper - vliftV : Verb -> PrV = \v -> lin PrV (PredInstanceSwe.liftV v) ; - PrV = Pr.PrV ; - -lin - LiftV v = vliftV v ; - LiftV2 v = : PrV> ** {c1 = v.c2.s} ; - LiftVS v = vliftV v ; - LiftVQ v = vliftV v ; - LiftVA v = vliftV v ; ---- c1? - LiftVN v = vliftV v ; ---- c1? - LiftVV v = : PrV> ** {c1 = v.c2.s} ; - - LiftV3 v = : PrV> ** {c1 = v.c2.s ; c2 = v.c3.s} ; - - LiftV2S v = : PrV> ** {c1 = v.c2.s} ; - LiftV2Q v = : PrV> ** {c1 = v.c2.s} ; - LiftV2V v = : PrV> ** {c1 = v.c2.s ; c2 = v.c3.s} ; - LiftV2A v = : PrV> ** {c1 = v.c2.s} ; - LiftV2N v = : PrV> ** {c1 = v.c2.s} ; - - LiftAP ap = lin PrAP {s = \\a => ap.s ! agr2aformpos a ; c1,c2 = [] ; obj1 = \\_ => []} ; --- isPre - LiftCN cn = lin PrCN {s = \\n => cn.s ! n ! DIndef ! Nom ; c1,c2 = [] ; obj1 = \\_ => []} ; - - LiftAdv a = lin PrAdv (a ** {isAdV = False ; c1 = []}) ; - LiftAdV a = lin PrAdv (a ** {isAdV = True ; c1 = []}) ; - LiftPrep p = lin PrAdv ({s = [] ; isAdV = False ; c1 = p.s}) ; - } diff --git a/lib/src/experimental/Test.gf b/lib/src/experimental/Test.gf index fbb4327fe..4ebf1e169 100644 --- a/lib/src/experimental/Test.gf +++ b/lib/src/experimental/Test.gf @@ -1,8 +1,5 @@ ---# -path=.:../translator - abstract Test = - RGLBase - [Pol,Tense,MkSymb] - ,Pred + Lift - [MkSymb] ,Lexicon - [Pol,Tense] ,Structural - [Pol,Tense] @@ -12,28 +9,4 @@ flags -- heuristic_search_factor=0.60; -- meta_prob=1.0e-5; -- meta_token_prob=1.1965149246222233e-9; - -fun - LiftV : V -> PrV aNone ; - LiftV2 : V2 -> PrV (aNP aNone) ; - LiftVS : VS -> PrV aS ; - LiftVQ : VQ -> PrV aQ ; - LiftVV : VV -> PrV aV ; - LiftVA : VA -> PrV aA ; - LiftVN : VA -> PrV aN ; ---- - - LiftV3 : V3 -> PrV (aNP (aNP aNone)) ; - LiftV2S : V2S -> PrV (aNP aS) ; - LiftV2Q : V2Q -> PrV (aNP aQ) ; - LiftV2V : V2V -> PrV (aNP aV) ; - LiftV2A : V2A -> PrV (aNP aA) ; - LiftV2N : V2A -> PrV (aNP aN) ; ---- - - LiftAP : AP -> PrAP aNone ; - LiftCN : CN -> PrCN aNone ; - - LiftAdv : Adv -> PrAdv aNone ; - LiftAdV : AdV -> PrAdv aNone ; - LiftPrep : Prep -> PrAdv (aNP aNone) ; - } diff --git a/lib/src/experimental/TestEng.gf b/lib/src/experimental/TestEng.gf index 336c01c03..f440e4ff0 100644 --- a/lib/src/experimental/TestEng.gf +++ b/lib/src/experimental/TestEng.gf @@ -1,39 +1,9 @@ concrete TestEng of Test = - RGLBaseEng - [Pol,Tense,MkSymb] - ,PredEng + LiftEng - [MkSymb] ,LexiconEng - [Pol,Tense] ,StructuralEng - [Pol,Tense] ** open ResEng, PredInstanceEng, Prelude, (Pr = PredEng) in { --flags literal=Symb ; - -oper - liftV : ResEng.Verb -> Pr.PrV = \v -> lin PrV {s = v.s ; p = v.p ; c1,c2 = [] ; isSubjectControl = False ; vtype = VTAct ; vvtype = VVInf} ; - -lin - LiftV v = liftV v ; - LiftV2 v = liftV v ** {c1 = v.c2} ; - LiftVS v = liftV v ; - LiftVQ v = liftV v ; - LiftVA v = liftV v ; ---- c1? - LiftVN v = liftV v ; ---- c1? - LiftVV v = {s = \\f => v.s ! VVF f ; p = v.p ; c1,c2 = [] ; isSubjectControl = False ; vtype = VTAct ; vvtype = VVInf} ; ---- c1? ---- VVF - - LiftV3 v = liftV v ** {c1 = v.c2 ; c2 = v.c3} ; - LiftV2S v = liftV v ** {c1 = v.c2} ; - LiftV2Q v = liftV v ** {c1 = v.c2} ; - LiftV2V v = liftV v ** {c1 = v.c2 ; c2 = v.c3 ; isSubjectControl = False ; vvtype = v.typ} ; ---- subj control should be defined in V2V - LiftV2A v = liftV v ** {c1 = v.c2} ; - LiftV2N v = liftV v ** {c1 = v.c2} ; - - - LiftAP ap = ap ** {c1,c2 = [] ; obj1 = \\_ => []} ; --- isPre - LiftCN cn = {s = \\n => cn.s ! n ! Nom ; c1,c2 = [] ; obj1 = \\_ => []} ; - - LiftAdv a = a ** {isAdV = False ; c1 = []} ; - LiftAdV a = a ** {isAdV = True ; c1 = []} ; - LiftPrep p = {s = [] ; isAdV = False ; c1 = p.s} ; - - } diff --git a/lib/src/experimental/TestSwe.gf b/lib/src/experimental/TestSwe.gf index fb73db749..ba3bd3e1b 100644 --- a/lib/src/experimental/TestSwe.gf +++ b/lib/src/experimental/TestSwe.gf @@ -1,8 +1,5 @@ ---# -path=.:../translator - concrete TestSwe of Test = - RGLBaseSwe - [Pol,Tense,MkSymb] - ,PredSwe + LiftSwe - [MkSymb] ,LexiconSwe - [Pol,Tense] ,StructuralSwe - [Pol,Tense] @@ -10,32 +7,6 @@ concrete TestSwe of Test = --flags literal=Symb ; -oper - liftV = PredInstanceSwe.liftV ; - -lin - LiftV v = liftV v ; - LiftV2 v = : PrVerb> ** {c1 = v.c2.s} ; - LiftVS v = liftV v ; - LiftVQ v = liftV v ; - LiftVA v = liftV v ; ---- c1? - LiftVN v = liftV v ; ---- c1? - LiftVV v = : PrVerb> ** {c1 = v.c2.s} ; - - LiftV3 v = : PrVerb> ** {c1 = v.c2.s ; c2 = v.c3.s} ; - - LiftV2S v = : PrVerb> ** {c1 = v.c2.s} ; - LiftV2Q v = : PrVerb> ** {c1 = v.c2.s} ; - LiftV2V v = : PrVerb> ** {c1 = v.c2.s ; c2 = v.c3.s} ; - LiftV2A v = : PrVerb> ** {c1 = v.c2.s} ; - LiftV2N v = : PrVerb> ** {c1 = v.c2.s} ; - - LiftAP ap = {s = \\a => ap.s ! agr2aformpos a ; c1,c2 = [] ; obj1 = \\_ => []} ; --- isPre - LiftCN cn = {s = \\n => cn.s ! n ! DIndef ! Nom ; c1,c2 = [] ; obj1 = \\_ => []} ; - - LiftAdv a = a ** {isAdV = False ; c1 = []} ; - LiftAdV a = a ** {isAdV = True ; c1 = []} ; - LiftPrep p = {s = [] ; isAdV = False ; c1 = p.s} ; }