Latvian: extensions to the verb paradigms

Added support for -ts/-ta participles (in addition to -is/-usi; other participles - on demand) and fixed some palatalization exceptions.
This commit is contained in:
Normunds Gruzitis
2012-10-30 22:37:11 +00:00
parent 78120c84b5
commit 5a71256fda
7 changed files with 83 additions and 30 deletions

View File

@@ -124,7 +124,7 @@ lin
love_N = mkN "mīlestība" ;
love_V2 = mkV2 (mkV "mīlēt" third_conjugation) acc_Prep ;
man_N = mkN "vīrietis" ;
married_A2 = mkA2 (mkA (mkV "precēties" third_conjugation)) with_Prep ;
married_A2 = mkA2 (mkA (mkV "precēties" third_conjugation) IsUsi) with_Prep ;
meat_N = mkN "gaļa" ;
milk_N = mkN "piens" ;
moon_N = mkN "mēness" ;

View File

@@ -161,9 +161,9 @@ lin
g = cn.g
} ;
-- FIXME: vajag -ts / -ta divdabja formu, + šķirot noteikto/nenoteikto galotni
-- FIXME: vajag šķirot noteikto/nenoteikto galotni..?
PPartNP np v2 = {
s = \\c => v2.s ! Pos ! (Participle (fromAgr np.a).g (fromAgr np.a).n c) ++ np.s ! c ;
s = \\c => v2.s ! Pos ! (Participle TsTa (fromAgr np.a).g (fromAgr np.a).n c) ++ np.s ! c ;
a = np.a ;
isNeg = np.isNeg
} ;

View File

