diff --git a/lib/src/experimental/ChunkChi.gf b/lib/src/experimental/ChunkChi.gf new file mode 100644 index 000000000..0beb1af34 --- /dev/null +++ b/lib/src/experimental/ChunkChi.gf @@ -0,0 +1,136 @@ +concrete ChunkChi of Chunk = + RGLBaseChi - [Pol,Tense], + NDPredChi + + ** open (PI=PredInstanceChi), CommonScand, ResChi, Prelude in { + +lincat + Chunks = {s : Str} ; + Chunk = {s : Str}; + +lin + OneChunk c = c ; + PlusChunk c cs = cc2 c cs ; + + ChunkPhr c = ss ("*" ++ c.s) | c ; + +lin + + + AP_Chunk ap = ss (ap.s ! (Strong (GSg Utr))) ; ---- other agr + AdA_Chunk ada = ada ; + Adv_Chunk adv = adv ; + AdV_Chunk adv = adv ; + AdN_Chunk adn = adn ; + Cl_Chunk cl = ss (PI.declCl cl) ; + CN_Pl_Chunk cn = ss (cn.s ! Pl ! DIndef ! Nom) ; + CN_Sg_Chunk cn = ss (cn.s ! Sg ! DIndef ! Nom) ; + CN_Pl_Gen_Chunk cn = ss (cn.s ! Pl ! DIndef ! Gen) ; + CN_Sg_Gen_Chunk cn = ss (cn.s ! Sg ! DIndef ! Gen) ; + Conj_Chunk conj = ss conj.s2 ; + IAdv_Chunk iadv = iadv ; + IP_Chunk ip = ss (ip.s ! NPNom) ; + NP_Nom_Chunk np = ss (np.s ! NPNom) ; + NP_Acc_Chunk np = ss (np.s ! NPAcc) ; + NP_Gen_Chunk np = ss (np.s ! NPPoss (GSg Utr) Nom) ; + Numeral_Nom_Chunk num = ss (num.s ! NCard Utr) ; + Numeral_Gen_Chunk num = ss (num.s ! NCard Utr) ; + Ord_Nom_Chunk ord = ord ; + Ord_Gen_Chunk ord = ord ; + Predet_Chunk predet = ss (predet.s ! Utr ! Sg) ; + Prep_Chunk prep = prep ; + RP_Nom_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) ; + Subj_Chunk subj = subj ; + + VP_none_Chunk, + VP_np_Chunk, + VP_s_Chunk, + VP_v_Chunk, + VP_a_Chunk, + VP_q_Chunk, + VP_np_np_Chunk, + VP_np_s_Chunk, + VP_np_a_Chunk, + VP_np_q_Chunk, + VP_np_v_Chunk + = \vp -> + let verb = vp.v ! PI.UUnit + in + allAgrSS (\a -> + verb.p1 ++ verb.p2 ++ vp.adV ++ verb.p3 ++ vp.part ++ + 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_a_inf_Chunk, + VP_q_inf_Chunk, + VP_v_inf_Chunk, + VP_np_np_inf_Chunk, + VP_np_s_inf_Chunk, + VP_np_a_inf_Chunk, + VP_np_q_inf_Chunk, + VP_np_v_inf_Chunk + = \vp -> allAgrSS (\a -> PI.infVP PI.UUnit a vp) ; + + V_none_prespart_Chunk, + V_np_prespart_Chunk, + V_s_prespart_Chunk, + V_a_prespart_Chunk, + V_q_prespart_Chunk, + V_v_prespart_Chunk, + V_np_np_prespart_Chunk, + V_np_s_prespart_Chunk, + V_np_a_prespart_Chunk, + V_np_q_prespart_Chunk, + V_np_v_prespart_Chunk + = \v -> ss (PI.vPresPart v PI.defaultAgr) ; + + V_none_pastpart_Chunk, + V_np_pastpart_Chunk, + V_s_pastpart_Chunk, + V_a_pastpart_Chunk, + V_q_pastpart_Chunk, + V_v_pastpart_Chunk, + V_np_np_pastpart_Chunk, + V_np_s_pastpart_Chunk, + V_np_a_pastpart_Chunk, + V_np_q_pastpart_Chunk, + V_np_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" ; + past_copula_Chunk = ss "var" ; + past_copula_neg_Chunk = ss "var inte" ; + future_Chunk = ss "ska" | ss "skall" ; + future_neg_Chunk = ss "ska inte" | ss "skall inte" ; + cond_Chunk = ss "skulle" ; + cond_neg_Chunk = ss "skulle inte" ; + perfect_Chunk = ss "har" ; + perfect_neg_Chunk = ss "har inte" ; + past_perfect_Chunk = ss "hade" ; + past_perfect_neg_Chunk = ss "hade inte" ; + + +oper + allAgrSS : (Agr -> Str) -> SS = \f -> + ss (f PI.defaultAgr) ; +---- | ss (f (AgP3Sg Fem)) | ss (f (AgP3Sg Neutr)) | +---- ss (f (AgP1 Sg)) | ss (f (AgP1 Pl)) | ss (f (AgP2 Sg)) | ss (f (AgP2 Pl)) | +---- ss (f (AgP3Pl)) ; + + +} \ No newline at end of file diff --git a/lib/src/experimental/LiftChi.gf b/lib/src/experimental/LiftChi.gf new file mode 100644 index 000000000..44551e9ba --- /dev/null +++ b/lib/src/experimental/LiftChi.gf @@ -0,0 +1,42 @@ +concrete LiftChi of Lift = + RGLBaseChi - [Pol,Tense,Ant] + ,PredChi + + ** open CommonScand, ResChi, PredInstanceChi, Prelude in { + +--flags literal=Symb ; + +oper + liftV = PredInstanceChi.liftV ; + +lin + LiftV v = liftV v ; + LiftV2 v = : PrVerb> ** {c1 = v.c2} ; + LiftVS v = liftV v ; + LiftVQ v = liftV v ; + LiftVA v = liftV v ; ---- c1? + LiftVN v = liftV v ; ---- c1? + LiftVV v = liftV v ; + + LiftV3 v = : PrVerb> ** {c1 = v.c2 ; c2 = v.c3} ; + + LiftV2S v = : PrVerb> ** {c1 = v.c2} ; + LiftV2Q v = : PrVerb> ** {c1 = v.c2} ; + LiftV2V v = : PrVerb> ** {c1 = v.c2 ; c2 = v.c3} ; + LiftV2A v = : PrVerb> ** {c1 = v.c2} ; + LiftV2N v = : PrVerb> ** {c1 = v.c2} ; + + LiftAP ap = {s = \\a => ap.s ; c1,c2 = noComplCase ; obj1 = \\_ => []} ; --- monosyl + LiftA2 ap = {s = \\a => ap.s ; c1 = ap.c2 ; c2 = noComplCase ; obj1 = \\_ => []} ; --- isPre + + LiftCN cn = {s = \\n => cn.s ; c1,c2 = noComplCase ; obj1 = \\_ => []} ; + LiftN2 cn = {s = \\n => cn.s ; c1 = cn.c2 ; c2 = noComplCase ; obj1 = \\_ => []} ; + +---- AppAPCN ap cn = + + LiftAdv a = a ** {isAdV = False ; c1 = noComplCase} ; + LiftAdV a = a ** {isAdV = True ; c1 = noComplCase} ; + LiftPrep p = {s = [] ; isAdV = False ; c1 = p} ; + +} + diff --git a/lib/src/experimental/NDLiftChi.gf b/lib/src/experimental/NDLiftChi.gf new file mode 100644 index 000000000..8e772b234 --- /dev/null +++ b/lib/src/experimental/NDLiftChi.gf @@ -0,0 +1,5 @@ +concrete NDLiftChi of NDLift = + RGLBaseChi - [Pol,Tense,Ant] + ,NDPredChi + + ** NDLiftFunctor with (Lift = LiftChi) ; diff --git a/lib/src/experimental/NDPredChi.gf b/lib/src/experimental/NDPredChi.gf new file mode 100644 index 000000000..c5fdb02d2 --- /dev/null +++ b/lib/src/experimental/NDPredChi.gf @@ -0,0 +1,5 @@ +concrete NDPredChi of Pred = + CatChi [NP,Utt,IP,IAdv,IComp,Conj,RS,RP,Subj] ** + NDPredFunctor with + (PredInterface = PredInstanceChi), + (Pred = PredChi) ; diff --git a/lib/src/experimental/NDTransChi.gf b/lib/src/experimental/NDTransChi.gf new file mode 100644 index 000000000..36fd88dab --- /dev/null +++ b/lib/src/experimental/NDTransChi.gf @@ -0,0 +1,15 @@ +--# -path=.:../translator + +concrete NDTransChi of NDTrans = + NDLiftChi + ,ExtensionsChi [CN,NP,AdA,AdV,CompoundCN,AdAdV,UttAdV,ApposNP] + ,DictionaryChi - [Pol,Tense,Ant] + ,DocumentationChi - [Pol,Tense,Ant] + ,ChunkChi + ** open ResChi, PredInstanceChi, (Pr=PredChi), Prelude in { + +flags + literal=Symb ; + +} + diff --git a/lib/src/experimental/PredChi.gf b/lib/src/experimental/PredChi.gf index bf3a4b115..37842245f 100644 --- a/lib/src/experimental/PredChi.gf +++ b/lib/src/experimental/PredChi.gf @@ -1,7 +1,8 @@ concrete PredChi of Pred = - CatChi [NP,Utt,IP,IAdv,IComp,Conj,RP,RS,Imp] ** + CatChi [NP,Utt,IP,IAdv,IComp,Conj,RP,RS,Imp,Subj] ** PredFunctor - [UseNP,ComplV2,SlashV3,ContVPC, StartVPC, StartClC, - RelVP, RelSlash, QuestVP, QuestSlash, QuestIComp,PredVP] + RelVP, RelSlash, QuestVP, QuestSlash, QuestIComp,PredVP, + SubjUttPreS, SubjUttPreQ, SubjUttPost] with (PredInterface = PredInstanceChi) ** open ResChi, (P = ParadigmsChi), TenseX in { diff --git a/lib/src/experimental/RGLBaseChi.gf b/lib/src/experimental/RGLBaseChi.gf new file mode 100644 index 000000000..a514f7d84 --- /dev/null +++ b/lib/src/experimental/RGLBaseChi.gf @@ -0,0 +1,20 @@ +concrete RGLBaseChi of RGLBase = + +-- modules in Grammar, excluding Structural, Verb, Sentence, Question +---- Tense, + NounChi - [PPartNP], -- to be generalized + AdjectiveChi, + NumeralChi, + ConjunctionChi, + AdverbChi, + PhraseChi, +---- Sentence, + QuestionChi - [QuestCl,QuestVP,QuestSlash,QuestIAdv,QuestIComp], + RelativeChi - [RelCl,RelVP,RelSlash], +---- Idiom [NP, VP, Cl, Tense, ProgrVP, ExistNP, SelfAdvVP, SelfAdVVP, SelfNP], ---- why only these? + + SymbolChi [PN, Symb, String, CN, Card, NP, MkSymb, SymbPN, CNNumNP] ; ---- why only these? + +---- Construction, +---- Extensions, +---- Documentation ; diff --git a/lib/src/experimental/TestChi.gf b/lib/src/experimental/TestChi.gf new file mode 100644 index 000000000..447378f90 --- /dev/null +++ b/lib/src/experimental/TestChi.gf @@ -0,0 +1,12 @@ +concrete TestChi of Test = + LiftChi - [MkSymb] + ,LexiconChi - [Pol,Tense,Ant] + ,StructuralChi - [Pol,Tense,Ant] + + ** open ResChi, PredInstanceChi, Prelude in { + +--flags literal=Symb ; + + +} +