1
0
forked from GitHub/gf-core

More or less complete Latvian RG (by Peteris Paikens and Normunds Gruzitis)

This commit is contained in:
normundsg
2011-11-07 14:21:04 +00:00
parent f87e8279bf
commit 3148e305d5
23 changed files with 1748 additions and 1077 deletions

View File

@@ -1,30 +1,79 @@
concrete VerbLav of Verb = CatLav ** open ResLav in {
concrete VerbLav of Verb = CatLav ** open ResLav, ParadigmsVerbsLav, StructuralLav in {
--FIXME - module relations. VerbLav is included in many places because of buldVerb, and includes ParadigmsVerbsLav because of mkVerb_toBe - they need to be reallocated somehow to ResLav or something similar. not so simple since morphology itself needs ResLav & friends.
flags optimize=all_subs ;
lin
UseV v = {v = v ; obj = \\_ => []} ;
UseV v = {v = v ; s2 = \\_ => []} ; -- TODO - rewrite ðo uz valencçm, lai ir semantiskâs saites
ComplVV v vp = {v = v; s2 = \\agr => build_VP vp Pos Infinitive agr};
ComplVS v s = {v = v; s2 = \\_ => "," ++ v.subj.s ++ s.s};
ComplVQ v q = {v = v; s2 = \\_ => "," ++ q.s};
ComplVA v ap = {v = v; s2 = \\agr => ap.s ! Indef ! (fromAgr agr).g ! (fromAgr agr).n ! Nom };
SlashV2a v = {v = v ; s2 = \\_ => []; p = v.p};
Slash2V3 v np = insertObjc (\\_ => v.p1.s ++ np.s ! (v.p1.c ! (fromAgr np.a).n)) {v = v; s2 = \\_ => []; p = v.p2};
Slash3V3 v np = insertObjc (\\_ => v.p2.s ++ np.s ! (v.p2.c ! (fromAgr np.a).n)) {v = v; s2 = \\_ => []; p = v.p1};
SlashV2V v vp = {v = v; s2 = \\agr => build_VP vp Pos Infinitive agr; p = v.p};
SlashV2S v s = {v = v; s2 = \\_ => "," ++ v.subj.s ++ s.s; p = v.p};
SlashV2Q v q = {v = v; s2 = \\_ => "," ++ q.s; p = v.p};
SlashV2A v ap = {v = v; s2 = \\agr => ap.s ! Indef ! (fromAgr agr).g ! (fromAgr agr).n ! Nom ; p = v.p};
ComplSlash vp np = insertObjPre (\\_ => vp.p.s ++ np.s ! (vp.p.c ! (fromAgr np.a).n)) vp;
CompAP ap = {s = \\agr => ap.s ! Indef ! (fromAgr agr).g ! (fromAgr agr).n ! Nom } ;
CompNP np = {s = \\_ => np.s ! Nom} ;
CompAdv a = {s = \\_ => a.s} ;
ReflVP vp = insertObjPre ( \\a => vp.p.s ++ reflPron ! (vp.p.c ! (fromAgr a).n)) vp;
UseComp comp = {v = lin V mkVerb_toBe; s2 = \\agr => comp.s ! agr};
AdvVP vp adv = insertObj (\\_ => adv.s) vp ;
AdVVP adv vp = insertObjPre (\\_ => adv.s) vp ;
oper
build_VP : ResLav.VP -> Polarity -> VerbForm -> Agr -> Str = \vp,p,vf,agr -> vp.v.s ! p ! vf ++ vp.s2 ! agr;
insertObj : (Agr => Str) -> {v : Verb ; s2 : Agr => Str} -> {v : Verb ; s2 : Agr => Str} = \obj,vp -> {
v = vp.v ;
s2 = \\a => vp.s2 ! a ++ obj ! a
} ;
insertObjPre : (Agr => Str) -> {v : Verb ; s2 : Agr => Str} -> {v : Verb ; s2 : Agr => Str} = \obj,vp -> {
v = vp.v ;
s2 = \\a => obj ! a ++ vp.s2 ! a
} ;
insertObjc : (Agr => Str) -> {v : Verb ; s2 : Agr => Str; p: Prep} -> {v : Verb ; s2 : Agr => Str; p: Prep} = \obj,vp ->
insertObj obj vp ** {p = vp.p};
buildVerb : Verb -> VerbMood -> Polarity -> Agr -> Str = \v,mood,pol,ag -> let
ag = fromAgr ag;
part = v.s ! ResLav.Pos ! (Participle ag.g ag.n Nom)
in case mood of { -- Verb
Ind Simul tense => v.s ! pol ! (Indicative ag.p ag.n tense) ;
Ind Anter tense => mkVerb_toBe.s ! pol ! (Indicative ag.p ag.n tense) ++ part ;
Rel _ Past => ResLav.NON_EXISTENT ; -- FIXME (?)
Rel Simul tense => v.s ! pol ! (Relative tense) ;
Rel Anter tense => mkVerb_toBe.s ! pol ! (Relative tense) ++ part ;
Deb Simul tense => mkVerb_toBe.s ! pol ! (Indicative P3 Sg tense) ++
v.s ! ResLav.Pos ! Debitive ;
Deb Anter tense => mkVerb_toBe.s ! pol ! (Indicative P3 Sg tense) ++
mkVerb_toBe.s ! ResLav.Pos ! (Participle Masc Sg Nom) ++ v.s ! ResLav.Pos ! Debitive ;
Condit Simul => v.s ! pol ! (Indicative ag.p ag.n Cond) ;
Condit Anter => mkVerb_toBe.s ! pol ! (Indicative ag.p ag.n Cond) ++ part
};
--FIXME nav testçts
lin
SlashVV vv vp = {v = vv; s2 = \\agr => build_VP vp Pos Infinitive agr; p = vp.p};
SlashV2VNP vv np vp = insertObjc (\\_ => vv.p.s ++ np.s ! (vv.p.c ! (fromAgr np.a).n)){v = vv; s2 = \\agr => build_VP vp Pos Infinitive agr; p = vp.p};
--FIXME placeholder
PassV2 v = {v = v; s2 = \\_ => NON_EXISTENT};
{-
UseV = predV ;
SlashV2a v = predVc v ;
Slash2V3 v np =
insertObjc (\\_ => v.c2 ++ np.s ! Acc) (predV v ** {c2 = v.c3}) ;
Slash3V3 v np =
insertObjc (\\_ => v.c3 ++ np.s ! Acc) (predVc v) ; ----
ComplVV v vp = insertObj (\\a => infVP v.isAux vp a) (predVV v) ;
ComplVS v s = insertObj (\\_ => conjThat ++ s.s) (predV v) ;
ComplVQ v q = insertObj (\\_ => q.s ! QIndir) (predV v) ;
ComplVA v ap = insertObj (ap.s) (predV v) ;
SlashV2V v vp = insertObjc (\\a => infVP v.isAux vp a) (predVc v) ;
SlashV2S v s = insertObjc (\\_ => conjThat ++ s.s) (predVc v) ;
SlashV2Q v q = insertObjc (\\_ => q.s ! QIndir) (predVc v) ;
SlashV2A v ap = insertObjc (\\a => ap.s ! a) (predVc v) ; ----
ComplSlash vp np = insertObjPre (\\_ => vp.c2 ++ np.s ! Acc) vp ;
SlashVV vv vp =
insertObj (\\a => infVP vv.isAux vp a) (predVV vv) **
{c2 = vp.c2} ;
@@ -32,21 +81,7 @@ concrete VerbLav of Verb = CatLav ** open ResLav in {
insertObjPre (\\_ => vv.c2 ++ np.s ! Acc)
(insertObjc (\\a => infVP vv.isAux vp a) (predVc vv)) **
{c2 = vp.c2} ;
UseComp comp = insertObj comp.s (predAux auxBe) ;
AdvVP vp adv = insertObj (\\_ => adv.s) vp ;
AdVVP adv vp = insertAdV adv.s vp ;
ReflVP v = insertObjPre (\\a => v.c2 ++ reflPron ! a) v ;
PassV2 v = insertObj (\\_ => v.s ! VPPart) (predAux auxBe) ;
---b UseVS, UseVQ = \vv -> {s = vv.s ; c2 = [] ; isRefl = vv.isRefl} ; -- no "to"
CompAP ap = ap ;
CompNP np = {s = \\_ => np.s ! Acc} ;
CompAdv a = {s = \\_ => a.s} ;
-}
}