forked from GitHub/gf-core
Latvian: finally handles PassV2 clauses in a more or less adequate way
Extends the previously introduced support for specifying the verb valence (verb-dependent subject and object cases), involving functions up to PredVP and RelVP.
In Latvian, the passive voice is not used if the agent (subject) is known; to preserve the information structure (i.e. the word order), a clause like 'A is <done> by B' is linearized in the active voice ('A <does> B') where A has the object case (e.g. Acc), and B - the subject case (e.g. Nom). Thus, the verb valence patterns are swapped on-the-fly.
This is still a rather quick & dirty implementation: parameters and linearization types have to be optimized (VerbLav), the use of PassV2 in AdvVP is problematic as it doesn't apply VPSlashPrep / ComplSlash, etc.
This commit is contained in:
@@ -18,7 +18,7 @@ lin
|
|||||||
UseComparA a = { s = \\d,g,n,c => a.s ! (AAdj Compar d g n c) } ;
|
UseComparA a = { s = \\d,g,n,c => a.s ! (AAdj Compar d g n c) } ;
|
||||||
|
|
||||||
ComplA2 a np = {
|
ComplA2 a np = {
|
||||||
s = \\d,g,n,c => a.s ! (AAdj Posit d g n c) ++ a.p.s ++ np.s ! (a.p.c ! (fromAgr np.a).n)
|
s = \\d,g,n,c => a.s ! (AAdj Posit d g n c) ++ a.p.s ++ np.s ! (a.p.c ! (fromAgr np.a).num)
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ReflA2 a = { s = \\d,g,n,c => a.s ! (AAdj Posit d g n c) ++ a.p.s ++ reflPron ! (a.p.c ! n) } ;
|
ReflA2 a = { s = \\d,g,n,c => a.s ! (AAdj Posit d g n c) ++ a.p.s ++ reflPron ! (a.p.c ! n) } ;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ lin
|
|||||||
ComparAdvAdjS cadv a s = { s = cadv.s ++ a.s ! (AAdv cadv.d) ++ cadv.p ++ s.s } ;
|
ComparAdvAdjS cadv a s = { s = cadv.s ++ a.s ! (AAdv cadv.d) ++ cadv.p ++ s.s } ;
|
||||||
|
|
||||||
-- FIXME: postpozīcijas prievārdi
|
-- FIXME: postpozīcijas prievārdi
|
||||||
PrepNP prep np = { s = prep.s ++ np.s ! (prep.c ! (fromAgr np.a).n) } ;
|
PrepNP prep np = { s = prep.s ++ np.s ! (prep.c ! (fromAgr np.a).num) } ;
|
||||||
|
|
||||||
AdAdv = cc2 ;
|
AdAdv = cc2 ;
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ lin
|
|||||||
AdnCAdv cadv = {
|
AdnCAdv cadv = {
|
||||||
s = case cadv.d of {
|
s = case cadv.d of {
|
||||||
Posit => cadv.s ++ cadv.p ;
|
Posit => cadv.s ++ cadv.p ;
|
||||||
_ => NON_EXISTENT
|
_ => NON_EXISTENT
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ lin
|
|||||||
ConjAdv = conjunctDistrSS ;
|
ConjAdv = conjunctDistrSS ;
|
||||||
|
|
||||||
ConjNP conj ss = conjunctDistrTable Case conj ss ** {
|
ConjNP conj ss = conjunctDistrTable Case conj ss ** {
|
||||||
a = toAgr (conjNumber (fromAgr ss.a).n conj.n) (fromAgr ss.a).p (fromAgr ss.a).g ;
|
a = toAgr (conjNumber (fromAgr ss.a).num conj.n) (fromAgr ss.a).pers (fromAgr ss.a).gend ;
|
||||||
isNeg = False
|
isNeg = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ lin
|
|||||||
kopsh_Prep = mkPrep "kopš" Gen Dat ;
|
kopsh_Prep = mkPrep "kopš" Gen Dat ;
|
||||||
liidz_Prep = mkPrep "līdz" Dat Dat ;
|
liidz_Prep = mkPrep "līdz" Dat Dat ;
|
||||||
pa_Prep = mkPrep "pa" Acc Dat ;
|
pa_Prep = mkPrep "pa" Acc Dat ;
|
||||||
par_Prep = mkPrep "par" Acc Dat ;
|
--par_Prep = mkPrep "par" Acc Dat ;
|
||||||
paar_Prep = mkPrep "pār" Acc Dat ;
|
paar_Prep = mkPrep "pār" Acc Dat ;
|
||||||
pie_Prep = mkPrep "pie" Gen Dat ;
|
pie_Prep = mkPrep "pie" Gen Dat ;
|
||||||
pret_Prep = mkPrep "pret" Acc Dat ;
|
pret_Prep = mkPrep "pret" Acc Dat ;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ abstract ExtraLavAbs = Extra ** open ResLav, Prelude in {
|
|||||||
kopsh_Prep : Prep ;
|
kopsh_Prep : Prep ;
|
||||||
liidz_Prep : Prep ;
|
liidz_Prep : Prep ;
|
||||||
pa_Prep : Prep ;
|
pa_Prep : Prep ;
|
||||||
par_Prep : Prep ;
|
--par_Prep : Prep ;
|
||||||
paar_Prep : Prep ;
|
paar_Prep : Prep ;
|
||||||
pie_Prep : Prep ;
|
pie_Prep : Prep ;
|
||||||
pret_Prep : Prep ;
|
pret_Prep : Prep ;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
--# -path=.:../abstract:../common:../prelude
|
--# -path=.:abstract:common:prelude
|
||||||
|
|
||||||
concrete LexiconLav of Lexicon = CatLav ** open
|
concrete LexiconLav of Lexicon = CatLav ** open
|
||||||
ParadigmsLav,
|
ParadigmsLav,
|
||||||
StructuralLav,
|
StructuralLav,
|
||||||
ExtraLav,
|
--(E = ExtraLav),
|
||||||
ResLav,
|
ResLav,
|
||||||
Prelude
|
Prelude
|
||||||
in {
|
in {
|
||||||
@@ -190,7 +190,7 @@ lin
|
|||||||
switch8off_V2 = mkV2 (mkV "izslēgt" "izslēdzu" "izslēdzu") acc_Prep ;
|
switch8off_V2 = mkV2 (mkV "izslēgt" "izslēdzu" "izslēdzu") acc_Prep ;
|
||||||
switch8on_V2 = mkV2 (mkV "ieslēgt" "ieslēdzu" "ieslēdzu") acc_Prep ;
|
switch8on_V2 = mkV2 (mkV "ieslēgt" "ieslēdzu" "ieslēdzu") acc_Prep ;
|
||||||
table_N = mkN "galds" ;
|
table_N = mkN "galds" ;
|
||||||
talk_V3 = mkV3 (mkV "runāt" second_conjugation) to_Prep par_Prep ; -- ar ko, par ko
|
talk_V3 = mkV3 (mkV "runāt" second_conjugation) with_Prep par_Prep ; -- ar ko, par ko
|
||||||
teacher_N = mkN "skolotājs" ;
|
teacher_N = mkN "skolotājs" ;
|
||||||
teach_V2 = mkV2 (mkV "mācīt" third_conjugation) acc_Prep ;
|
teach_V2 = mkV2 (mkV "mācīt" third_conjugation) acc_Prep ;
|
||||||
television_N = mkN "televīzija" ;
|
television_N = mkN "televīzija" ;
|
||||||
@@ -372,6 +372,8 @@ lin
|
|||||||
today_Adv = mkAdv "šodien" ;
|
today_Adv = mkAdv "šodien" ;
|
||||||
uncertain_A = mkA "nepārliecināts" ;
|
uncertain_A = mkA "nepārliecināts" ;
|
||||||
|
|
||||||
--oper par_Prep = mkPrep "par" Acc Dat ;
|
-- TODO: kāpēc neizdodas ar ExtraLav?
|
||||||
|
-- Eng arī dara šitā:
|
||||||
|
oper par_Prep = mkPrep "par" Acc Dat ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ lin
|
|||||||
UsePron p = { s = p.s ; a = p.a ; isNeg = False } ;
|
UsePron p = { s = p.s ; a = p.a ; isNeg = False } ;
|
||||||
|
|
||||||
PredetNP pred np = {
|
PredetNP pred np = {
|
||||||
s = \\c => pred.s ! (fromAgr np.a).g ++ np.s ! c ;
|
s = \\c => pred.s ! (fromAgr np.a).gend ++ np.s ! c ;
|
||||||
a = np.a ;
|
a = np.a ;
|
||||||
isNeg = False
|
isNeg = False
|
||||||
} ;
|
} ;
|
||||||
@@ -29,12 +29,12 @@ lin
|
|||||||
--UseN3 n = n ;
|
--UseN3 n = n ;
|
||||||
|
|
||||||
ComplN2 f x = {
|
ComplN2 f x = {
|
||||||
s = \\_,n,c => preOrPost f.isPre (f.p.s ++ x.s ! (f.p.c ! (fromAgr x.a).n)) (f.s ! n ! c) ;
|
s = \\_,n,c => preOrPost f.isPre (f.p.s ++ x.s ! (f.p.c ! (fromAgr x.a).num)) (f.s ! n ! c) ;
|
||||||
g = f.g
|
g = f.g
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ComplN3 f x = {
|
ComplN3 f x = {
|
||||||
s = \\n,c => preOrPost f.isPre1 (f.p1.s ++ x.s ! (f.p1.c ! (fromAgr x.a).n)) (f.s ! n ! c) ;
|
s = \\n,c => preOrPost f.isPre1 (f.p1.s ++ x.s ! (f.p1.c ! (fromAgr x.a).num)) (f.s ! n ! c) ;
|
||||||
g = f.g ;
|
g = f.g ;
|
||||||
p = f.p2 ;
|
p = f.p2 ;
|
||||||
isPre = f.isPre2
|
isPre = f.isPre2
|
||||||
@@ -144,7 +144,7 @@ lin
|
|||||||
|
|
||||||
-- 'Pielikums'
|
-- 'Pielikums'
|
||||||
ApposCN cn np = {
|
ApposCN cn np = {
|
||||||
s = \\d,n,c => case (fromAgr np.a).n of {
|
s = \\d,n,c => case (fromAgr np.a).num of {
|
||||||
n => cn.s ! d ! n ! c ++ np.s ! c ; -- FIXME: comparison not working
|
n => cn.s ! d ! n ! c ++ np.s ! c ; -- FIXME: comparison not working
|
||||||
_ => NON_EXISTENT -- FIXME: pattern never reached
|
_ => NON_EXISTENT -- FIXME: pattern never reached
|
||||||
} ;
|
} ;
|
||||||
@@ -163,7 +163,7 @@ lin
|
|||||||
|
|
||||||
-- FIXME: vajag šķirot noteikto/nenoteikto galotni..?
|
-- FIXME: vajag šķirot noteikto/nenoteikto galotni..?
|
||||||
PPartNP np v2 = {
|
PPartNP np v2 = {
|
||||||
s = \\c => v2.s ! Pos ! (Participle TsTa (fromAgr np.a).g (fromAgr np.a).n c) ++ np.s ! c ;
|
s = \\c => v2.s ! Pos ! (Participle TsTa (fromAgr np.a).gend (fromAgr np.a).num c) ++ np.s ! c ;
|
||||||
a = np.a ;
|
a = np.a ;
|
||||||
isNeg = np.isNeg
|
isNeg = np.isNeg
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -13,13 +13,29 @@ flags
|
|||||||
lin
|
lin
|
||||||
RelCl cl = { s = \\m,p,_ => "ka" ++ cl.s ! m ! p } ;
|
RelCl cl = { s = \\m,p,_ => "ka" ++ cl.s ! m ! p } ;
|
||||||
|
|
||||||
RelVP rp vp = {
|
-- RP -> VP -> RCl
|
||||||
s = \\m,p,ag =>
|
RelVP rp vp = mkRelClause rp vp ;
|
||||||
rp.s ! Masc ! Nom ++
|
|
||||||
buildVerb vp.v m p (toAgr (fromAgr ag).n P3 (fromAgr ag).g) False vp.objNeg ++
|
|
||||||
vp.compl ! ag
|
|
||||||
} ;
|
|
||||||
|
|
||||||
|
oper
|
||||||
|
-- TODO: PassV2 verbs jāsaskaņo ar objektu, nevis subjektu (by8means_Prep: AgP3 Sg Masc)
|
||||||
|
mkRelClause : RP -> CatLav.VP -> RCl = \rp,vp ->
|
||||||
|
let subj : Case = case vp.agr.voice of {
|
||||||
|
Act => vp.agr.c_topic ;
|
||||||
|
Pass => vp.agr.c_focus
|
||||||
|
} in lin RCl {
|
||||||
|
s = \\mood,pol,agr =>
|
||||||
|
case mood of { -- Subject
|
||||||
|
Deb _ _ => rp.s ! Masc ! Dat ; --# notpresent
|
||||||
|
_ => rp.s ! Masc ! vp.agr.c_topic
|
||||||
|
} ++
|
||||||
|
case subj of { -- Verb
|
||||||
|
Nom => buildVerb vp.v mood pol (toAgr (fromAgr agr).num P3 (fromAgr agr).gend) False vp.objNeg ; -- TODO: kāpēc P3 nevis agr, kāds tas ir?
|
||||||
|
_ => buildVerb vp.v mood pol vp.agr.agr False vp.objNeg -- TODO: test me
|
||||||
|
} ++
|
||||||
|
vp.compl ! agr -- Object(s), complements, adverbial modifiers
|
||||||
|
} ;
|
||||||
|
|
||||||
|
lin
|
||||||
-- FIXME: vārdu secība - nevis 'kas mīl viņu' bet 'kas viņu mīl' (?)
|
-- FIXME: vārdu secība - nevis 'kas mīl viņu' bet 'kas viņu mīl' (?)
|
||||||
-- FIXME: Masc varētu nebūt labi
|
-- FIXME: Masc varētu nebūt labi
|
||||||
RelSlash rp slash = {
|
RelSlash rp slash = {
|
||||||
@@ -29,7 +45,7 @@ lin
|
|||||||
-- FIXME: placeholder
|
-- FIXME: placeholder
|
||||||
-- TODO: jātestē, kautkas nav labi ar testpiemēru
|
-- TODO: jātestē, kautkas nav labi ar testpiemēru
|
||||||
FunRP p np rp = {
|
FunRP p np rp = {
|
||||||
s = \\g,c => p.s ++ rp.s ! g ! c ++ np.s ! (p.c ! (fromAgr np.a).n)
|
s = \\g,c => p.s ++ rp.s ! g ! c ++ np.s ! (p.c ! (fromAgr np.a).num)
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
IdRP = {
|
IdRP = {
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ param
|
|||||||
AForm = AAdj Degree Definite Gender Number Case | AAdv Degree ;
|
AForm = AAdj Degree Definite Gender Number Case | AAdv Degree ;
|
||||||
|
|
||||||
-- Participles
|
-- Participles
|
||||||
PartType = IsUsi | TsTa ;
|
PartType = IsUsi | TsTa ; -- TODO: šo jāmet ārā - pārklājas ar Voice, kas attiecas ne tikai uz divdabjiem
|
||||||
|
Voice = Act | Pass ;
|
||||||
|
|
||||||
-- Verbs
|
-- Verbs
|
||||||
-- Ind = Indicative
|
-- Ind = Indicative
|
||||||
@@ -54,7 +55,9 @@ param
|
|||||||
Agr = AgP1 Number Gender | AgP2 Number Gender | AgP3 Number Gender ;
|
Agr = AgP1 Number Gender | AgP2 Number Gender | AgP3 Number Gender ;
|
||||||
|
|
||||||
-- Clause agreement
|
-- Clause agreement
|
||||||
ClAgr = Topic Case | TopicFocus Case Agr ;
|
-- TODO: jāpāriet uz vienotu TopicFocus (=> ieraksta tips)
|
||||||
|
--ClAgr = Topic Case Voice | TopicFocus Case Case Agr Voice ;
|
||||||
|
--ClAgr = NomAcc Agr Voice | DatNom Agr Voice | DatGen Agr Voice ;
|
||||||
|
|
||||||
ThisOrThat = This | That ;
|
ThisOrThat = This | That ;
|
||||||
CardOrd = NCard | NOrd ;
|
CardOrd = NCard | NOrd ;
|
||||||
@@ -74,6 +77,9 @@ oper
|
|||||||
|
|
||||||
Verb : Type = { s : Polarity => VerbForm => Str } ;
|
Verb : Type = { s : Polarity => VerbForm => Str } ;
|
||||||
|
|
||||||
|
-- TODO: voice ir jāliek pa tiešo zem VP (?)
|
||||||
|
ClAgr : Type = { c_topic : Case ; c_focus : Case ; agr : Agr ; voice : Voice } ;
|
||||||
|
|
||||||
-- TODO: topic un focus jāapvieno vienā (jaunā) agr parametrā (?), jo
|
-- TODO: topic un focus jāapvieno vienā (jaunā) agr parametrā (?), jo
|
||||||
-- ne vienmēr ir abi un ne visas kombinācijas ir vajadzīgas
|
-- ne vienmēr ir abi un ne visas kombinācijas ir vajadzīgas
|
||||||
--
|
--
|
||||||
@@ -83,7 +89,7 @@ oper
|
|||||||
-- topic: typically - subject
|
-- topic: typically - subject
|
||||||
-- focus: typically - objects, complements, adverbial modifiers
|
-- focus: typically - objects, complements, adverbial modifiers
|
||||||
|
|
||||||
VPSlash = VP ** { p : Prep } ;
|
VPSlash = VP ** { p : Prep } ; -- TODO: p pārklājas ar agr
|
||||||
-- principā rekur ir objekts kuram jau kaut kas ir bet ir vēl viena brīva valence...
|
-- principā rekur ir objekts kuram jau kaut kas ir bet ir vēl viena brīva valence...
|
||||||
|
|
||||||
Prep : Type = { s : Str ; c : Number => Case } ;
|
Prep : Type = { s : Str ; c : Number => Case } ;
|
||||||
@@ -93,36 +99,54 @@ oper
|
|||||||
--Valence : Type = { p : Prep ; c : Number => Case } ;
|
--Valence : Type = { p : Prep ; c : Number => Case } ;
|
||||||
-- e.g. 'ar' + Sg-Acc or Pl-Dat; Preposition may be skipped for simple case-baced valences
|
-- e.g. 'ar' + Sg-Acc or Pl-Dat; Preposition may be skipped for simple case-baced valences
|
||||||
|
|
||||||
toAgr : Number -> Person -> Gender -> Agr = \n,p,g ->
|
toAgr : Number -> Person -> Gender -> Agr = \num,pers,gend ->
|
||||||
case p of {
|
case pers of {
|
||||||
P1 => AgP1 n g ;
|
P1 => AgP1 num gend ;
|
||||||
P2 => AgP2 n g ;
|
P2 => AgP2 num gend ;
|
||||||
P3 => AgP3 n g
|
P3 => AgP3 num gend
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
fromAgr : Agr -> { n : Number ; p : Person ; g : Gender } = \a ->
|
toClAgr : Case -> Case -> Agr -> Voice -> ClAgr = \c_topic,c_focus,agr,voice -> {
|
||||||
case a of {
|
c_topic = c_topic ;
|
||||||
AgP1 n g => { n = n ; p = P1 ; g = g } ;
|
c_focus = c_focus ;
|
||||||
AgP2 n g => { n = n ; p = P2 ; g = g } ;
|
agr = agr ;
|
||||||
AgP3 n g => { n = n ; p = P3 ; g = g }
|
voice = voice
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- TODO: quick & dirty
|
||||||
|
toClAgr_Reg : Case -> ClAgr = \c_topic -> toClAgr c_topic Nom (AgP3 Sg Masc) Act ;
|
||||||
|
|
||||||
|
fromAgr : Agr -> { num : Number ; pers : Person ; gend : Gender } = \agr ->
|
||||||
|
case agr of {
|
||||||
|
AgP1 num gend => { num = num ; pers = P1 ; gend = gend } ;
|
||||||
|
AgP2 num gend => { num = num ; pers = P2 ; gend = gend } ;
|
||||||
|
AgP3 num gend => { num = num ; pers = P3 ; gend = gend }
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
conjAgr : Agr -> Agr -> Agr = \a0,b0 ->
|
{-
|
||||||
|
fromClAgr : ClAgr -> { c_topic : Case ; c_focus : Case ; voice : Voice } = \agr ->
|
||||||
|
case agr of {
|
||||||
|
Topic c_topic voice => { c_topic = c_topic ; c_focus = Acc ; voice = voice } ;
|
||||||
|
TopicFocus c_topic c_focus _ voice => { c_topic = c_topic ; c_focus = c_focus ; voice = voice }
|
||||||
|
} ;
|
||||||
|
-}
|
||||||
|
|
||||||
|
conjAgr : Agr -> Agr -> Agr = \agr1,agr2 ->
|
||||||
let
|
let
|
||||||
a = fromAgr a0 ;
|
a1 = fromAgr agr1 ;
|
||||||
b = fromAgr b0
|
a2 = fromAgr agr2
|
||||||
in
|
in
|
||||||
toAgr
|
toAgr
|
||||||
(conjNumber a.n b.n)
|
(conjNumber a1.num a2.num)
|
||||||
(conjPerson a.p b.p) -- FIXME: personu apvienošana ir tricky un ir jāuztaisa korekti
|
(conjPerson a1.pers a2.pers) -- FIXME: personu apvienošana ir tricky un ir jāuztaisa korekti
|
||||||
(conjGender a.g b.g) ;
|
(conjGender a1.gend a2.gend) ;
|
||||||
|
|
||||||
conjGender : Gender -> Gender -> Gender = \a,b ->
|
conjGender : Gender -> Gender -> Gender = \gend1,gend2 ->
|
||||||
case a of {
|
case gend1 of {
|
||||||
Fem => b ;
|
Fem => gend2 ;
|
||||||
_ => Masc
|
_ => Masc
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
agrgP3 : Number -> Gender -> Agr = \n,g -> toAgr n P3 g ;
|
agrgP3 : Number -> Gender -> Agr = \num,gend -> toAgr num P3 gend ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ flags
|
|||||||
coding = utf8 ;
|
coding = utf8 ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
|
-- NP -> VP -> Cl
|
||||||
PredVP np vp = mkClause np vp ;
|
PredVP np vp = mkClause np vp ;
|
||||||
|
|
||||||
PredSCVP sc vp = mkClauseSC sc vp ;
|
PredSCVP sc vp = mkClauseSC sc vp ;
|
||||||
@@ -30,7 +31,7 @@ lin
|
|||||||
mkClause np (lin VP {
|
mkClause np (lin VP {
|
||||||
v = vs ;
|
v = vs ;
|
||||||
compl = \\_ => "," ++ vs.subj.s ++ sslash.s ;
|
compl = \\_ => "," ++ vs.subj.s ++ sslash.s ;
|
||||||
agr = Topic vs.topic ;
|
agr = toClAgr_Reg vs.topic ;
|
||||||
objNeg = False
|
objNeg = False
|
||||||
}) ** { p = sslash.p } ;
|
}) ** { p = sslash.p } ;
|
||||||
|
|
||||||
@@ -58,24 +59,43 @@ lin
|
|||||||
AdvS a s = { s = NON_EXISTENT } ;
|
AdvS a s = { s = NON_EXISTENT } ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
|
-- TODO: PassV2 verbs jāsaskaņo ar objektu, nevis subjektu (by8means_Prep: AgP3 Sg Masc)
|
||||||
mkClause : NP -> CatLav.VP -> Cl = \np,vp -> lin Cl {
|
mkClause : NP -> CatLav.VP -> Cl = \np,vp ->
|
||||||
s = \\mood,pol =>
|
let subj : Case = case vp.agr.voice of {
|
||||||
case mood of { -- Subject
|
Act => vp.agr.c_topic ;
|
||||||
Deb _ _ => np.s ! Dat ; --# notpresent
|
Pass => vp.agr.c_focus
|
||||||
_ => case vp.agr of {
|
} in lin Cl {
|
||||||
Topic c => np.s ! c ;
|
s = \\mood,pol =>
|
||||||
TopicFocus c _ => np.s ! c
|
case mood of { -- Subject
|
||||||
}
|
Deb _ _ => np.s ! Dat ; --# notpresent
|
||||||
} ++
|
_ => np.s ! vp.agr.c_topic
|
||||||
case vp.agr of { -- Verb
|
{-
|
||||||
Topic Nom => buildVerb vp.v mood pol np.a np.isNeg vp.objNeg ;
|
_ => case vp.agr.voice of {
|
||||||
Topic _ => buildVerb vp.v mood pol (AgP3 Sg Masc) np.isNeg vp.objNeg ; -- TODO: test me
|
Act => np.s ! vp.agr.c_topic ;
|
||||||
TopicFocus Nom _ => buildVerb vp.v mood pol np.a np.isNeg vp.objNeg ;
|
Pass => np.s ! vp.agr.c_focus
|
||||||
TopicFocus _ agr => buildVerb vp.v mood pol agr np.isNeg vp.objNeg
|
}
|
||||||
} ++
|
-}
|
||||||
vp.compl ! np.a -- Object(s), complements, adverbial modifiers
|
{-
|
||||||
} ;
|
_ => case vp.agr of {
|
||||||
|
Topic c _ => np.s ! c ;
|
||||||
|
TopicFocus c _ _ _ => np.s ! c
|
||||||
|
}
|
||||||
|
-}
|
||||||
|
} ++
|
||||||
|
case subj of { -- Verb
|
||||||
|
Nom => buildVerb vp.v mood pol np.a np.isNeg vp.objNeg ;
|
||||||
|
_ => buildVerb vp.v mood pol vp.agr.agr np.isNeg vp.objNeg -- TODO: test me
|
||||||
|
} ++
|
||||||
|
{-
|
||||||
|
case vp.agr of { -- Verb
|
||||||
|
Topic Nom _ => buildVerb vp.v mood pol np.a np.isNeg vp.objNeg ;
|
||||||
|
Topic _ _ => buildVerb vp.v mood pol (AgP3 Sg Masc) np.isNeg vp.objNeg ; -- TODO: test me
|
||||||
|
TopicFocus Nom _ _ _ => buildVerb vp.v mood pol np.a np.isNeg vp.objNeg ;
|
||||||
|
TopicFocus _ _ agr _ => buildVerb vp.v mood pol agr np.isNeg vp.objNeg
|
||||||
|
} ++
|
||||||
|
-}
|
||||||
|
vp.compl ! np.a -- Object(s), complements, adverbial modifiers
|
||||||
|
} ;
|
||||||
|
|
||||||
-- FIXME: quick&dirty - lai kompilētos pret RGL API
|
-- FIXME: quick&dirty - lai kompilētos pret RGL API
|
||||||
-- Eng: PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp
|
-- Eng: PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ flags
|
|||||||
lin
|
lin
|
||||||
language_title_Utt = ss "latviešu valoda" ;
|
language_title_Utt = ss "latviešu valoda" ;
|
||||||
|
|
||||||
|
yes_Utt = ss "jā" ;
|
||||||
|
no_Utt = ss "nē" ;
|
||||||
|
|
||||||
every_Det = {
|
every_Det = {
|
||||||
s = (\\g,c => (mkPronoun_Gend "ikviens").s ! g ! Sg ! c) ;
|
s = (\\g,c => (mkPronoun_Gend "ikviens").s ! g ! Sg ! c) ;
|
||||||
n = Sg ;
|
n = Sg ;
|
||||||
@@ -23,14 +26,14 @@ lin
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
someSg_Det = {
|
someSg_Det = {
|
||||||
s = (\\g,c => (mkPronoun_Gend "kāds").s ! g ! Sg ! c) ; -- lai atļautu arī tukšo, jāliek (\\_,_ => []) | klāt
|
s = (\\g,c => (mkPronoun_Gend "kāds").s ! g ! Sg ! c) ; -- TODO: lai atļautu arī tukšo, jāpieliek alternatīva: (\\_,_ => [])
|
||||||
n = Sg ;
|
n = Sg ;
|
||||||
d = Indef ;
|
d = Indef ;
|
||||||
isNeg = False
|
isNeg = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
somePl_Det = {
|
somePl_Det = {
|
||||||
s = (\\g,c => (mkPronoun_Gend "kāds").s ! g ! Pl ! c) ; -- lai atļautu arī tukšo, jāliek (\\_,_ => []) | klāt
|
s = (\\g,c => (mkPronoun_Gend "kāds").s ! g ! Pl ! c) ; -- TODO: lai atļautu arī tukšo, jāpieliek alternatīva: (\\_,_ => [])
|
||||||
n = Pl ;
|
n = Pl ;
|
||||||
d = Indef ;
|
d = Indef ;
|
||||||
isNeg = False
|
isNeg = False
|
||||||
@@ -44,14 +47,14 @@ lin
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
many_Det = {
|
many_Det = {
|
||||||
s = (\\g,c => (mkPronoun_Gend "daudzs").s ! g ! Pl ! c) ; -- 'daudzs' izlocīsies korekti uz daudzskaitļa 'daudzi'
|
s = (\\g,c => (mkPronoun_Gend "daudzs").s ! g ! Pl ! c) ; -- 'daudzs' izlocīsies korekti uz daudzskaitļa 'daudzi'; tomēr nesmuki...
|
||||||
n = Pl ;
|
n = Pl ;
|
||||||
d = Indef ;
|
d = Indef ;
|
||||||
isNeg = False
|
isNeg = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
much_Det = {
|
much_Det = {
|
||||||
s = (\\g,c => "daudz") ; -- FIXME - ņem saistību ar ģenitīvu; kā to realizēt?
|
s = (\\g,c => "daudz") ; -- FIXME: piesaista ģenitīvu
|
||||||
n = Sg ;
|
n = Sg ;
|
||||||
d = Indef ;
|
d = Indef ;
|
||||||
isNeg = False
|
isNeg = False
|
||||||
@@ -107,42 +110,36 @@ lin
|
|||||||
|
|
||||||
it_Pron = mkPronoun_It_Sg Masc ; -- See also: ExtraLav.it8fem_Pron
|
it_Pron = mkPronoun_It_Sg Masc ; -- See also: ExtraLav.it8fem_Pron
|
||||||
|
|
||||||
-- manuprāt prievārdi tomēr ir valodas-specifiski un nebūtu tieši 1-pret-1 jātulko
|
-- Pronouns; their translation is very ambiguos...
|
||||||
|
|
||||||
above_Prep = mkPrep "virs" Gen Dat ;
|
above_Prep = mkPrep "virs" Gen Dat ;
|
||||||
after_Prep = mkPrep "pēc" Gen Dat ;
|
after_Prep = mkPrep "pēc" Gen Dat ;
|
||||||
before_Prep = mkPrep "pirms" Gen Dat ;
|
before_Prep = mkPrep "pirms" Gen Dat ;
|
||||||
behind_Prep = mkPrep "aiz" Gen Dat ; -- taču "aiz" nav viennozīmīgi "behind"
|
behind_Prep = mkPrep "aiz" Gen Dat ; -- taču "aiz" nav viennozīmīgi "behind"
|
||||||
between_Prep = mkPrep "starp" Acc Dat ;
|
between_Prep = mkPrep "starp" Acc Dat ;
|
||||||
|
during_Prep = mkPrep Loc ;
|
||||||
for_Prep = mkPrep "priekš" Gen Dat ;
|
for_Prep = mkPrep "priekš" Gen Dat ;
|
||||||
from_Prep = mkPrep "no" Gen Dat ;
|
from_Prep = mkPrep "no" Gen Dat ;
|
||||||
on_Prep = mkPrep "uz" Gen Dat ;
|
|
||||||
with_Prep = mkPrep "ar" Acc Dat ; -- ar sievu, ar sievām
|
|
||||||
in_Prep = mkPrep Loc ;
|
in_Prep = mkPrep Loc ;
|
||||||
to_Prep = mkPrep "uz" Acc Dat ; -- See also: ExtraLav.liidz_Prep, pie_Prep
|
|
||||||
possess_Prep = mkPrep Gen ; -- FIXME: vajadzētu vārdu secību otrādi - pirms paskaidrojamā vārda likt
|
|
||||||
under_Prep = mkPrep "zem" Gen Dat ;
|
|
||||||
without_Prep = mkPrep "bez" Gen Dat ;
|
|
||||||
by8agent_Prep = nom_Prep ; -- TODO: should get rid of this Prep; taču tas parādās Eng2Abs kokos... -- FIXME: nom_Prep vs. dat_Prep/accPrep
|
|
||||||
by8means_Prep = mkPrep "ar" Acc Dat ;
|
|
||||||
during_Prep = mkPrep Loc ;
|
|
||||||
in8front_Prep = mkPrep "priekšā" Dat Dat ;
|
in8front_Prep = mkPrep "priekšā" Dat Dat ;
|
||||||
part_Prep = mkPrep Gen ; --FIXME - vajadzētu vārdu secību otrādi - pirms paskaidrojamā vārda likt
|
on_Prep = mkPrep "uz" Gen Dat ;
|
||||||
through_Prep = mkPrep "caur" Acc Dat ;
|
through_Prep = mkPrep "caur" Acc Dat ;
|
||||||
except_Prep = mkPrep "izņemot" Acc Acc ;
|
to_Prep = mkPrep "uz" Acc Dat ; -- See also: ExtraLav.liidz_Prep, pie_Prep
|
||||||
|
under_Prep = mkPrep "zem" Gen Dat ;
|
||||||
|
with_Prep = mkPrep "ar" Acc Dat ;
|
||||||
|
without_Prep = mkPrep "bez" Gen Dat ;
|
||||||
|
|
||||||
|
by8agent_Prep = nom_Prep ; -- TODO: nom_Prep (default) vs. dat_Prep
|
||||||
|
by8means_Prep = mkPrep "ar" Acc Dat ;
|
||||||
|
except_Prep = mkPrep "izņemot" Acc Acc ; -- Acc - by default?
|
||||||
|
part_Prep = mkPrep Gen ; --FIXME - vajadzētu vārdu secību otrādi - pirms paskaidrojamā vārda likt
|
||||||
|
possess_Prep = mkPrep Gen ; -- FIXME: vajadzētu vārdu secību otrādi - pirms paskaidrojamā vārda likt
|
||||||
|
|
||||||
very_AdA = mkAdA "ļoti" ;
|
very_AdA = mkAdA "ļoti" ;
|
||||||
almost_AdA = mkAdA "gandrīz" ;
|
almost_AdA = mkAdA "gandrīz" ;
|
||||||
so_AdA = mkAdA "tik" ;
|
so_AdA = mkAdA "tik" ;
|
||||||
too_AdA = mkAdA "pārāk" ;
|
too_AdA = mkAdA "pārāk" ;
|
||||||
|
|
||||||
and_Conj = mkConj "un" ;
|
|
||||||
or_Conj = mkConj "vai" Sg ;
|
|
||||||
if_then_Conj = mkConj "ja" "tad" ;
|
|
||||||
|
|
||||||
but_PConj = ss "bet" ;
|
|
||||||
otherwise_PConj = ss "citādi" ;
|
|
||||||
therefore_PConj = ss "tāpēc" ;
|
|
||||||
|
|
||||||
more_CAdv = (mkCAdv [] "nekā" Compar) | (mkCAdv "vairāk" "nekā" Posit) ;
|
more_CAdv = (mkCAdv [] "nekā" Compar) | (mkCAdv "vairāk" "nekā" Posit) ;
|
||||||
less_CAdv = mkCAdv "mazāk" "nekā" Posit ;
|
less_CAdv = mkCAdv "mazāk" "nekā" Posit ;
|
||||||
as_CAdv = mkCAdv "tikpat" "kā" Posit ;
|
as_CAdv = mkCAdv "tikpat" "kā" Posit ;
|
||||||
@@ -157,10 +154,16 @@ lin
|
|||||||
somewhere_Adv = mkAdv "kaut kur" ;
|
somewhere_Adv = mkAdv "kaut kur" ;
|
||||||
quite_Adv = mkAdv "diezgan" ;
|
quite_Adv = mkAdv "diezgan" ;
|
||||||
|
|
||||||
both7and_DConj = mkConj "gan" ("," ++ "gan"); --FIXME - komati nav tā kā vajag
|
and_Conj = mkConj "un" ;
|
||||||
either7or_DConj = mkConj ("vai" ++ "nu") ("," ++ "vai") Sg ; --FIXME - komati nav tā kā vajag
|
or_Conj = mkConj "vai" Sg ;
|
||||||
|
if_then_Conj = mkConj "ja" "tad" ;
|
||||||
|
|
||||||
want_VV = mkVV (mkV "vēlēties" third_conjugation) ;
|
but_PConj = ss "bet" ;
|
||||||
|
otherwise_PConj = ss "citādi" ;
|
||||||
|
therefore_PConj = ss "tāpēc" ;
|
||||||
|
|
||||||
|
both7and_DConj = mkConj "gan" ("," ++ "gan"); -- FIXME: komati nav tā kā vajag
|
||||||
|
either7or_DConj = mkConj ("vai" ++ "nu") ("," ++ "vai") Sg ; -- FIXME: komati nav tā kā vajag
|
||||||
|
|
||||||
whoSg_IP = { -- FIXME: Fem
|
whoSg_IP = { -- FIXME: Fem
|
||||||
s = table {
|
s = table {
|
||||||
@@ -223,6 +226,11 @@ lin
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
how8many_IDet = {
|
||||||
|
s = table { _ => "cik" } ;
|
||||||
|
n = Pl
|
||||||
|
} ;
|
||||||
|
|
||||||
when_Subj = ss "kad" ;
|
when_Subj = ss "kad" ;
|
||||||
although_Subj = ss "kaut arī" ;
|
although_Subj = ss "kaut arī" ;
|
||||||
because_Subj = ss "jo" ;
|
because_Subj = ss "jo" ;
|
||||||
@@ -230,24 +238,15 @@ lin
|
|||||||
that_Subj = ss "ka" ;
|
that_Subj = ss "ka" ;
|
||||||
|
|
||||||
all_Predet = { s = table { Masc => "visi" ; Fem => "visas" } } ;
|
all_Predet = { s = table { Masc => "visi" ; Fem => "visas" } } ;
|
||||||
|
|
||||||
only_Predet = { s = table { _ => "tikai"} } ;
|
only_Predet = { s = table { _ => "tikai"} } ;
|
||||||
most_Predet = { s = table { _ => "vairums"} } ;
|
most_Predet = { s = table { _ => "vairums"} } ;
|
||||||
|
|
||||||
yes_Utt = ss "jā" ;
|
|
||||||
please_Voc = ss "lūdzu" ;
|
|
||||||
|
|
||||||
almost_AdN = mkAdN "gandrīz" ;
|
almost_AdN = mkAdN "gandrīz" ;
|
||||||
at_least_AdN = mkAdN "vismaz" ;
|
at_least_AdN = mkAdN "vismaz" ;
|
||||||
at_most_AdN = mkAdN "ne vairāk kā" ;
|
at_most_AdN = mkAdN "ne vairāk kā" ;
|
||||||
|
|
||||||
always_AdV = mkAdV "vienmēr" ;
|
always_AdV = mkAdV "vienmēr" ;
|
||||||
|
|
||||||
how8many_IDet = {
|
|
||||||
s = table { _ => "cik" } ;
|
|
||||||
n = Pl
|
|
||||||
} ;
|
|
||||||
|
|
||||||
somebody_NP = UsePron (mkPronoun_Body "kāds") ;
|
somebody_NP = UsePron (mkPronoun_Body "kāds") ;
|
||||||
something_NP = UsePron (mkPronoun_Thing "kaut kas") ;
|
something_NP = UsePron (mkPronoun_Thing "kaut kas") ;
|
||||||
everybody_NP = UsePron (mkPronoun_Body "ikviens") ;
|
everybody_NP = UsePron (mkPronoun_Body "ikviens") ;
|
||||||
@@ -258,9 +257,13 @@ lin
|
|||||||
have_V2 = mkV2 (mkV "būt") nom_Prep Dat ;
|
have_V2 = mkV2 (mkV "būt") nom_Prep Dat ;
|
||||||
have_V3 = mkV3 (mkV "būt") nom_Prep dat_Prep Dat ;
|
have_V3 = mkV3 (mkV "būt") nom_Prep dat_Prep Dat ;
|
||||||
|
|
||||||
can8know_VV, can_VV = mkVV (mkV "varēt" third_conjugation) ;
|
want_VV = mkVV (mkV "vēlēties" third_conjugation) ;
|
||||||
|
can_VV = mkVV (mkV "varēt" third_conjugation) ;
|
||||||
|
can8know_VV = mkVV (mkV "varēt" third_conjugation) ;
|
||||||
must_VV = mkVV (mkV "vajadzēt" third_conjugation) Dat ;
|
must_VV = mkVV (mkV "vajadzēt" third_conjugation) Dat ;
|
||||||
|
|
||||||
|
please_Voc = ss "lūdzu" ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
|
|
||||||
reflPron : Case => Str = table {
|
reflPron : Case => Str = table {
|
||||||
@@ -288,6 +291,4 @@ oper
|
|||||||
} ;
|
} ;
|
||||||
-}
|
-}
|
||||||
|
|
||||||
no_Utt = ss "nē" ;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,88 +24,105 @@ lin
|
|||||||
UseV v = {
|
UseV v = {
|
||||||
v = v ;
|
v = v ;
|
||||||
compl = \\_ => [] ;
|
compl = \\_ => [] ;
|
||||||
agr = Topic Nom ;
|
agr = toClAgr_Reg Nom ;
|
||||||
objNeg = False
|
objNeg = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ComplVV vv vp = {
|
ComplVV vv vp = {
|
||||||
v = vv ;
|
v = vv ;
|
||||||
compl = \\agr => build_VP vp Pos Infinitive agr ;
|
compl = \\agr => build_VP vp Pos Infinitive agr ;
|
||||||
agr = Topic vv.topic ;
|
agr = toClAgr_Reg vv.topic ;
|
||||||
objNeg = False
|
objNeg = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ComplVS vs s = {
|
ComplVS vs s = {
|
||||||
v = vs ;
|
v = vs ;
|
||||||
compl = \\_ => "," ++ vs.subj.s ++ s.s ;
|
compl = \\_ => "," ++ vs.subj.s ++ s.s ;
|
||||||
agr = Topic vs.topic ;
|
agr = toClAgr_Reg vs.topic ;
|
||||||
objNeg = False
|
objNeg = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ComplVQ vq qs = {
|
ComplVQ vq qs = {
|
||||||
v = vq ;
|
v = vq ;
|
||||||
compl = \\_ => "," ++ qs.s ;
|
compl = \\_ => "," ++ qs.s ;
|
||||||
agr = Topic vq.topic ;
|
agr = toClAgr_Reg vq.topic ;
|
||||||
objNeg = False
|
objNeg = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ComplVA va ap = {
|
ComplVA va ap = {
|
||||||
v = va ;
|
v = va ;
|
||||||
compl = \\agr => ap.s ! Indef ! (fromAgr agr).g ! (fromAgr agr).n ! Nom ;
|
compl = \\agr => ap.s ! Indef ! (fromAgr agr).gend ! (fromAgr agr).num ! Nom ;
|
||||||
agr = Topic Nom ;
|
agr = toClAgr_Reg Nom ;
|
||||||
objNeg = False
|
objNeg = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- SlashV2a : V2 -> VPSlash ; -- love (it)
|
-- V2 -> VPSlash
|
||||||
-- The (direct) object is added by ComplSlash
|
-- The (direct) object is added by ComplSlash
|
||||||
SlashV2a v2 = {
|
SlashV2a v2 = {
|
||||||
v = v2 ;
|
v = v2 ;
|
||||||
compl = \\_ => [] ;
|
compl = \\_ => [] ;
|
||||||
p = v2.p ;
|
p = v2.p ;
|
||||||
agr = TopicFocus v2.topic (AgP3 Sg Masc) ; -- overriden in ComplSlash
|
agr = toClAgr v2.topic (v2.p.c ! Sg) (AgP3 Sg Masc) Act ; -- overriden in ComplSlash
|
||||||
objNeg = False -- overriden in ComplSlash
|
objNeg = False -- overriden in ComplSlash
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- VPSlash = { v : Verb ; compl : Agr => Str ; agr : ClAgr ; objNeg : Bool ; p : ResLav.Prep }
|
-- VPSlash -> NP -> VP
|
||||||
-- Agr = AgP1 Number Gender | AgP2 Number Gender | AgP3 Number Gender
|
ComplSlash vp np =
|
||||||
ComplSlash vpslash np =
|
|
||||||
let agr : Agr = np.a
|
let agr : Agr = np.a
|
||||||
in insertObjPre_Spec
|
in insertObjPre_Spec
|
||||||
(\\agr => vpslash.p.s ++ np.s ! (vpslash.p.c ! (fromAgr agr).n))
|
{-
|
||||||
vpslash
|
(\\agr => case (fromClAgr vp.agr).voice of {
|
||||||
|
Act => vp.p.s ++ np.s ! (vp.p.c ! (fromAgr agr).num) ;
|
||||||
|
Pass => np.s ! (fromClAgr vp.agr).c_topic
|
||||||
|
})
|
||||||
|
-}
|
||||||
|
(\\agr => case vp.agr.voice of {
|
||||||
|
Act => vp.p.s ++ np.s ! (vp.p.c ! (fromAgr agr).num) ;
|
||||||
|
Pass => case vp.p.c ! (fromAgr agr).num of {
|
||||||
|
--Nom => np.s ! vp.agr.c_topic ;
|
||||||
|
Nom => np.s ! vp.agr.c_focus ;
|
||||||
|
_ => vp.p.s ++ np.s ! (vp.p.c ! (fromAgr agr).num)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
vp
|
||||||
np ;
|
np ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
insertObjPre_Spec : (Agr => Str) -> ResLav.VP -> NP -> ResLav.VP = \obj,vp,obj_np -> {
|
insertObjPre_Spec : (Agr => Str) -> ResLav.VP -> NP -> ResLav.VP = \obj,vp,obj_np -> {
|
||||||
v = vp.v ;
|
v = vp.v ;
|
||||||
compl = \\agr => obj ! agr ++ vp.compl ! agr ;
|
compl = \\agr => obj ! agr ++ vp.compl ! agr ;
|
||||||
agr = case vp.agr of {
|
agr = vp.agr ;
|
||||||
TopicFocus topic _ => TopicFocus topic obj_np.a ;
|
{-
|
||||||
_ => Topic Nom
|
agr = case vp.agr.voice of {
|
||||||
|
Topic c_topic voice => Topic c_topic voice ;
|
||||||
|
TopicFocus c_topic c_focus _ voice => TopicFocus c_topic c_focus obj_np.a voice
|
||||||
|
-- _ => Topic Nom -- kāpēc ne 'Topic topic_case'? -- TODO: remove
|
||||||
} ;
|
} ;
|
||||||
|
-}
|
||||||
objNeg = obj_np.isNeg
|
objNeg = obj_np.isNeg
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
-- Slash2V3 : V3 -> NP -> VPSlash ; -- give it (to her)
|
-- V3 -> NP -> VPSlash ; -- give it (to her)
|
||||||
|
-- FIXME: "vīrietis runā par ābolus ar sievieti" ("a man talks to a woman about apples")
|
||||||
Slash2V3 v3 np = insertObjC
|
Slash2V3 v3 np = insertObjC
|
||||||
(\\_ => v3.p1.s ++ np.s ! (v3.p1.c ! (fromAgr np.a).n))
|
(\\_ => v3.p1.s ++ np.s ! (v3.p1.c ! (fromAgr np.a).num))
|
||||||
{
|
{
|
||||||
v = v3 ;
|
v = v3 ;
|
||||||
compl = \\_ => [] ;
|
compl = \\_ => [] ;
|
||||||
p = v3.p2 ;
|
p = v3.p2 ;
|
||||||
agr = TopicFocus v3.topic np.a ; -- TESTME: P1, P2 (in the focus)
|
agr = toClAgr v3.topic (v3.p1.c ! Sg) np.a Act ; -- TESTME: P1, P2 (in the focus)
|
||||||
objNeg = np.isNeg -- TESTME
|
objNeg = np.isNeg -- TESTME
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- Slash3V3 : V3 -> NP -> VPSlash ; -- give (it) to her
|
-- V3 -> NP -> VPSlash ; -- give (it) to her
|
||||||
Slash3V3 v3 np = insertObjC
|
Slash3V3 v3 np = insertObjC
|
||||||
(\\_ => v3.p2.s ++ np.s ! (v3.p2.c ! (fromAgr np.a).n))
|
(\\_ => v3.p2.s ++ np.s ! (v3.p2.c ! (fromAgr np.a).num))
|
||||||
{
|
{
|
||||||
v = v3 ;
|
v = v3 ;
|
||||||
compl = \\_ => [] ;
|
compl = \\_ => [] ;
|
||||||
p = v3.p1 ;
|
p = v3.p1 ;
|
||||||
agr = TopicFocus v3.topic (AgP3 Sg Masc) ; -- FIXME: works only if the focus is P3 (Sg/Pl); TODO: P1, P2 (Sg, Pl)
|
agr = toClAgr v3.topic (v3.p2.c ! Sg) (AgP3 Sg Masc) Act ; -- FIXME: works only if the focus is P3 (Sg/Pl); TODO: P1, P2 (Sg, Pl)
|
||||||
objNeg = np.isNeg -- TESTME
|
objNeg = np.isNeg -- TESTME
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -113,7 +130,7 @@ lin
|
|||||||
v = v2v ;
|
v = v2v ;
|
||||||
compl = \\agr => build_VP vp Pos Infinitive agr ;
|
compl = \\agr => build_VP vp Pos Infinitive agr ;
|
||||||
p = v2v.p ;
|
p = v2v.p ;
|
||||||
agr = Topic Nom ;
|
agr = toClAgr_Reg Nom ;
|
||||||
objNeg = False
|
objNeg = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -121,7 +138,7 @@ lin
|
|||||||
v = v2s ;
|
v = v2s ;
|
||||||
compl = \\_ => "," ++ v2s.subj.s ++ s.s ;
|
compl = \\_ => "," ++ v2s.subj.s ++ s.s ;
|
||||||
p = v2s.p ;
|
p = v2s.p ;
|
||||||
agr = Topic Nom ;
|
agr = toClAgr_Reg Nom ;
|
||||||
objNeg = False
|
objNeg = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -129,15 +146,15 @@ lin
|
|||||||
v = v2q ;
|
v = v2q ;
|
||||||
compl = \\_ => "," ++ qs.s ;
|
compl = \\_ => "," ++ qs.s ;
|
||||||
p = v2q.p ;
|
p = v2q.p ;
|
||||||
agr = Topic Nom ;
|
agr = toClAgr_Reg Nom ;
|
||||||
objNeg = False
|
objNeg = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
SlashV2A v2a ap = {
|
SlashV2A v2a ap = {
|
||||||
v = v2a ;
|
v = v2a ;
|
||||||
compl = \\agr => ap.s ! Indef ! (fromAgr agr).g ! (fromAgr agr).n ! Nom ;
|
compl = \\agr => ap.s ! Indef ! (fromAgr agr).gend ! (fromAgr agr).num ! Nom ;
|
||||||
p = v2a.p ;
|
p = v2a.p ;
|
||||||
agr = Topic Nom ;
|
agr = toClAgr_Reg Nom ;
|
||||||
objNeg = False
|
objNeg = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -145,39 +162,42 @@ lin
|
|||||||
v = vv ;
|
v = vv ;
|
||||||
compl = \\agr => build_VP vpslash Pos Infinitive agr ;
|
compl = \\agr => build_VP vpslash Pos Infinitive agr ;
|
||||||
p = vpslash.p ;
|
p = vpslash.p ;
|
||||||
agr = Topic vv.topic ;
|
agr = toClAgr_Reg vv.topic ;
|
||||||
objNeg = False
|
objNeg = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
SlashV2VNP v2v np vpslash = insertObjC
|
SlashV2VNP v2v np vpslash = insertObjC
|
||||||
(\\_ => v2v.p.s ++ np.s ! (v2v.p.c ! (fromAgr np.a).n))
|
(\\_ => v2v.p.s ++ np.s ! (v2v.p.c ! (fromAgr np.a).num))
|
||||||
{
|
{
|
||||||
v = v2v ;
|
v = v2v ;
|
||||||
compl = \\agr => build_VP vpslash Pos Infinitive agr ;
|
compl = \\agr => build_VP vpslash Pos Infinitive agr ;
|
||||||
p = vpslash.p ;
|
p = vpslash.p ;
|
||||||
agr = Topic Nom ;
|
agr = toClAgr_Reg Nom ;
|
||||||
objNeg = False
|
objNeg = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ReflVP vpslash = insertObjPre
|
ReflVP vpslash = insertObjPre
|
||||||
(\\agr => vpslash.p.s ++ reflPron ! (vpslash.p.c ! (fromAgr agr).n))
|
(\\agr => vpslash.p.s ++ reflPron ! (vpslash.p.c ! (fromAgr agr).num))
|
||||||
vpslash ;
|
vpslash ;
|
||||||
|
|
||||||
UseComp comp = {
|
UseComp comp = {
|
||||||
v = lin V mkVerb_Irreg_Be ;
|
v = lin V mkVerb_Irreg_Be ;
|
||||||
compl = \\agr => comp.s ! agr ;
|
compl = \\agr => comp.s ! agr ;
|
||||||
agr = Topic Nom ;
|
agr = toClAgr_Reg Nom ;
|
||||||
objNeg = False
|
objNeg = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- TODO: vai VP nevajag papildlauku isPass?
|
-- V2 -> VP
|
||||||
|
-- TODO: vai VP nevajag papildlauku isPass? Izskatās, ka vajag - jau/tikai ComplSlash (objekta locījumam)
|
||||||
PassV2 v2 = {
|
PassV2 v2 = {
|
||||||
v = v2 ;
|
v = v2 ;
|
||||||
compl = \\_ => [] ;
|
compl = \\_ => [] ;
|
||||||
agr = Topic v2.topic ;
|
--agr = toClAgr v2.topic (v2.p.c ! Sg) (AgP3 Sg Masc) Pass ; -- FIXME(?): should not be overriden in ComplSlash; P3 restriction - never used?
|
||||||
objNeg = False -- FIXME: inherit from the object
|
agr = toClAgr (v2.p.c ! Sg) v2.topic (AgP3 Sg Masc) Pass ; -- FIXME(?): should not be overriden in ComplSlash; P3 restriction - never used?
|
||||||
|
objNeg = False -- overriden in ComplSlash
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
-- VP -> Prep -> VPSlash
|
||||||
-- TODO: šajā brīdī ir jāignorē prep (by8agent_Prep); tas jāaizstāj ar v2.topic
|
-- TODO: šajā brīdī ir jāignorē prep (by8agent_Prep); tas jāaizstāj ar v2.topic
|
||||||
-- Tad varēs dzēst ārā komentāru pie StructuralLav.by8agent_Prep
|
-- Tad varēs dzēst ārā komentāru pie StructuralLav.by8agent_Prep
|
||||||
VPSlashPrep vp prep = vp ** {p = prep} ;
|
VPSlashPrep vp prep = vp ** {p = prep} ;
|
||||||
@@ -186,13 +206,13 @@ lin
|
|||||||
|
|
||||||
AdVVP adv vp = insertObjPre (\\_ => adv.s) vp ;
|
AdVVP adv vp = insertObjPre (\\_ => adv.s) vp ;
|
||||||
|
|
||||||
CompAP ap = { s = \\agr => ap.s ! Indef ! (fromAgr agr).g ! (fromAgr agr).n ! Nom } ;
|
CompAP ap = { s = \\agr => ap.s ! Indef ! (fromAgr agr).gend ! (fromAgr agr).num ! Nom } ;
|
||||||
|
|
||||||
CompNP np = { s = \\_ => np.s ! Nom } ;
|
CompNP np = { s = \\_ => np.s ! Nom } ;
|
||||||
|
|
||||||
CompAdv a = { s = \\_ => a.s } ;
|
CompAdv a = { s = \\_ => a.s } ;
|
||||||
|
|
||||||
CompCN cn = { s = \\agr => cn.s ! Indef ! (fromAgr agr).n ! Nom } ;
|
CompCN cn = { s = \\agr => cn.s ! Indef ! (fromAgr agr).num ! Nom } ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
build_VP : ResLav.VP -> Polarity -> VerbForm -> Agr -> Str = \vp,pol,vf,agr ->
|
build_VP : ResLav.VP -> Polarity -> VerbForm -> Agr -> Str = \vp,pol,vf,agr ->
|
||||||
@@ -220,20 +240,20 @@ oper
|
|||||||
|
|
||||||
-- FIXME: the type of the participle form - depending on what?! (currently fixed)
|
-- FIXME: the type of the participle form - depending on what?! (currently fixed)
|
||||||
buildVerb : Verb -> VerbMood -> Polarity -> Agr -> Bool -> Bool -> Str =
|
buildVerb : Verb -> VerbMood -> Polarity -> Agr -> Bool -> Bool -> Str =
|
||||||
\v,mood,pol,agr,subjNeg,objNeg ->
|
\v,mood,pol,subjAgr,subjNeg,objNeg ->
|
||||||
let
|
let
|
||||||
pol_prim : Polarity = case <subjNeg, objNeg> of {
|
pol_prim : Polarity = case <subjNeg, objNeg> of {
|
||||||
<True, _> => Neg ;
|
<True, _> => Neg ;
|
||||||
<_, True> => Neg ;
|
<_, True> => Neg ;
|
||||||
_ => pol
|
_ => pol
|
||||||
} ;
|
} ;
|
||||||
agr = fromAgr agr
|
agr = fromAgr subjAgr
|
||||||
; --# notpresent
|
; --# notpresent
|
||||||
part = v.s ! ResLav.Pos ! (Participle TsTa agr.g agr.n Nom) --# notpresent
|
part = v.s ! ResLav.Pos ! (Participle TsTa agr.gend agr.num Nom) --# notpresent
|
||||||
in case mood of {
|
in case mood of {
|
||||||
Ind Simul tense => v.s ! pol_prim ! (Indicative agr.p agr.n tense)
|
Ind Simul tense => v.s ! pol_prim ! (Indicative agr.pers agr.num tense)
|
||||||
; --# notpresent
|
; --# notpresent
|
||||||
Ind Anter tense => mkVerb_Irreg_Be.s ! pol_prim ! (Indicative agr.p agr.n tense) ++ part ; --# notpresent
|
Ind Anter tense => mkVerb_Irreg_Be.s ! pol_prim ! (Indicative agr.pers agr.num tense) ++ part ; --# notpresent
|
||||||
|
|
||||||
-- FIXME(?): Rel _ Past => ...
|
-- FIXME(?): Rel _ Past => ...
|
||||||
Rel _ Past => ResLav.NON_EXISTENT ; --# notpresent
|
Rel _ Past => ResLav.NON_EXISTENT ; --# notpresent
|
||||||
@@ -246,7 +266,7 @@ oper
|
|||||||
mkVerb_Irreg_Be.s ! ResLav.Pos ! (Participle TsTa Masc Sg Nom) ++ --# notpresent
|
mkVerb_Irreg_Be.s ! ResLav.Pos ! (Participle TsTa Masc Sg Nom) ++ --# notpresent
|
||||||
v.s ! ResLav.Pos ! Debitive ; --# notpresent
|
v.s ! ResLav.Pos ! Debitive ; --# notpresent
|
||||||
|
|
||||||
Condit Simul => v.s ! pol_prim ! (Indicative agr.p agr.n ParamX.Cond) ; --# notpresent
|
Condit Simul => v.s ! pol_prim ! (Indicative agr.pers agr.num ParamX.Cond) ; --# notpresent
|
||||||
Condit Anter => mkVerb_Irreg_Be.s ! pol_prim ! (Indicative agr.p agr.n ParamX.Cond) ++ part --# notpresent
|
Condit Anter => mkVerb_Irreg_Be.s ! pol_prim ! (Indicative agr.pers agr.num ParamX.Cond) ++ part --# notpresent
|
||||||
} ;
|
} ;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user