@@ -74,9 +74,9 @@ oper
-- TODO: Jāpieliek parametrs Tense: present = ziedošs, izsalkstošs; past = ziedējis, izsalcis.
-- Vai arī jāpadod Str "-is"/"-ošs" un pa tiešo jāizsauc mkParticiple, bet
-- kā šis mkA(Str) atšķirsies no citiem mkA(Str)?
mkAdjective_Participle : Verb -> Adj = \v -> {
mkAdjective_Participle : Verb -> PartType -> Adj = \v,p -> {
s = table {
AAdj Posit Indef g n c => v.s ! Pos ! (Participle g n c) ;
AAdj Posit Indef g n c => v.s ! Pos ! (Participle p g n c) ;
_ => NON_EXISTENT
}
};

View File

@@ -58,7 +58,12 @@ oper
mkA = overload {
mkA : (lemma : Str) -> A = \s -> lin A (mkAdjective s) ;
mkA : (lemma : Str) -> AdjType -> A = \s,t -> lin A (mkAdjectiveByType s t) ;
mkA : (v : Verb) -> A = \v -> lin A (mkAdjective_Participle v) ;
-- TODO: nav forši, ka jānorāda PartType, bet kā lai aptiet?
-- TODO: drīzāk jānorāda Str (divdabja forma) + PartType - pārējais iekšēji (auto)
-- Turklāt Adj f-cijā iespējams būtu ok, ja pa tiešo izsauktu mkAdjective?!
-- Tomēr diez vai: IsUsi...
-- mkA2 gadījumā: vai PartType var noteikt pēc obj_Prep? Diez vai...
mkA : (v : Verb) -> PartType -> A = \v,p -> lin A (mkAdjective_Participle v p) ;
} ;
mkA2 : A -> ResLav.Prep -> A2 = \a,p -> lin A2 (a ** { p = p }) ; -- precējies ar ...

View File

@@ -110,7 +110,8 @@ oper
Imperative Sg => pal_C1_4 stem2 ;
Imperative Pl => pal_C1_4 stem2 + "iet" ;
Participle g n c => mkParticiple_IsUsi g n c (pal_C1_3 stem3) (pal_C1_4 stem3)
Participle IsUsi g n c => mkParticiple_IsUsi g n c (pal_C1_3 stem3) ;
Participle TsTa g n c => mkParticiple_TsTa g n c stem1
}
} ;
@@ -157,7 +158,8 @@ oper
Imperative Sg => stem ;
Imperative Pl => stem + "jiet" ;
Participle g n c => mkParticiple g n c (stem + "j")
Participle IsUsi g n c => mkParticiple_IsUsi g n c (stem + "j") ;
Participle TsTa g n c => mkParticiple_TsTa g n c stem
}
} ;
@@ -204,7 +206,8 @@ oper
Imperative Sg => pal_C3_1 stem + "i" ;
Imperative Pl => pal_C3_1 stem + "iet" ;
Participle g n c => mkParticiple g n c (stem + "j")
Participle IsUsi g n c => mkParticiple_IsUsi g n c (stem + "j") ;
Participle TsTa g n c => mkParticiple_TsTa g n c stem
}
} ;
@@ -255,7 +258,8 @@ oper
Imperative Sg => pal_C1_2 stem3 stem2 + "ies" ;
Imperative Pl => pal_C1_2 stem3 stem2 + "ieties" ;
Participle g n c => mkParticiple_Refl_IesUsies g n c (pal_C1_3 stem3) (pal_C1_4 stem3)
Participle IsUsi g n c => mkParticiple_IesUsies g n c (pal_C1_3 stem3) ;
Participle TsTa g n c => mkParticiple_TsTa g n c stem1
}
} ;
@@ -302,7 +306,8 @@ oper
Imperative Sg => stem + "jies" ;
Imperative Pl => stem + "jieties" ;
Participle g n c => mkParticiple_Refl g n c (stem + "j")
Participle IsUsi g n c => mkParticiple_IesUsies g n c (stem + "j") ;
Participle TsTa g n c => mkParticiple_TsTa g n c stem
}
} ;
@@ -349,7 +354,8 @@ oper
Imperative Sg => pal_C3_1 stem + "ies" ;
Imperative Pl => pal_C3_1 stem + "ieties" ;
Participle g n c => mkParticiple_Refl g n c (stem + "j")
Participle IsUsi g n c => mkParticiple_IesUsies g n c (stem + "j") ;
Participle TsTa g n c => mkParticiple_TsTa g n c stem
}
} ;
@@ -528,11 +534,13 @@ oper
-- Ref. to the Java implementation: mija9
pal_C3_5 : Str -> Str = \stem ->
case stem of {
s + "dā" => Predef.tk 1 stem ;
s + "ā" => s + "a" ;
s + "cī" => s + "ka" ; -- e.g. 'sacīt' => 'saka'
s + "ī" => s + "a" ;
_ => Predef.tk 1 stem
s + "dā" => Predef.tk 1 stem ;
s + "ā" => s + "a" ;
s + "ācī" => s + "āca" ; -- e.g. 'cīt' => 'māca'
s + "ī" => s + "īca" ; -- e.g. 'mīcīt' => 'mīca'
s + "cī" => s + "ka" ; -- e.g. 'sacīt' => 'saka'
s + "ī" => s + "a" ;
_ => Predef.tk 1 stem
} ;
-- Ref. to the Java implementation: mija12
@@ -549,16 +557,14 @@ oper
-- Participles: non-declinable and partially declinable participles, nominative cases of declinable participles
-- Declinable participles: syntactic function - attribute => category - adjective
-- TODO: declinable participles => adjectives
-- TODO: -ot, -am, -ām; -dams/dama, -damies/damās; -ošs/oša, -ams/ama, -āms/āma, -ts/ta
-- Nē, -ošs/oša ir tikai adjektīvi! Divdabji - tikai verbālās formas! (sk. Baibas sarakstu)
-- TODO: -ot, -am, -ām; -dams/dama, -damies/damās; -ams/ama, -āms/āma
-- -ošs/oša ir tikai adjektīvi! Divdabji - tikai verbālās formas! (sk. Baibas sarakstu)
mkParticiple : Gender -> Number -> Case -> Str -> Str = \g,n,c,stem -> mkParticiple_IsUsi g n c stem stem ;
mkParticiple_IsUsi : Gender -> Number -> Case -> Str -> Str -> Str = \g,n,c,stem,stem_lemma ->
mkParticiple_IsUsi : Gender -> Number -> Case -> Str -> Str = \g,n,c,stem ->
case g of {
Masc => case n of {
Sg => case c of {
Nom => stem_lemma + "is" ;
Nom => stem + "is" ;
Gen => stem + "uša" ;
Dat => stem + "ušam" ;
Acc => stem + "ušu" ;
@@ -594,13 +600,51 @@ oper
}
} ;
mkParticiple_Refl : Gender -> Number -> Case -> Str -> Str = \g,n,c,stem -> mkParticiple_Refl_IesUsies g n c stem stem ;
mkParticiple_Refl_IesUsies : Gender -> Number -> Case -> Str -> Str -> Str = \g,n,c,stem,stem_lemma ->
mkParticiple_TsTa : Gender -> Number -> Case -> Str -> Str = \g,n,c,stem ->
case g of {
Masc => case n of {
Sg => case c of {
Nom => stem_lemma + "ies" ;
Nom => stem + "ts" ;
Gen => stem + "ta" ;
Dat => stem + "tam" ;
Acc => stem + "tu" ;
Loc => stem + "tā" ;
Voc => NON_EXISTENT -- FIXME: -tais ?
} ;
Pl => case c of {
Nom => stem + "ti" ;
Gen => stem + "tu" ;
Dat => stem + "tiem" ;
Acc => stem + "tus" ;
Loc => stem + "tos" ;
Voc => NON_EXISTENT -- FIXME: -tie ?
}
} ;
Fem => case n of {
Sg => case c of {
Nom => stem + "ta" ;
Gen => stem + "tas" ;
Dat => stem + "tai" ;
Acc => stem + "tu" ;
Loc => stem + "tā" ;
Voc => NON_EXISTENT -- FIXME: -tā ?
} ;
Pl => case c of {
Nom => stem + "tas" ;
Gen => stem + "tu" ;
Dat => stem + "tām" ;
Acc => stem + "tas" ;
Loc => stem + "tās" ;
Voc => NON_EXISTENT -- FIXME: -tās ?
}
}
} ;
mkParticiple_IesUsies : Gender -> Number -> Case -> Str -> Str = \g,n,c,stem ->
case g of {
Masc => case n of {
Sg => case c of {
Nom => stem + "ies" ;
Gen => NON_EXISTENT ;
Dat => NON_EXISTENT ;
Acc => stem + "ušos" ;

View File

@@ -19,6 +19,9 @@ param
-- TODO: pārveidot uz šādu formu lai ir arī apstākļa vārdi kas atvasināti no īpašības vārdiem
AForm = AAdj Degree Definite Gender Number Case | AAdv Degree ;
-- Participles
PartType = IsUsi | TsTa ;
-- Verbs
-- Ind = Indicative
-- Rel = Relative (Latvian specific: http://www.isocat.org/rest/dc/3836)
@@ -32,7 +35,7 @@ param
| Debitive
| Imperative Number
| DebitiveRelative
| Participle Gender Number Case
| Participle PartType Gender Number Case
;
-- TODO: divdabim noteiktā forma un arī pārākā / vispārākā pakāpe

View File

@@ -213,6 +213,7 @@ oper
objNeg = vp.objNeg
} ;
-- FIXME: the type of the participle form - depending on what?! (currently fixed)
buildVerb : Verb -> VerbMood -> Polarity -> Agr -> Bool -> Bool -> Str =
\v,mood,pol,agr,subjNeg,objNeg ->
let
@@ -223,7 +224,7 @@ oper
} ;
agr = fromAgr agr
; --# notpresent
part = v.s ! ResLav.Pos ! (Participle agr.g agr.n Nom) --# notpresent
part = v.s ! ResLav.Pos ! (Participle TsTa agr.g agr.n Nom) --# notpresent
in case mood of {
Ind Simul tense => v.s ! pol_prim ! (Indicative agr.p agr.n tense)
; --# notpresent
@@ -237,7 +238,7 @@ oper
Deb Simul tense => mkVerb_Irreg_Be.s ! pol_prim ! (Indicative P3 Sg tense) ++ --# notpresent
v.s ! ResLav.Pos ! Debitive ; --# notpresent
Deb Anter tense => mkVerb_Irreg_Be.s ! pol_prim ! (Indicative P3 Sg tense) ++ --# notpresent
mkVerb_Irreg_Be.s ! ResLav.Pos ! (Participle Masc Sg Nom) ++ --# notpresent
mkVerb_Irreg_Be.s ! ResLav.Pos ! (Participle TsTa Masc Sg Nom) ++ --# notpresent
v.s ! ResLav.Pos ! Debitive ; --# notpresent
Condit Simul => v.s ! pol_prim ! (Indicative agr.p agr.n ParamX.Cond) ; --# notpresent