forked from GitHub/gf-rgl
the rest of PredChi modules started
This commit is contained in:
136
src/experimental/ChunkChi.gf
Normal file
136
src/experimental/ChunkChi.gf
Normal file
@@ -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)) ;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
42
src/experimental/LiftChi.gf
Normal file
42
src/experimental/LiftChi.gf
Normal file
@@ -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 = <liftV <v : Verb> : 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 = <liftV <v : Verb> : PrVerb> ** {c1 = v.c2 ; c2 = v.c3} ;
|
||||||
|
|
||||||
|
LiftV2S v = <liftV <v : Verb> : PrVerb> ** {c1 = v.c2} ;
|
||||||
|
LiftV2Q v = <liftV <v : Verb> : PrVerb> ** {c1 = v.c2} ;
|
||||||
|
LiftV2V v = <liftV <v : Verb> : PrVerb> ** {c1 = v.c2 ; c2 = v.c3} ;
|
||||||
|
LiftV2A v = <liftV <v : Verb> : PrVerb> ** {c1 = v.c2} ;
|
||||||
|
LiftV2N v = <liftV <v : Verb> : 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} ;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
5
src/experimental/NDLiftChi.gf
Normal file
5
src/experimental/NDLiftChi.gf
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
concrete NDLiftChi of NDLift =
|
||||||
|
RGLBaseChi - [Pol,Tense,Ant]
|
||||||
|
,NDPredChi
|
||||||
|
|
||||||
|
** NDLiftFunctor with (Lift = LiftChi) ;
|
||||||
5
src/experimental/NDPredChi.gf
Normal file
5
src/experimental/NDPredChi.gf
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
concrete NDPredChi of Pred =
|
||||||
|
CatChi [NP,Utt,IP,IAdv,IComp,Conj,RS,RP,Subj] **
|
||||||
|
NDPredFunctor with
|
||||||
|
(PredInterface = PredInstanceChi),
|
||||||
|
(Pred = PredChi) ;
|
||||||
15
src/experimental/NDTransChi.gf
Normal file
15
src/experimental/NDTransChi.gf
Normal file
@@ -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 ;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
concrete PredChi of Pred =
|
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,
|
PredFunctor - [UseNP,ComplV2,SlashV3,ContVPC, StartVPC, StartClC,
|
||||||
RelVP, RelSlash, QuestVP, QuestSlash, QuestIComp,PredVP]
|
RelVP, RelSlash, QuestVP, QuestSlash, QuestIComp,PredVP,
|
||||||
|
SubjUttPreS, SubjUttPreQ, SubjUttPost]
|
||||||
with
|
with
|
||||||
(PredInterface = PredInstanceChi) ** open ResChi, (P = ParadigmsChi), TenseX in {
|
(PredInterface = PredInstanceChi) ** open ResChi, (P = ParadigmsChi), TenseX in {
|
||||||
|
|
||||||
|
|||||||
20
src/experimental/RGLBaseChi.gf
Normal file
20
src/experimental/RGLBaseChi.gf
Normal file
@@ -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 ;
|
||||||
12
src/experimental/TestChi.gf
Normal file
12
src/experimental/TestChi.gf
Normal file
@@ -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 ;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user