From 3148e305d5b6c1088c97551df28aab7eea0b3d4a Mon Sep 17 00:00:00 2001 From: normundsg Date: Mon, 7 Nov 2011 14:21:04 +0000 Subject: [PATCH] More or less complete Latvian RG (by Peteris Paikens and Normunds Gruzitis) --- lib/src/latvian/AdjectiveLav.gf | 43 +- lib/src/latvian/AdverbLav.gf | 24 +- lib/src/latvian/CatLav.gf | 56 +- lib/src/latvian/ConjunctionLav.gf | 31 +- .../latvian/{DictLatAbs.gf => DictLavAbs.gf} | 0 lib/src/latvian/GrammarLav.gf | 4 +- lib/src/latvian/IdiomLav.gf | 62 +- lib/src/latvian/LangLav.gf | 5 +- lib/src/latvian/LexiconLav.gf | 719 +++++++++--------- lib/src/latvian/NounLav.gf | 247 +++--- lib/src/latvian/NumeralLav.gf | 104 +-- lib/src/latvian/ParadigmsAdjectivesLav.gf | 109 ++- lib/src/latvian/ParadigmsLav.gf | 125 ++- lib/src/latvian/ParadigmsNounsLav.gf | 102 ++- lib/src/latvian/ParadigmsPronounsLav.gf | 29 +- lib/src/latvian/ParadigmsVerbsLav.gf | 309 ++++---- lib/src/latvian/PhraseLav.gf | 46 +- lib/src/latvian/QuestionLav.gf | 74 +- lib/src/latvian/RelativeLav.gf | 55 +- lib/src/latvian/ResLav.gf | 46 +- lib/src/latvian/SentenceLav.gf | 115 +-- lib/src/latvian/StructuralLav.gf | 411 ++++++++-- lib/src/latvian/VerbLav.gf | 109 ++- 23 files changed, 1748 insertions(+), 1077 deletions(-) rename lib/src/latvian/{DictLatAbs.gf => DictLavAbs.gf} (100%) diff --git a/lib/src/latvian/AdjectiveLav.gf b/lib/src/latvian/AdjectiveLav.gf index 947351f04..30db48aa9 100644 --- a/lib/src/latvian/AdjectiveLav.gf +++ b/lib/src/latvian/AdjectiveLav.gf @@ -1,7 +1,39 @@ -concrete AdjectiveLav of Adjective = CatLav ** open ResLav, Prelude in { -{- - lin +concrete AdjectiveLav of Adjective = CatLav ** open ResLav, StructuralLav, Prelude in { +flags + coding = utf8 ; + lin + PositA a = { s = \\d,g,n,c => a.s ! (AAdj Posit d g n c) } ; + ComparA a np = { s = \\d,g,n,c => a.s ! (AAdj Compar d g n c) ++ "par" ++ np.s ! Acc ; } | + { s = \\d,g,n,c => a.s ! (AAdj Compar d g n c) ++ "nekā" ++ np.s ! Nom ; }; + UseComparA a = { s = \\d,g,n,c => a.s ! (AAdj Compar d g n c) } ; + + 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) ; + } ; + + ReflA2 a = { + s = \\d,g,n,c => a.s ! (AAdj Posit d g n c) ++ a.p.s ++ reflPron ! (a.p.c ! n) ; + } ; + + AdAP ada ap = { s = \\d,g,n,c => ada.s ++ ap.s ! d ! g ! n ! c ; } ; + + SentAP ap sc = { --FIXME - te vajag apstākļa vārdu nevis īpašības vārdu! Kuru nevar normāli no AP dabūt + s = \\d,g,n,c => ap.s ! d ! g ! n ! c ++ "," ++ sc.s ; + } ; + + AdjOrd ord = { + s = \\d,g,n,c => ord.s ! g ! c ; --FIXME - skaitļa agreement? noteiktība? + } ; + + CAdvAP cadv ap np = { + s = \\d,g,n,c => cadv.s ++ ap.s ! d ! g ! n ! c ++ cadv.p ++ np.s ! Nom ; --TODO nominatīvs var ne vienmēr būt, pie tā CAdv jāliek parametrs par locījumu + } ; + + UseA2 a = { + s = \\d,g,n,c => a.s ! (AAdj Posit d g n c) ; + } ; +{- PositA a = { s = \\_ => a.s ! AAdj Posit Nom ; isPre = True @@ -35,11 +67,6 @@ concrete AdjectiveLav of Adjective = CatLav ** open ResLav, Prelude in { isPre = False } ; - SentAP ap sc = { - s = \\a => ap.s ! a ++ sc.s ; - isPre = False - } ; - AdAP ada ap = { s = \\a => ada.s ++ ap.s ! a ; isPre = ap.isPre diff --git a/lib/src/latvian/AdverbLav.gf b/lib/src/latvian/AdverbLav.gf index 8e003895b..7a45c7065 100644 --- a/lib/src/latvian/AdverbLav.gf +++ b/lib/src/latvian/AdverbLav.gf @@ -1,20 +1,26 @@ concrete AdverbLav of Adverb = CatLav ** open ResLav, Prelude in { -{- + lin - PositAdvAdj a = {s = a.s ! AAdv} ; + + PositAdvAdj a = {s = a.s ! (AAdv Posit)} ; + ComparAdvAdj cadv a np = { - s = cadv.s ++ a.s ! AAdv ++ cadv.p ++ np.s ! Nom + s = cadv.s ++ a.s ! (AAdv cadv.d) ++ cadv.p ++ np.s ! Nom -- TODO vajag ar 'trks par Jni' un 'trks nek Jnis' pie more_CAdv + -- TODO - vai te tiem veido 'trk par Jni', kas ir pareizais adverbs? nevis 'trks par jni'... } ; ComparAdvAdjS cadv a s = { - s = cadv.s ++ a.s ! AAdv ++ cadv.p ++ s.s - } ; + s = cadv.s ++ a.s ! (AAdv cadv.d) ++ cadv.p ++ s.s + } ; - PrepNP prep np = {s = prep.s ++ np.s ! Acc} ; + PrepNP prep np = {s = prep.s ++ np.s ! (prep.c ! (fromAgr np.a).n)} ; --FIXME - postpozcijas prievrdi AdAdv = cc2 ; - SubjS = cc2 ; - AdnCAdv cadv = {s = cadv.s ++ cadv.p} ; --} + AdnCAdv cadv = { + s = case cadv.d of { + Posit => cadv.s ++ cadv.p; + _ => NON_EXISTENT + } + }; } diff --git a/lib/src/latvian/CatLav.gf b/lib/src/latvian/CatLav.gf index 5e177977d..bc73336fa 100644 --- a/lib/src/latvian/CatLav.gf +++ b/lib/src/latvian/CatLav.gf @@ -1,22 +1,61 @@ -concrete CatLav of Cat = CommonX ** open ResLav, Prelude in { +concrete CatLav of Cat = CommonX - [CAdv, Voc] ** open ResLav, Prelude in { flags optimize=all_subs ; lincat + S = {s : Str} ; + QS = {s : Str} ; + RS = {s : Agr => Str} ; -- ; c : Case c for it clefts + SSlash = {s : Str; p : Prep}; + N = {s : Number => Case => Str ; g : Gender} ; - A = {s : Degree => Definite => Gender => Number => Case => Str} ; - V = {s : Polarity => VerbForm => Str} ; - V2 = V ; -- ** {c : ResLav.Case} - valence - + N2 = {s : Number => Case => Str ; g : Gender} ** {p : Prep; isPre : Bool}; -- case / preposition used. if isPre, then located before the noun. + N3 = {s : Number => Case => Str ; g : Gender} ** {p1,p2 : Prep; isPre1, isPre2 : Bool}; + PN = {s : Case => Str ; g : Gender; n : Number} ; + A = {s : AForm => Str }; + A2 = A ** {p : Prep}; + V, VQ, VA, VV = Verb ; + VS = Verb ** {subj : Subj} ; + V2, V2A, V2Q, V2V = Verb ** {p : Prep} ; -- TODO - valence, pieemam ka viena; btu jnorda semantika - integrt ar FrameNet? + V2S = Verb ** {p : Prep; subj : Subj} ; + V3 = Verb ** {p1, p2 : Prep} ; + Pron = {s : Case => Str ; a : ResLav.Agr; possessive : Gender => Number => Case => Str} ; + Conj = {s1,s2 : Str ; n : Number} ; + Subj = {s : Str} ; + Prep = {s : Str; c : Number => Case} ; -- e.g. 'ar' + Sg-Acc or Pl-Dat; Preposition may be empty [] for simple case-based valences + -- TODO - pozcija nav noteikta; dai ir pirms dai pc + Cl = {s : VerbMood => Polarity => Str} ; + ClSlash = {s : VerbMood => Polarity => Str; p : Prep}; + + Imp = {s : Polarity => Number => Str} ; + + QCl = {s : VerbMood => Polarity => Str} ; + IP = {s : Case => Str; n: Number }; + IQuant = {s : Gender => Number => Str} ; + IDet = {s : Gender => Str ; n : Number} ; + + RCl = {s : VerbMood => Polarity => Agr => Str} ; + RP = {s : Case => Str} ; CN = {s : Definite => Number => Case => Str ; g : Gender} ; Det = {s : Gender => Case => Str ; n : Number ; d: Definite} ; - NP = {s : Case => Str ; g : Gender ; n : Number; p : Person} ; - VP = {v : V ; obj : ResLav.Agr => Str} ; ---TODO - ar Quant jpieliek + Predet = {s : Gender => Str} ; + Quant = {s : Gender => Number => Case => Str ; d: Definite} ; + Card = { s : Gender => Case => Str ; n: Number} ; + Ord = { s : Gender => Case => Str } ; + NP = {s : Case => Str ; a : ResLav.Agr} ; + AP = {s : Definite => Gender => Number => Case => Str} ; + VP = ResLav.VP; + VPSlash = VP ** {p : Prep}; + Comp = {s : ResLav.Agr => Str} ; + Num = {s : Gender => Case => Str ; n : Number ; hasCard : Bool} ; + Numeral = {s : CardOrd => Gender => Case => Str ; n : Number} ; + Digits = {s : CardOrd => Str ; n : Number} ; + + CAdv = { s : Str; p : Str; d: Degree } ; {- -- Tensed/Untensed @@ -48,7 +87,6 @@ concrete CatLav of Cat = CommonX ** open ResLav, Prelude in { s : ResEng.Tense => Anteriority => CPolarity => Agr => Str ; c : Case } ; - RP = {s : RCase => Str ; a : RAgr} ; -- Verb diff --git a/lib/src/latvian/ConjunctionLav.gf b/lib/src/latvian/ConjunctionLav.gf index ac2e95289..552ac0145 100644 --- a/lib/src/latvian/ConjunctionLav.gf +++ b/lib/src/latvian/ConjunctionLav.gf @@ -1,6 +1,6 @@ concrete ConjunctionLav of Conjunction = CatLav ** open ResLav, Coordination, Prelude in { -{- + flags optimize=all_subs ; lin @@ -10,16 +10,12 @@ concrete ConjunctionLav of Conjunction = ConjAdv = conjunctDistrSS ; ConjNP conj ss = conjunctDistrTable Case conj ss ** { - a = conjAgr (agrP3 conj.n) ss.a - } ; + a = toAgr (conjNumber (fromAgr ss.a).n conj.n) (fromAgr ss.a).p (fromAgr ss.a).g + } ; - ConjAP conj ss = conjunctDistrTable Agr conj ss ** { - isPre = ss.isPre - } ; + ConjAP conj ss = conjunctDistrTable4 Definite Gender Number Case conj ss; - ConjRS conj ss = conjunctDistrTable Agr conj ss ** { - c = ss.c - } ; + ConjRS conj ss = conjunctDistrTable Agr conj ss; -- These fun's are generated from the list cat's. @@ -27,18 +23,21 @@ concrete ConjunctionLav of Conjunction = ConsS = consrSS comma ; BaseAdv = twoSS ; ConsAdv = consrSS comma ; + BaseNP x y = twoTable Case x y ** {a = conjAgr x.a y.a} ; ConsNP xs x = consrTable Case comma xs x ** {a = conjAgr xs.a x.a} ; - BaseAP x y = twoTable Agr x y ** {isPre = andB x.isPre y.isPre} ; - ConsAP xs x = consrTable Agr comma xs x ** {isPre = andB xs.isPre x.isPre} ; - BaseRS x y = twoTable Agr x y ** {c = y.c} ; - ConsRS xs x = consrTable Agr comma xs x ** {c = xs.c} ; + + BaseAP x y = twoTable4 Definite Gender Number Case x y ; + ConsAP xs x = consrTable4 Definite Gender Number Case comma xs x ; + + BaseRS x y = twoTable Agr x y ; + ConsRS xs x = consrTable Agr comma xs x ; lincat [S] = {s1,s2 : Str} ; [Adv] = {s1,s2 : Str} ; [NP] = {s1,s2 : Case => Str ; a : Agr} ; - [AP] = {s1,s2 : Agr => Str ; isPre : Bool} ; - [RS] = {s1,s2 : Agr => Str ; c : Case} ; --} + [AP] = {s1,s2 : Definite => Gender => Number => Case => Str } ; + [RS] = {s1,s2 : Agr => Str } ; + } diff --git a/lib/src/latvian/DictLatAbs.gf b/lib/src/latvian/DictLavAbs.gf similarity index 100% rename from lib/src/latvian/DictLatAbs.gf rename to lib/src/latvian/DictLavAbs.gf diff --git a/lib/src/latvian/GrammarLav.gf b/lib/src/latvian/GrammarLav.gf index ba9d7213d..a46fb10a8 100644 --- a/lib/src/latvian/GrammarLav.gf +++ b/lib/src/latvian/GrammarLav.gf @@ -11,10 +11,10 @@ concrete GrammarLav of Grammar = RelativeLav, ConjunctionLav, PhraseLav, - TextX, + TextX - [CAdv], StructuralLav, IdiomLav, - TenseX + TenseX - [CAdv] ** { flags startcat = Phr ; unlexer = text ; lexer = text ; diff --git a/lib/src/latvian/IdiomLav.gf b/lib/src/latvian/IdiomLav.gf index bd2591571..6fee62352 100644 --- a/lib/src/latvian/IdiomLav.gf +++ b/lib/src/latvian/IdiomLav.gf @@ -1,9 +1,65 @@ -concrete IdiomLav of Idiom = CatLav ** open Prelude, ResLav in { -{- - flags optimize=all_subs ; +concrete IdiomLav of Idiom = CatLav ** open Prelude, ResLav, VerbLav, ParadigmsVerbsLav in { +flags optimize=all_subs ; lin + ImpersCl vp = let + a = AgP3 Sg Masc + in{ + s = \\mood,pol => + buildVerb vp.v mood pol a ++ -- Verb + vp.s2 ! a -- Object(s), complements, adverbial modifiers; + } ; + + GenericCl vp = let + a = AgP3 Sg Masc + in{ + s = \\mood,pol => + buildVerb vp.v mood pol a ++ -- Verb + vp.s2 ! a -- Object(s), complements, adverbial modifiers; + } ; + + ExistNP np = let + v = lin V mkVerb_toBe; + a = np.a + in { + s = \\mood,pol => + buildVerb v mood pol a ++ -- Verb + np.s ! Nom + } ; + + ExistIP ip = let + v = lin V mkVerb_toBe; + a = AgP3 ip.n Masc + in { + s = \\mood,pol => + ip.s ! Nom ++ + buildVerb v mood pol a -- Verb + } ; + + ProgrVP v = v; -- FIXME - needs restriction so that only VerbMood Indicative _ _ Present is allowed; but can't do that on VP level.. + + ImpPl1 vp = let + a = AgP1 Pl + in { + s = + vp.v.s ! Pos ! (Indicative P1 Pl Pres) ++ -- Verb + vp.s2 ! a -- Object(s), complements, adverbial modifiers; + } | { + s = + vp.v.s ! Pos ! (Indicative P1 Pl Fut) ++ -- Verb + vp.s2 ! a -- Object(s), complements, adverbial modifiers; + }; + + ImpP3 np vp = { + s = "lai" ++ np.s ! Nom ++ buildVerb vp.v (Ind Simul Pres) Pos np.a ++ vp.s2 ! np.a; + }; + + --FIXME placeholder + CleftNP np rs = { s = \\_,_ => NON_EXISTENT } ; + CleftAdv ad s = { s = \\_,_ => NON_EXISTENT } ; +{- ImpersCl vp = mkClause "it" (agrP3 Sg) vp ; + GenericCl vp = mkClause "one" (agrP3 Sg) vp ; CleftNP np rs = mkClause "it" (agrP3 Sg) diff --git a/lib/src/latvian/LangLav.gf b/lib/src/latvian/LangLav.gf index 373c65aab..a5b7e2373 100644 --- a/lib/src/latvian/LangLav.gf +++ b/lib/src/latvian/LangLav.gf @@ -5,6 +5,9 @@ concrete LangLav of Lang = LexiconLav ** { -flags startcat = Phr ; unlexer = text ; lexer = text ; +flags + startcat = Phr ; + unlexer = text ; + lexer = text ; } ; diff --git a/lib/src/latvian/LexiconLav.gf b/lib/src/latvian/LexiconLav.gf index b512c7291..4c857068d 100644 --- a/lib/src/latvian/LexiconLav.gf +++ b/lib/src/latvian/LexiconLav.gf @@ -1,381 +1,382 @@ --# -path=.:prelude -concrete LexiconLav of Lexicon = CatLav ** - open ParadigmsLav, IrregLav, Prelude in { +concrete LexiconLav of Lexicon = CatLav ** open + ParadigmsLav, + StructuralLav, + ResLav, + Prelude + in { flags - optimize=values ; + optimize = values ; coding = utf8 ; lin airplane_N = mkN "lidmašīna" ; - come_V = mkV "nākt" "nāku" "nācu" ; + answer_V2S = mkV2S (mkV "atbildēt" third_conjugation) dat_Prep that_Subj ; -- toP = 'answer to [Person]' = 'atbildēt [kam?]' + apartment_N = mkN "dzīvoklis" ; + apple_N = mkN "ābols" ; + art_N = mkN "māksla" ; + ask_V2Q = mkV2Q (mkV "vaicāt" second_conjugation) dat_Prep ; + baby_N = mkN "bērns" ; bad_A = mkA "slikts" ; - - walk_V = mkV "doties" "dodos" "devos" ; --- please_V2 = mkV "priecēt" second_conjugation ; - love_V2 = mkV "mīlēt" third_conjugation ; --- say_V = mkV "sacīt" third_conjugation ; --- be_V = mkV "būt" ; + bank_N = mkN "banka" ; + beautiful_A = mkA "skaists" ; + become_VA = mkVA (mkV "kļūt" "kļūstu" "kļuvu") ; + beer_N = mkN "alus" ; + beg_V2V = mkV2V (mkV "lūgt" "lūdzu" "lūdzu") acc_Prep ; + big_A = mkA "liels" ; + bike_N = mkN "divritenis" ; + bird_N = mkN "putns" ; + black_A = mkA "melns" ; + blue_A = mkA "zils" ; + boat_N = mkN "laiva" ; + book_N = mkN "grāmata" ; + boot_N = mkN "zābaks" ; + boss_N = mkN "boss" ; + boy_N = mkN "puika" ; + bread_N = mkN "maize" ; + break_V2 = mkV2 (mkV "lauzt" "laužu" "lauzu") acc_Prep ; + broad_A = mkA "plats" ; + brother_N2 = mkN2 (mkN "brālis") gen_Prep True; -- Ģenitīvs nav kā piederība, bet kā relācija: "Jāņa/tēva brālis", bet ne "mans brālis" (?) + brown_A = mkA "brūns" ; + butter_N = mkN "sviests" ; + buy_V2 = mkV2 (mkV "pirkt" "pērku" "pirku") acc_Prep ; + camera_N = mkN "fotoaparāts" ; + cap_N = mkN "cepure" ; + car_N = mkN "automašīna" ; + carpet_N = mkN "paklājs" ; + cat_N = mkN "kaķis" ; + ceiling_N = mkN "griesti" ; + chair_N = mkN "krēsls" ; + cheese_N = mkN "siers" ; + child_N = mkN "bērns" ; + church_N = mkN "baznīca" ; + city_N = mkN "pilsēta" ; + clean_A = mkA "tīrs" ; + clever_A = mkA "gudrs" ; + close_V2 = mkV2 (mkV "aizvērt" "aizveru" "aizvēru") acc_Prep; + coat_N = mkN "mētelis" ; + cold_A = mkA "auksts" ; + come_V = mkV "nākt" "nāku" "nācu" ; + computer_N = mkN "dators" ; + country_N = mkN "valsts" ; + cousin_N = mkN "brālēns" ; --FIXME - brālēns / māsīca angļiem ir vienāds... + cow_N = mkN "govs" ; + die_V = mkV "nomirt" "nomirstu" "nomiru"; + dirty_A = mkA "netīrs" ; + distance_N3 = mkN3 (mkN "attālums") from_Prep to_Prep ; -- no / līdz + doctor_N = mkN "ārsts" ; + dog_N = mkN "suns" ; + door_N = mkN "durvis" ; + drink_V2 = mkV2 (mkV "dzert" "dzeru" "dzēru") acc_Prep; +{- + easy_A2V = mkA2V (regA "easy") forP ; -- FIXME - nu nav tādas konstrukcijas latviešu val +-} + eat_V2 = mkV2 (mkV "ēst" "ēdu" "ēdu") acc_Prep; + empty_A = mkA "tukšs" ; + enemy_N = mkN "ienaidnieks" ; + factory_N = mkN "rūpnīca" ; + father_N2 = mkN2 (mkN "tēvs") gen_Prep True ; + fear_VS = mkVS (mkV "baidīties" third_conjugation) that_Subj; + find_V2 = mkV2 (mkV "atrast" "atrodi" "atradu") acc_Prep; + fish_N = mkN "zivs" ; + floor_N = mkN "grīda" ; + forget_V2 = mkV2 (mkV "aizmirst" "aizmirstu" "aizmirsu") acc_Prep; + fridge_N = mkN "ledusskapis" ; + friend_N = mkN "draugs" ; + fruit_N = mkN "auglis" ; + fun_AV = mkAV (mkA "priecīgs") ; + garden_N = mkN "dārzs" ; + girl_N = mkN "meitene" ; + glove_N = mkN "cimds" ; + gold_N = mkN "zelts" ; + good_A = mkA "labs" ; + go_V = mkV "iet" ; + green_A = mkA "zaļš" ; + harbour_N = mkN "osta" ; + hate_V2 = mkV2 (mkV "ienīst" "ienīstu" "ienīdu") acc_Prep; + hat_N = mkN "cepure" ; + hear_V2 = mkV2 (mkV "dzirdēt" third_conjugation) acc_Prep; + hill_N = mkN "kalns" ; + hope_VS = mkVS (mkV "cerēt" third_conjugation) that_Subj; + horse_N = mkN "zirgs" ; + hot_A = mkA "karsts" ; + house_N = mkN "māja" ; + important_A = mkA "svarīgs" ; + industry_N = mkN "industrija" ; + iron_N = mkN "dzelzs" ; + king_N = mkN "karalis" ; + know_V2 = mkV2 (mkV "zināt" third_conjugation) acc_Prep; -- FIXME - šitādas lietas jārisina ar valencēm nevis 2 vienādiem vārdiem + know_VS = mkVS (mkV "zināt" third_conjugation) that_Subj; + lake_N = mkN "ezers" ; + lamp_N = mkN "lampa" ; + learn_V2 = mkV2 (mkV "mācīties" third_conjugation) acc_Prep; + leather_N = mkN "āda" ; + leave_V2 = mkV2 (mkV "atstāt" "atstāju" "atstāju") acc_Prep; +{- + like_V2 = mkV2 (regV "like") ; +-} + listen_V2 = mkV2 (mkV "klausīties" third_conjugation) acc_Prep ; + live_V = mkV "dzīvot" second_conjugation ; + long_A = mkA "garš" ; + lose_V2 = mkV2 (mkV "pazaudēt" second_conjugation) acc_Prep; + 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 ; + meat_N = mkN "gaļa" ; + milk_N = mkN "piens" ; + moon_N = mkN "mēness" ; + mother_N2 = mkN2 (mkN "māte") gen_Prep True; + mountain_N = mkN "kalns" ; + music_N = mkN "mūzika" ; + narrow_A = mkA "šaurs" ; + new_A = mkA "jauns" ; + newspaper_N = mkN "avīze" ; + oil_N = mkN "eļļa" ; -- reku parādās klasiskās problēmas - eļļa vai nafta? + old_A = mkA "vecs" ; + open_V2 = mkV2 (mkV "atvērt" "atveru" "atvēru") acc_Prep; + paint_V2A = mkV2A (mkV "krāsot" second_conjugation) acc_Prep ; + paper_N = mkN "papīrs" ; + paris_PN = mkPN "Parīze" ; + peace_N = mkN "miers" ; + pen_N = mkN "pildspalva" ; + planet_N = mkN "planēta" ; + plastic_N = mkN "plastmasa" ; + play_V2 = mkV2 (mkV "spēlēt" second_conjugation) acc_Prep; + policeman_N = mkN "policists" ; + priest_N = mkN "mācītājs" ; + probable_AS = mkAS (mkA "iespējams") ; + queen_N = mkN "karaliene" ; + radio_N = mkN "radio" ; +{- rain_V0 = mkV0 (regV "rain") ; -} + read_V2 = mkV2 (mkV "lasīt" third_conjugation) acc_Prep; + red_A = mkA "sarkans" ; + religion_N = mkN "reliģija" ; + restaurant_N = mkN "restorāns" ; + river_N = mkN "upe" ; + rock_N = mkN "akmens" ; + roof_N = mkN "jumts" ; + rubber_N = mkN "gumija" ; + run_V = mkV "skriet" "skrienu" "skrēju" ; + say_VS = mkVS (mkV "sacīt" third_conjugation) that_Subj; + school_N = mkN "skola" ; + science_N = mkN "zinātne" ; + sea_N = mkN "jūra" ; + seek_V2 = mkV2 (mkV "meklēt" second_conjugation) acc_Prep; + see_V2 = mkV2 (mkV "redzēt" third_conjugation) acc_Prep; + sell_V3 = mkV3 (mkV "pārdot" "pārdodu" "pārdevu") acc_Prep dat_Prep ; + send_V3 = mkV3 (mkV "sūtīt" third_conjugation) acc_Prep dat_Prep; + sheep_N = mkN "aita" ; + ship_N = mkN "kuģis" ; + shirt_N = mkN "krekls" ; + shoe_N = mkN "kurpe" ; + shop_N = mkN "veikals" ; + short_A = mkA "īss" ; + silver_N = mkN "sudrabs" ; + sister_N = mkN "māsa" ; --TODO kāpēc nav kā brālis ar parametru? + sleep_V = mkV "gulēt"; + small_A = mkA "mazs" ; + snake_N = mkN "čūska" ; + sock_N = mkN "zeķe" ; + speak_V2 = mkV2 (mkV "sacīt" third_conjugation) acc_Prep; --TODO - citas valences tur tak + star_N = mkN "zvaigzne" ; + steel_N = mkN "tērauds" ; + stone_N = mkN "akmens" ; + stove_N = mkN "plīts" ; + student_N = mkN "students" ; + stupid_A = mkA "dumjš" ; + sun_N = mkN "saule" ; + switch8off_V2 = mkV2 (mkV "izslēgt" "izslēdzu" "izslēdzu") acc_Prep; + switch8on_V2 = mkV2 (mkV "ieslēgt" "ieslēdzu" "ieslēdzu") acc_Prep; + table_N = mkN "galds" ; + talk_V3 = mkV3 (mkV "runāt" second_conjugation) to_Prep par_Prep ; --ar ko, par ko + teacher_N = mkN "skolotājs" ; + teach_V2 = mkV2 (mkV "mācīt" third_conjugation) acc_Prep; + television_N = mkN "televīzija" ; + thick_A = mkA "biezs" ; + thin_A = mkA "plāns" ; + train_N = mkN "vilciens" ; + travel_V = mkV "ceļot" second_conjugation; + tree_N = mkN "koks" ; + --trousers_N = mkN "bikses" ; + ugly_A = mkA "neglīts" ; + understand_V2 = mkV2 (mkV "saprast" "saprotu" "sapratu") acc_Prep; + university_N = mkN "universitāte" ; + village_N = mkN "village" ; + wait_V2 = mkV2 (mkV "gaidīt" third_conjugation) acc_Prep ; + walk_V = mkV "staigāt" second_conjugation ; + warm_A = mkA "silts" ; + war_N = mkN "karš" ; + watch_V2 = mkV2 (mkV "skatīties" third_conjugation) acc_Prep; + water_N = mkN "ūdens" ; + white_A = mkA "balts" ; + window_N = mkN "logs" ; + wine_N = mkN "vīns" ; + win_V2 = mkV2 (mkV "uzvarēt" third_conjugation) acc_Prep; + woman_N = mkN "sieviete" ; + wonder_VQ = mkVQ (mkV "brīnīties" third_conjugation) ; + wood_N = mkN "koks" ; + write_V2 = mkV2 (mkV "rakstīt" third_conjugation) acc_Prep; + yellow_A = mkA "dzeltens" ; + young_A = mkA "jauns" ; + do_V2 = mkV2 (mkV "darīt" third_conjugation) acc_Prep; + now_Adv = mkAdv "tagad" ; + already_Adv = mkAdv "jau" ; + song_N = mkN "dziesma" ; + add_V3 = mkV3 (mkV "pielikt" "pielieku" "pieliku") acc_Prep dat_Prep ; + number_N = mkN "skaitlis" ; + put_V2 = mkV2 (mkV "likt" "lieku" "liku") acc_Prep ; + stop_V = mkV "apstāties" "apstājos" "apstājos"; + jump_V = mkV "lēkt" "lecu" "lēcu" ; {- - answer_V2S = mkV2S (mkV "answer" "answered") toP ; - apartment_N = regN "apartment" ; - apple_N = regN "apple" ; - art_N = regN "art" ; - ask_V2Q = mkV2Q (regV "ask") noPrep ; - baby_N = regN "baby" ; - bad_A = mkADeg "bad" "worse" "worst" "badly" ; - bank_N = regN "bank" ; - beautiful_A = compoundADeg (regA "beautiful") ; - become_VA = mkVA (irregV "become" "became" "become") ; - beer_N = regN "beer" ; - beg_V2V = mkV2V (regDuplV "beg") noPrep toP ; - big_A = duplADeg "big" ; - bike_N = regN "bike" ; - bird_N = regN "bird" ; - black_A = regADeg "black" ; - blue_A = regADeg "blue" ; - boat_N = regN "boat" ; - book_N = regN "book" ; - boot_N = regN "boot" ; - boss_N = mkN human (regN "boss") ; - boy_N = mkN masculine (regN "boy") ; - bread_N = regN "bread" ; - break_V2 = dirV2 (irregV "break" "broke" "broken") ; - broad_A = regADeg "broad" ; - brother_N2 = mkN2 (mkN masculine (mkN "brother")) (mkPrep "of") ; - brown_A = regADeg "brown" ; - butter_N = regN "butter" ; - buy_V2 = dirV2 (irregV "buy" "bought" "bought") ; - camera_N = regN "camera" ; - cap_N = regN "cap" ; - car_N = regN "car" ; - carpet_N = regN "carpet" ; - cat_N = regN "cat" ; - ceiling_N = regN "ceiling" ; - chair_N = regN "chair" ; - cheese_N = regN "cheese" ; - child_N = mk2N "child" "children" ; - church_N = regN "church" ; - city_N = regN "city" ; - clean_A = regADeg "clean" ; - clever_A = mkA "clever" "cleverer" ; - close_V2 = dirV2 (regV "close") ; - coat_N = regN "coat" ; - cold_A = regADeg "cold" ; - come_V = (irregV "come" "came" "come") ; - computer_N = regN "computer" ; - country_N = regN "country" ; - cousin_N = mkN human (regN "cousin") ; - cow_N = regN "cow" ; - die_V = (regV "die") ; - dirty_A = regADeg "dirty" ; - distance_N3 = mkN3 (regN "distance") fromP toP ; - doctor_N = mkN human (regN "doctor") ; - dog_N = regN "dog" ; - door_N = regN "door" ; - drink_V2 = dirV2 (irregV "drink" "drank" "drunk") ; - easy_A2V = mkA2V (regA "easy") forP ; - eat_V2 = dirV2 (irregV "eat" "ate" "eaten") ; - empty_A = regADeg "empty" ; - enemy_N = regN "enemy" ; - factory_N = regN "factory" ; - father_N2 = mkN2 (mkN masculine (mkN "father")) (mkPrep "of") ; - fear_VS = mkVS (regV "fear") ; - find_V2 = dirV2 (irregV "find" "found" "found") ; - fish_N = mk2N "fish" "fish" ; - floor_N = regN "floor" ; - forget_V2 = dirV2 (irregDuplV "forget" "forgot" "forgotten") ; - fridge_N = regN "fridge" ; - friend_N = mkN human (regN "friend") ; - fruit_N = regN "fruit" ; - fun_AV = mkAV (regA "fun") ; - garden_N = regN "garden" ; - girl_N = mkN feminine (regN "girl") ; - glove_N = regN "glove" ; - gold_N = regN "gold" ; - good_A = mkADeg "good" "better" "best" "well" ; - go_V = mk5V "go" "goes" "went" "gone" "going" ; - green_A = regADeg "green" ; - harbour_N = regN "harbour" ; - hate_V2 = dirV2 (regV "hate") ; - hat_N = regN "hat" ; - hear_V2 = dirV2 (irregV "hear" "heard" "heard") ; - hill_N = regN "hill" ; - hope_VS = mkVS (regV "hope") ; - horse_N = regN "horse" ; - hot_A = duplADeg "hot" ; - house_N = regN "house" ; - important_A = compoundADeg (regA "important") ; - industry_N = regN "industry" ; - iron_N = regN "iron" ; - king_N = mkN masculine (regN "king") ; - know_V2 = dirV2 (irregV "know" "knew" "known") ; - know_VS = mkVS (irregV "know" "knew" "known") ; - lake_N = regN "lake" ; - lamp_N = regN "lamp" ; - learn_V2 = dirV2 (regV "learn") ; - leather_N = regN "leather" ; - leave_V2 = dirV2 (irregV "leave" "left" "left") ; - like_V2 = dirV2 (regV "like") ; - listen_V2 = prepV2 (regV "listen") toP ; - live_V = (regV "live") ; - long_A = regADeg "long" ; - lose_V2 = dirV2 (irregV "lose" "lost" "lost") ; - love_N = regN "love" ; - love_V2 = dirV2 (regV "love") ; - man_N = mkN masculine (mk2N "man" "men") ; - married_A2 = mkA2 (regA "married") toP ; - meat_N = regN "meat" ; - milk_N = regN "milk" ; - moon_N = regN "moon" ; - mother_N2 = mkN2 (mkN feminine (mkN "mother")) (mkPrep "of") ; - mountain_N = regN "mountain" ; - music_N = regN "music" ; - narrow_A = regADeg "narrow" ; - new_A = regADeg "new" ; - newspaper_N = regN "newspaper" ; - oil_N = regN "oil" ; - old_A = regADeg "old" ; - open_V2 = dirV2 (regV "open") ; - paint_V2A = mkV2A (regV "paint") noPrep ; - paper_N = regN "paper" ; - paris_PN = mkPN (mkN nonhuman (mkN "Paris")) ; - peace_N = regN "peace" ; - pen_N = regN "pen" ; - planet_N = regN "planet" ; - plastic_N = regN "plastic" ; - play_V2 = dirV2 (regV "play") ; - policeman_N = mkN masculine (mkN "policeman" "policemen") ; - priest_N = mkN human (regN "priest") ; - probable_AS = mkAS (regA "probable") ; - queen_N = mkN feminine (regN "queen") ; - radio_N = regN "radio" ; - rain_V0 = mkV0 (regV "rain") ; - read_V2 = dirV2 (irregV "read" "read" "read") ; - red_A = duplADeg "red" ; - religion_N = regN "religion" ; - restaurant_N = regN "restaurant" ; - river_N = regN "river" ; - rock_N = regN "rock" ; - roof_N = regN "roof" ; - rubber_N = regN "rubber" ; - run_V = (irregDuplV "run" "ran" "run") ; - say_VS = mkVS (irregV "say" "said" "said") ; - school_N = regN "school" ; - science_N = regN "science" ; - sea_N = regN "sea" ; - seek_V2 = dirV2 (irregV "seek" "sought" "sought") ; - see_V2 = dirV2 (irregV "see" "saw" "seen") ; - sell_V3 = dirV3 (irregV "sell" "sold" "sold") toP ; - send_V3 = dirV3 (irregV "send" "sent" "sent") toP ; - sheep_N = mk2N "sheep" "sheep" ; - ship_N = regN "ship" ; - shirt_N = regN "shirt" ; - shoe_N = regN "shoe" ; - shop_N = regN "shop" ; - short_A = regADeg "short" ; - silver_N = regN "silver" ; - sister_N = mkN feminine (mkN "sister") ; - sleep_V = (irregV "sleep" "slept" "slept") ; - small_A = regADeg "small" ; - snake_N = regN "snake" ; - sock_N = regN "sock" ; - speak_V2 = dirV2 (irregV "speak" "spoke" "spoken") ; - star_N = regN "star" ; - steel_N = regN "steel" ; - stone_N = regN "stone" ; - stove_N = regN "stove" ; - student_N = mkN human (regN "student") ; - stupid_A = mkA "stupid" ; - sun_N = regN "sun" ; - switch8off_V2 = dirV2 (partV (regV "switch") "off") ; - switch8on_V2 = dirV2 (partV (regV "switch") "on") ; - table_N = regN "table" ; - talk_V3 = mkV3 (regV "talk") toP aboutP ; - teacher_N = mkN human (regN "teacher") ; - teach_V2 = dirV2 (irregV "teach" "taught" "taught") ; - television_N = regN "television" ; - thick_A = regADeg "thick" ; - thin_A = duplADeg "thin" ; - train_N = regN "train" ; - travel_V = (regDuplV "travel") ; - tree_N = regN "tree" ; - ---- trousers_N = regN "trousers" ; - ugly_A = mkA "ugly" ; - understand_V2 = dirV2 (irregV "understand" "understood" "understood") ; - university_N = regN "university" ; - village_N = regN "village" ; - wait_V2 = prepV2 (regV "wait") forP ; - walk_V = (regV "walk") ; - warm_A = regADeg "warm" ; - war_N = regN "war" ; - watch_V2 = dirV2 (regV "watch") ; - water_N = regN "water" ; - white_A = mkA "white" ; - window_N = regN "window" ; - wine_N = regN "wine" ; - win_V2 = dirV2 (irregDuplV "win" "won" "won") ; - woman_N = mkN feminine (mk2N "woman" "women") ; - wonder_VQ = mkVQ (mkV "wonder" "wondered") ; - wood_N = regN "wood" ; - write_V2 = dirV2 (irregV "write" "wrote" "written") ; - yellow_A = mkA "yellow" ; - young_A = regADeg "young" ; - - do_V2 = dirV2 (mk5V "do" "does" "did" "done" "doing") ; - now_Adv = mkAdv "now" ; - already_Adv = mkAdv "already" ; - song_N = regN "song" ; - add_V3 = dirV3 (regV "add") toP ; - number_N = regN "number" ; - put_V2 = prepV2 (irregDuplV "put" "put" "put") noPrep ; - stop_V = regDuplV "stop" ; - jump_V = regV "jump" ; - left_Ord = mkOrd "left" ; - right_Ord = mkOrd "right" ; - far_Adv = mkAdv "far" ; - correct_A = (regA "correct") ; - dry_A = regA "dry" ; - dull_A = regA "dull" ; - full_A = regA "full" ; - heavy_A = regA "heavy" ; - near_A = regA "near" ; - rotten_A = (regA "rotten") ; - round_A = regA "round" ; - sharp_A = regA "sharp" ; - smooth_A = regA "smooth" ; - straight_A = regA "straight" ; - wet_A = regA "wet" ; ---- - wide_A = regA "wide" ; - animal_N = regN "animal" ; - ashes_N = regN "ash" ; -- FIXME: plural only? - back_N = regN "back" ; - bark_N = regN "bark" ; - belly_N = regN "belly" ; - blood_N = regN "blood" ; - bone_N = regN "bone" ; - breast_N = regN "breast" ; - cloud_N = regN "cloud" ; - day_N = regN "day" ; - dust_N = regN "dust" ; - ear_N = regN "ear" ; - earth_N = regN "earth" ; - egg_N = regN "egg" ; - eye_N = regN "eye" ; - fat_N = regN "fat" ; - feather_N = regN "feather" ; - fingernail_N = regN "fingernail" ; - fire_N = regN "fire" ; - flower_N = regN "flower" ; - fog_N = regN "fog" ; - foot_N = mk2N "foot" "feet" ; - forest_N = regN "forest" ; - grass_N = regN "grass" ; - guts_N = regN "gut" ; -- FIXME: no singular - hair_N = regN "hair" ; - hand_N = regN "hand" ; - head_N = regN "head" ; - heart_N = regN "heart" ; - horn_N = regN "horn" ; - husband_N = mkN masculine (regN "husband") ; - ice_N = regN "ice" ; - knee_N = regN "knee" ; - leaf_N = mk2N "leaf" "leaves" ; - leg_N = regN "leg" ; - liver_N = regN "liver" ; - louse_N = mk2N "louse" "lice" ; - mouth_N = regN "mouth" ; - name_N = regN "name" ; - neck_N = regN "neck" ; - night_N = regN "night" ; - nose_N = regN "nose" ; - person_N = mkN human (regN "person") ; - rain_N = regN "rain" ; - road_N = regN "road" ; - root_N = regN "root" ; - rope_N = regN "rope" ; - salt_N = regN "salt" ; - sand_N = regN "sand" ; - seed_N = regN "seed" ; - skin_N = regN "skin" ; - sky_N = regN "sky" ; - smoke_N = regN "smoke" ; - snow_N = regN "snow" ; - stick_N = regN "stick" ; - tail_N = regN "tail" ; - tongue_N = regN "tongue" ; - tooth_N = mk2N "tooth" "teeth" ; - wife_N = mkN feminine (mk2N "wife" "wives") ; - wind_N = regN "wind" ; - wing_N = regN "wing" ; - worm_N = regN "worm" ; - year_N = regN "year" ; - blow_V = IrregEng.blow_V ; - breathe_V = dirV2 (regV "breathe") ; - burn_V = IrregEng.burn_V ; - dig_V = IrregEng.dig_V ; - fall_V = IrregEng.fall_V ; - float_V = regV "float" ; - flow_V = regV "flow" ; - fly_V = IrregEng.fly_V ; - freeze_V = IrregEng.freeze_V ; - give_V3 = dirV3 give_V toP ; - laugh_V = regV "laugh" ; - lie_V = IrregEng.lie_V ; - play_V = regV "play" ; - sew_V = IrregEng.sew_V ; - sing_V = IrregEng.sing_V ; - sit_V = IrregEng.sit_V ; - smell_V = regV "smell" ; - spit_V = IrregEng.spit_V ; - stand_V = IrregEng.stand_V ; - swell_V = IrregEng.swell_V ; - swim_V = IrregEng.swim_V ; - think_V = IrregEng.think_V ; - turn_V = regV "turn" ; - vomit_V = mkV "vomit" "vomited" ; + right_Ord = mkOrd "right" ; -} + far_Adv = mkAdv "tālu" ; + correct_A = mkA "pareizs" ; + dry_A = mkA "sauss" ; + dull_A = mkA "neass" ; -- garlaicīgs? + full_A = mkA "pilns" ; + heavy_A = mkA "smags" ; + near_A = mkA "tuvs" ; + rotten_A = mkA "sapuvis" ; + round_A = mkA "apaļš" ; + sharp_A = mkA "ass" ; + smooth_A = mkA "gluds" ; + straight_A = mkA "taisns" ; + wet_A = mkA "slapjš" ; + wide_A = mkA "plats" ; + animal_N = mkN "dzīvnieks" ; + ashes_N = mkN "pelni" ; -- FIXME: plural only? kā to norāda? + back_N = mkN "mugura" ; + bark_N = mkN "miza" ; + belly_N = mkN "vēders" ; + blood_N = mkN "asinis" Fem; + bone_N = mkN "kauls" ; + breast_N = mkN "krūts" Fem; + cloud_N = mkN "mākonis" ; + day_N = mkN "diena" ; + dust_N = mkN "putekļi" ; + ear_N = mkN "auss" ; + earth_N = mkN "zeme" ; + egg_N = mkN "ola" ; + eye_N = mkN "acs" ; + fat_N = mkN "tauki" ; + feather_N = mkN "spalva" ; + fingernail_N = mkN "nags" ; + fire_N = mkN "uguns" ; + flower_N = mkN "puķe" ; + fog_N = mkN "migla" ; + foot_N = mkN "pēda" ; + forest_N = mkN "mežs" ; + grass_N = mkN "zāle" ; + guts_N = mkN "zarnas" ; -- FIXME: no singular + hair_N = mkN "mati" ; + hand_N = mkN "roka" ; + head_N = mkN "galva" ; + heart_N = mkN "sirds" ; + horn_N = mkN "rags" ; + husband_N = mkN "vīrs" ; --TODO - kāpēc nav parametrs tāpat kā tēvam? + ice_N = mkN "ledus" ; + knee_N = mkN "ceļgals" ; + leaf_N = mkN "lapa" ; + leg_N = mkN "kāja" ; + liver_N = mkN "aknas" ; + louse_N = mkN "uts" ; + mouth_N = mkN "mute" ; + name_N = mkN "vārds" ; + neck_N = mkN "kakls" ; + night_N = mkN "nakts" ; + nose_N = mkN "deguns" ; + person_N = mkN "cilvēks" ; + rain_N = mkN "lietus" ; + road_N = mkN "ceļš" ; + root_N = mkN "sakne" ; + rope_N = mkN "virve" ; + salt_N = mkN "sāls" ; + sand_N = mkN "smiltis" ; + seed_N = mkN "sēkla" ; + skin_N = mkN "āda" ; + sky_N = mkN "debesis" ; + smoke_N = mkN "dūmi" ; + snow_N = mkN "sniegs" ; + stick_N = mkN "nūja" ; + tail_N = mkN "aste" ; + tongue_N = mkN "mēle" ; + tooth_N = mkN "zobs"; + wife_N = mkN "sieva" ; + wind_N = mkN "vējš" ; + wing_N = mkN "spārns" ; + worm_N = mkN "tārps" ; + year_N = mkN "gads" ; + + blow_V = mkV "pūst" "pūšu" "pūtu" ; + breathe_V = mkV2 (mkV "elpot" second_conjugation) acc_Prep; + burn_V = mkV "degt" "degu" "degu" ; + dig_V = mkV "rakt" "roku" "raku" ; + fall_V = mkV "krist" "krītu" "kritu" ; + float_V = mkV "peldēt" third_conjugation; + flow_V = mkV "plūst" "plūstu" "plūdu"; + fly_V = mkV "lidot" second_conjugation ; + freeze_V = mkV "sasalt" "sasalstu" "sasalu" ; + give_V3 = mkV3 (mkV "dot" "dodu" "devu") acc_Prep dat_Prep ; -- dot ko kam + laugh_V = mkV "smieties" "smejos" "smējos" ; + lie_V = mkV "gulties" "guļos" "gūlos" ; + play_V = mkV "spēlēt" second_conjugation; + sew_V = mkV "šūt" "šuju" "šuvu"; + sing_V = mkV "dziedāt" third_conjugation ; + sit_V = mkV "sēdēt" third_conjugation ; + smell_V = mkV "smirdēt" third_conjugation; + spit_V = mkV "spļaut" "spļauju" "spļāvu" ; + stand_V = mkV "stāvēt" third_conjugation; + swell_V = mkV "piebriest" "piebriestu" "piebriedu" ; + swim_V = mkV "peldēt" third_conjugation; + think_V = mkV "domāt" second_conjugation; + turn_V = mkV "griezties" "griežos" "griezos"; + vomit_V = mkV "vemt" "vemju" "vēmu" ; - bite_V2 = dirV2 IrregEng.bite_V ; - count_V2 = dirV2 (regV "count") ; - cut_V2 = dirV2 IrregEng.cut_V ; - fear_V2 = dirV2 (regV "fear") ; - fight_V2 = dirV2 fight_V ; - hit_V2 = dirV2 hit_V ; - hold_V2 = dirV2 hold_V ; - hunt_V2 = dirV2 (regV "hunt") ; - kill_V2 = dirV2 (regV "kill") ; - pull_V2 = dirV2 (regV "pull") ; - push_V2 = dirV2 (regV "push") ; - rub_V2 = dirV2 (regDuplV "rub") ; - scratch_V2 = dirV2 (regV "scratch") ; - split_V2 = dirV2 split_V ; - squeeze_V2 = dirV2 (regV "squeeze") ; - stab_V2 = dirV2 (regDuplV "stab") ; - suck_V2 = dirV2 (regV "suck") ; - throw_V2 = dirV2 throw_V ; - tie_V2 = dirV2 (regV "tie") ; - wash_V2 = dirV2 (regV "wash") ; - wipe_V2 = dirV2 (regV "wipe") ; + bite_V2 = mkV2 (mkV "kost" "kožu" "kodu") dat_Prep ; + count_V2 = mkV2 (mkV "skaitīt" third_conjugation) acc_Prep; + cut_V2 = mkV2 (mkV "griezt" "griežu" "griezu") acc_Prep; + fear_V2 = mkV2 (mkV "baidīties" third_conjugation) from_Prep; + fight_V2 = mkV2 (mkV "cīnīties" third_conjugation) with_Prep; + hit_V2 = mkV2 (mkV "sist" "situ" "situ") dat_Prep; -- TODO - atkal valences, var arī akuzatīvu ar bik citu nozīmi + hold_V2 = mkV2 (mkV "turēt" third_conjugation) acc_Prep ; + hunt_V2 = mkV2 (mkV "medīt" second_conjugation) acc_Prep; + kill_V2 = mkV2 (mkV "nogalināt" third_conjugation) acc_Prep; + pull_V2 = mkV2 (mkV "vilkt" "velku" "vilku") acc_Prep; + push_V2 = mkV2 (mkV "stumt" "stumju" "stūmu") acc_Prep; + rub_V2 = mkV2 (mkV "berzt" "beržu" "berzu") acc_Prep; + scratch_V2 = mkV2 (mkV "kasīt" third_conjugation) acc_Prep; + split_V2 = mkV2 (mkV "sadalīt" third_conjugation) acc_Prep; + squeeze_V2 = mkV2 (mkV "saspiest" "saspiežu" "saspiedu") acc_Prep; + stab_V2 = mkV2 (mkV "sadurt" "saduru" "sadūru") acc_Prep; + suck_V2 = mkV2 (mkV "sūkt" "sūcu" "sūcu") acc_Prep; + throw_V2 = mkV2 (mkV "mest" "metu" "metu") acc_Prep; + tie_V2 = mkV2 (mkV "piesiet" "piesienu" "piesēju") acc_Prep; + wash_V2 = mkV2 (mkV "mazgāt" second_conjugation) acc_Prep; + wipe_V2 = mkV2 (mkV "slaucīt" third_conjugation) acc_Prep; -- other_A = regA "other" ; - grammar_N = regN "grammar" ; - language_N = regN "language" ; - rule_N = regN "rule" ; + grammar_N = mkN "gramatika" ; + language_N = mkN "valoda" ; + rule_N = mkN "likums" ; --- added 4/6/2007 - john_PN = mkPN (mkN masculine (mkN "John")) ; - question_N = regN "question" ; - ready_A = regA "ready" ; - reason_N = regN "reason" ; - today_Adv = mkAdv "today" ; - uncertain_A = regA "uncertain" ; + john_PN = mkPN "Jānis" ; + + question_N = mkN "jautājums" ; + ready_A = mkA "gatavs" ; + reason_N = mkN "iemesls" ; + today_Adv = mkAdv "šodien" ; + uncertain_A = mkA "nepārliecināts" ; oper - aboutP = mkPrep "about" ; + par_Prep = mkPrep "par" Acc Dat; + +{- atP = mkPrep "at" ; forP = mkPrep "for" ; fromP = mkPrep "from" ; diff --git a/lib/src/latvian/NounLav.gf b/lib/src/latvian/NounLav.gf index 4e0f2c21d..339151164 100644 --- a/lib/src/latvian/NounLav.gf +++ b/lib/src/latvian/NounLav.gf @@ -4,147 +4,130 @@ flags optimize=all_subs ; lin UseN n = {s = \\_ => n.s ; g = n.g} ; - + UsePN pn = { s = pn.s ; a = agrgP3 Sg pn.g } ; + UsePron p = p ; + + PredetNP pred np = { + s = \\c => pred.s ! (fromAgr np.a).g ++ np.s ! c ; + a = np.a + } ; + + UseN2 n = {s = \\_ => n.s ; g = n.g}; + UseN3 n = n; + + 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); + g = f.g + } ; + 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); + g = f.g ; + p = f.p2 ; + isPre = f.isPre2 + } ; + Use2N3 n = { s = n.s ; g = n.g ; p = n.p1 ; isPre = n.isPre1 }; + Use3N3 n = { s = n.s ; g = n.g ; p = n.p2 ; isPre = n.isPre2 }; + + AdvNP np adv = { + s = \\c => np.s ! c ++ adv.s ; + a = np.a + } ; + RelNP np rs = { + s = \\c => np.s ! c ++ "," ++ rs.s ! np.a ; + a = np.a + } ; + DetCN det cn = { s = \\c => det.s ! cn.g ! c ++ cn.s ! det.d ! det.n ! c ; - g = cn.g ; - n = det.n ; - p = P3 ; - } ; - - - + a = AgP3 det.n cn.g; + } ; + + DetQuant quant num = { + s = \\g,c => quant.s ! g ! num.n ! c ++ num.s ! g ! c; + n = num.n ; + d = quant.d --FIXME - ja ir krtas skaita vrds, tad tikai noteikts formas drkst bt + } ; + + DetQuantOrd quant num ord = { + s = \\g,c => quant.s ! g ! num.n ! c ++ num.s ! g ! c ++ ord.s ! g ! c; + n = num.n; + d = quant.d --FIXME - ja ir krtas skaita vrds, tad tikai noteikts formas drkst bt + } ; + + DetNP det = { + s = \\c => det.s ! Masc ! c ; + a = AgP3 det.n Masc + } | { + s = \\c => det.s ! Fem ! c ; + a = AgP3 det.n Fem + }; + + AdjCN ap cn = { + s = \\d,n,c => ap.s ! d ! cn.g ! n ! c ++ cn.s ! d ! n ! c ; + g = cn.g + } ; + + DefArt = { + s = \\_,_,_ =>[]; + d = Def + } ; + + IndefArt = { + s = \\_,_,_ => []; + d = Indef + } ; + + PossPron p = { + s = p.possessive ; + d = Def ; + } ; + + MassNP cn = { + s = cn.s ! Indef ! Sg ; -- FIXME a 'is alus'? der tak gan 'za alus' gan 'zaais alus' + a = AgP3 Sg cn.g + } ; + + NumSg = {s = \\_,_ => []; n = Sg ; hasCard = False} ; + NumPl = {s = \\_,_ => []; n = Pl ; hasCard = False} ; + + NumCard n = n ** {hasCard = True} ; + + NumDigits n = {s = \\g,c => n.s ! NCard ; n = n.n} ; + OrdDigits n = {s = \\g,c => n.s ! NOrd} ; + + NumNumeral numeral = {s = numeral.s ! NCard; n = numeral.n} ; + OrdNumeral numeral = {s = numeral.s ! NOrd} ; + + OrdSuperl a = {s = \\g,c => a.s ! (AAdj Superl Def g Sg c) } ; + + AdNum adn num = {s = \\g,c => adn.s ++ num.s!g!c ; n = num.n; hasCard = num.n} ; + + AdvCN cn ad = {s = \\d,n,c => cn.s ! d ! n ! c ++ ad.s ; g = cn.g} ; + + ApposCN cn np = { -- 'Pielikums' + s = \\d,n,c => case (fromAgr np.a).n of { + n => cn.s ! d ! n ! c ++ np.s ! c; -- FIXME - comparison not working + _ => NON_EXISTENT }; + g = cn.g + } ; + + RelCN cn rs = { + s = \\d, n,c => cn.s ! d ! n ! c ++ "," ++ rs.s ! AgP3 n cn.g ; + g = cn.g + } ; + + -- FIXME - placeholder + SentCN cn sc = {s = \\_,_,_ => NON_EXISTENT ; g = cn.g}; + PPartNP np v2 = {s = \\_ => NON_EXISTENT ; a = np.a}; + {- - DetCN det cn = { - s = \\c => det.s ++ cn.s ! det.n ! c ; - a = agrgP3 det.n cn.g - } ; - - UsePN pn = pn ** {a = agrgP3 Sg pn.g} ; - UsePron p = p ; - - PredetNP pred np = { - s = \\c => pred.s ++ np.s ! c ; - a = np.a - } ; - + TODO - im vajag -ts -ta divdabjus (+ noteikts formas tiem) PPartNP np v2 = { s = \\c => np.s ! c ++ v2.s ! VPPart ; a = np.a } ; - RelNP np rs = { - s = \\c => np.s ! c ++ "," ++ rs.s ! np.a ; - a = np.a - } ; - - AdvNP np adv = { - s = \\c => np.s ! c ++ adv.s ; - a = np.a - } ; - - DetQuant quant num = { - s = quant.s ! num.hasCard ! num.n ++ num.s ! Nom; - sp = \\c => case num.hasCard of { - False => quant.sp ! num.hasCard ! num.n ! c ++ num.s ! Nom ; - True => quant.sp ! num.hasCard ! num.n ! Nom ++ num.s ! c - } ; - n = num.n - } ; - - DetQuantOrd quant num ord = { - s = quant.s ! num.hasCard ! num.n ++ num.s ! Nom ++ ord.s ! Nom; - sp = \\c => quant.sp ! num.hasCard ! num.n ! Nom ++ num.s ! Nom ++ ord.s ! c ; - n = num.n - } ; - - DetNP det = { - s = det.sp ; - a = agrP3 det.n - } ; - - PossPron p = { - s = \\_,_ => p.s ! Gen ; - sp = \\_,_ => p.sp - } ; - - NumSg = {s = \\c => []; n = Sg ; hasCard = False} ; - NumPl = {s = \\c => []; n = Pl ; hasCard = False} ; ----b NoOrd = {s = []} ; - - NumCard n = n ** {hasCard = True} ; - - NumDigits n = {s = n.s ! NCard ; n = n.n} ; - OrdDigits n = {s = n.s ! NOrd} ; - - NumNumeral numeral = {s = numeral.s ! NCard; n = numeral.n} ; - OrdNumeral numeral = {s = numeral.s ! NOrd} ; - - AdNum adn num = {s = \\c => adn.s ++ num.s!c ; n = num.n} ; - - OrdSuperl a = {s = \\c => a.s ! AAdj Superl c } ; - - DefArt = { - s = \\hasCard,n => artDef ; - sp = \\hasCard,n => case of { - => table { Gen => "its"; _ => "it" } ; - => table { Nom => "they"; Acc => "them"; Gen => "theirs" } ; - _ => \\c => artDef - } - } ; - - IndefArt = { - s = \\hasCard,n => case of { - => artIndef ; - _ => [] - } ; - sp = \\hasCard,n => case of { - => table { Gen => "one's"; _ => "one" }; - => table { Gen => "ones'"; _ => "ones" } ; - _ => \\c => [] - } - } ; - - MassNP cn = { - s = cn.s ! Sg ; - a = agrP3 Sg - } ; - - UseN n = n ; - UseN2 n = n ; ----b UseN3 n = n ; - - Use2N3 f = { - s = \\n,c => f.s ! n ! Nom ; - g = f.g ; - c2 = f.c2 - } ; - - Use3N3 f = { - s = \\n,c => f.s ! n ! Nom ; - g = f.g ; - c2 = f.c3 - } ; - - ComplN2 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c ; g = f.g} ; - ComplN3 f x = { - s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c ; - g = f.g ; - c2 = f.c3 - } ; - - AdjCN ap cn = { - s = \\n,c => preOrPost ap.isPre (ap.s ! agrgP3 n cn.g) (cn.s ! n ! c) ; - g = cn.g - } ; - RelCN cn rs = { - s = \\n,c => cn.s ! n ! c ++ rs.s ! agrgP3 n cn.g ; - g = cn.g - } ; - AdvCN cn ad = {s = \\n,c => cn.s ! n ! c ++ ad.s ; g = cn.g} ; - SentCN cn sc = {s = \\n,c => cn.s ! n ! c ++ sc.s ; g = cn.g} ; - ApposCN cn np = {s = \\n,c => cn.s ! n ! Nom ++ np.s ! c ; g = cn.g} ; -} } diff --git a/lib/src/latvian/NumeralLav.gf b/lib/src/latvian/NumeralLav.gf index 8495ae142..852a12fca 100644 --- a/lib/src/latvian/NumeralLav.gf +++ b/lib/src/latvian/NumeralLav.gf @@ -1,4 +1,6 @@ -concrete NumeralLav of Numeral = CatLav ** open ResLav in { +concrete NumeralLav of Numeral = CatLav ** open ResLav, ParadigmsLav in { +flags + coding = utf8 ; {- lincat Digit = {s : DForm => CardOrd => Case => Str} ; @@ -6,22 +8,53 @@ lincat Sub100 = {s : CardOrd => Case => Str ; n : Number} ; Sub1000 = {s : CardOrd => Case => Str ; n : Number} ; Sub1000000 = {s : CardOrd => Case => Str ; n : Number} ; +-} +lincat --TODO - formas, kas pieprasa ģenitīvu - tūkstotis grāmatu, trīs simti meiteņu + Digit = {s : DForm => CardOrd => Gender => Case => Str} ; + Sub10 = {s : CardOrd => Gender => Case => Str ; n : Number}; + Sub100 = {s : CardOrd => Gender => Case => Str ; n : Number}; + Sub1000 = {s : CardOrd => Gender => Case => Str ; n : Number}; + Sub1000000 = {s : CardOrd => Gender => Case => Str ; n : Number}; -lin num x = x ; -lin n2 = let two = mkNum "two" "twelve" "twenty" "second" in - {s = \\f,o => case of { - => regGenitiveS "twelfth" ; - _ => two.s ! f ! o - } - } ; +lin + num x = x; + n2 = mkNum "divi" "otrais" Pl; + n3 = let trijs = mkNumSpec "trijs" "trešais" "trīs" "trīs" Pl in { + s = \\f, o, g, c => case of { + => "trīs"; + => "trim"; + => "trīs"; + _ => trijs.s ! f ! o ! g ! c + } + } | { + s = \\f, o, g, c => case of { + => "trīs"; + _ => trijs.s ! f ! o ! g ! c + } + }; + n4 = mkNum "četri" "ceturtais" Pl; + n5 = mkNum "pieci" "piektais" Pl; + n6 = mkNum "seši" "sestais" Pl; + n7 = mkNum "septiņi" "septītais" Pl; + n8 = mkNum "astoņi" "astotais" Pl; + n9 = mkNum "deviņi" "devītais" Pl; + + pot01 = {s = viens.s ! unit} ** {n = Sg} ; + pot0 d = {s = d.s ! unit} ** {n = Pl} ; + pot110 = {s = viens.s ! ten} ** {n = Pl} ; + pot111 = {s = viens.s ! teen} ** {n = Pl} ; + pot1to19 d = {s = d.s ! teen} ** {n = Pl} ; + pot0as1 n = { s = n.s ; n = n.n } ; + pot1 d = {s = d.s ! ten} ** {n = Pl} ; + pot1plus d e = {s = \\o, g, c => d.s ! ten ! NCard ! Masc ! Nom ++ e.s ! o ! g ! c; n = e.n} ; + pot1as2 n = n ; + pot2 d = { s = \\o,g,c => d.s ! NCard ! Masc ! Nom ++ simts ! o ! g ! d.n ! c; n = Pl} ; --FIXME - nav īsti labi, kārtas skaitlim ir jābūt 'trīssimtais' utml + pot2plus d e = { s = \\o,g,c => d.s ! NCard ! Masc ! Nom ++ simts ! NCard ! Masc ! d.n ! Nom ++ e.s ! o ! g ! c; n = e.n} ; + pot2as3 n = n ; + pot3 d = { s = \\o,g,c => d.s ! NCard ! Masc ! Nom ++ tuukstotis ! o ! g ! d.n ! c; n = Pl} ; + pot3plus d e ={ s = \\o,g,c => d.s ! NCard ! Masc ! Nom ++ tuukstotis ! NCard ! Masc ! d.n ! Nom ++ e.s ! o ! g ! c; n = e.n} ; -lin n3 = mkNum "three" "thirteen" "thirty" "third" ; -lin n4 = mkNum "four" "fourteen" "forty" "fourth" ; -lin n5 = mkNum "five" "fifteen" "fifty" "fifth" ; -lin n6 = regNum "six" ; -lin n7 = regNum "seven" ; -lin n8 = mkNum "eight" "eighteen" "eighty" "eighth" ; -lin n9 = mkNum "nine" "nineteen" "ninety" "ninth" ; +{- lin pot01 = mkNum "one" "eleven" "ten" "first" ** {n = Sg} ; lin pot0 d = d ** {n = Pl} ; @@ -41,25 +74,25 @@ lin pot3 n = { s = \\o,c => n.s ! NCard ! Nom ++ mkCard o "thousand" ! c ; n = Pl} ; lin pot3plus n m = { s = \\o,c => n.s ! NCard ! Nom ++ "thousand" ++ m.s ! o ! c; n = Pl} ; +-} -- numerals as sequences of digits lincat - Dig = TDigit ; + Dig = {n : Number; s : CardOrd => Str }; lin - IDig d = d ** {tail = T1} ; + IDig d = d ; IIDig d i = { - s = \\o,c => d.s ! NCard ! Nom ++ commaIf i.tail ++ i.s ! o ! c ; - n = Pl ; - tail = inc i.tail + s = \\o => d.s ! NCard ++ i.s ! o ; + n = Pl ; --FIXME 1 cilvēks 11 cilvēki 21 cilvēks ... } ; D_0 = mkDig "0" ; - D_1 = mk3Dig "1" "1st" Sg ; - D_2 = mk2Dig "2" "2nd" ; - D_3 = mk2Dig "3" "3rd" ; + D_1 = mk2Dig "1" Sg ; + D_2 = mkDig "2" ; + D_3 = mkDig "3" ; D_4 = mkDig "4" ; D_5 = mkDig "5" ; D_6 = mkDig "6" ; @@ -68,28 +101,11 @@ lin pot3plus n m = { D_9 = mkDig "9" ; oper - commaIf : DTail -> Str = \t -> case t of { - T3 => "," ; - _ => [] - } ; + mkDig : Str -> Dig = \c -> mk2Dig c Pl ; - inc : DTail -> DTail = \t -> case t of { - T1 => T2 ; - T2 => T3 ; - T3 => T1 - } ; - - mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ; - mkDig : Str -> TDigit = \c -> mk2Dig c (c + "th") ; - - mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> { - s = table {NCard => regGenitiveS c ; NOrd => regGenitiveS o} ; + mk2Dig : Str -> Number -> Dig = \c,n -> lin Dig { + s = table {NCard => c ; NOrd => c+"."} ; n = n - } ; - - TDigit = { - n : Number ; - s : CardOrd => Case => Str } ; --} + } diff --git a/lib/src/latvian/ParadigmsAdjectivesLav.gf b/lib/src/latvian/ParadigmsAdjectivesLav.gf index ae71e2bea..cab34afda 100644 --- a/lib/src/latvian/ParadigmsAdjectivesLav.gf +++ b/lib/src/latvian/ParadigmsAdjectivesLav.gf @@ -1,18 +1,19 @@ -- Latvian adjective paradigms - by Normunds Grūzītis; copied off mini-grammar as of 2011-07-12 -resource ParadigmsAdjectivesLav = open - (Predef=Predef), - Prelude, +resource ParadigmsAdjectivesLav = open + (Predef=Predef), + Prelude, ResLav, CatLav in { flags coding = utf8; - + oper - Adj : Type = {s : Degree => Definite => Gender => Number => Case => Str} ; - + --Adj : Type = {s : Degree => Definite => Gender => Number => Case => Str} ; + Adj : Type = {s : AForm => Str} ; + -- ADJECTIVES -- TODO: Parameters and paradigms should be redesigned due to the many NON_EXISTENT forms..? @@ -38,34 +39,45 @@ oper -- Indeclinable adjective: theoretically, any #vowel ending mkAdjective_Indecl : Str -> Adj = \lemma -> { s = table{ - Posit => \\_,_,_,_ => lemma ; - Compar => \\_,_,_,_ => lemma ; - Superl => table {Indef => \\_,_,_ => NON_EXISTENT ; Def => \\_,_,_ => lemma} + AAdj Superl Indef _ _ _ => NON_EXISTENT; + AAdj _ _ _ _ _ => lemma ; + AAdv d => mkAdjective_Adverb lemma ! d-- TODO - notestēt šādu keisu } } ; -- Qualitative adjective: -s, -š mkAdjective_Qual : Str -> Adj = \lemma -> { s = table { - Posit => table {Indef => mkAdjective_Pos lemma Indef ; Def => mkAdjective_Pos lemma Def} ; - Compar => table {Indef => mkAdjective_Comp lemma Indef ; Def => mkAdjective_Comp lemma Def} ; - Superl => table {Indef => \\_,_,_ => NON_EXISTENT ; Def => mkAdjective_Sup lemma} + AAdj Posit d g n c => mkAdjective_Pos lemma d ! g ! n ! c; + AAdj Compar d g n c => mkAdjective_Comp lemma d ! g ! n ! c; + AAdj Superl Def g n c => mkAdjective_Sup lemma ! g ! n ! c; + AAdj Superl Indef _ _ _ => NON_EXISTENT; + AAdv d => mkAdjective_Adverb lemma ! d } } ; -- Relative adjective: -ais (Def only); -s, -š (Indef and Def) mkAdjective_Rel : Str -> Adj = \lemma -> { s = table { - Posit => case lemma of { - s + "ais" => table {Indef => \\_,_,_ => NON_EXISTENT ; Def => mkAdjective_Pos lemma Def} ; - _ => table {Indef => mkAdjective_Pos lemma Indef ; Def => mkAdjective_Pos lemma Def} + AAdj Posit Def g n c => mkAdjective_Pos lemma Def ! g ! n ! c; + AAdj Posit Indef g n c => case lemma of { + s + "ais" => NON_EXISTENT ; + _ => mkAdjective_Pos lemma Indef ! g ! n ! c } ; - Compar => table {Indef => \\_,_,_ => NON_EXISTENT ; Def => \\_,_,_ => NON_EXISTENT} ; - Superl => table {Indef => \\_,_,_ => NON_EXISTENT ; Def => \\_,_,_ => NON_EXISTENT} + AAdj _ _ _ _ _ => NON_EXISTENT ; + AAdv d => mkAdjective_Adverb lemma ! d } }; + mkAdjective_Participle : Verb -> Adj = \v -> { + s = table { + AAdj Posit Indef g n c => v.s ! Pos !(Participle g n c); --FIXME - iznest polaritāti ārpusē lai ir noliegtie kā atsevišķi īpašībasvārdi + _ => NON_EXISTENT --FIXME - salikt arī tās divdabja formas + } + }; + -- Positive degree: -s, -š (Indef and Def); -ais (Def only) + -- TODO - atsaukties uz lietvārdu locīšanas tabulām? mkAdjective_Pos : Str -> Definite -> Gender => Number => Case => Str = \lemma,defin -> let stem : Str = case lemma of { s + "ais" => s ; @@ -79,14 +91,16 @@ oper Gen => stem + "a" ; Dat => stem + "am" ; Acc => stem + "u" ; - Loc => stem + "ā" + Loc => stem + "ā" ; + Voc => NON_EXISTENT } ; Pl => table { Nom => stem + "i" ; - Gen => stem + "us" ; + Gen => stem + "u" ; Dat => stem + "iem" ; Acc => stem + "us" ; - Loc => stem + "os" + Loc => stem + "os" ; + Voc => NON_EXISTENT } } ; Fem => table { @@ -95,14 +109,16 @@ oper Gen => stem + "as" ; Dat => stem + "ai" ; Acc => stem + "u" ; - Loc => stem + "ā" + Loc => stem + "ā" ; + Voc => NON_EXISTENT } ; Pl => table { Nom => stem + "as" ; Gen => stem + "u" ; Dat => stem + "ām" ; Acc => stem + "as" ; - Loc => stem + "ās" + Loc => stem + "ās" ; + Voc => NON_EXISTENT } } } ; @@ -113,14 +129,16 @@ oper Gen => stem + "ā" ; Dat => case stem of {s + "ēj" => stem + "am" ; _ => stem + "ajam"} ; Acc => stem + "o" ; - Loc => case stem of {s + "ēj" => stem + "ā" ; _ => stem + "ajā"} + Loc => case stem of {s + "ēj" => stem + "ā" ; _ => stem + "ajā"} ; + Voc => stem + "ais" } ; Pl => table { Nom => stem + "ie" ; Gen => stem + "o" ; Dat => case stem of {s + "ēj" => stem + "iem" ; _ => stem + "ajiem"} ; Acc => stem + "os" ; - Loc => case stem of {s + "ēj" => stem + "os" ; _ => stem + "ajos"} + Loc => case stem of {s + "ēj" => stem + "os" ; _ => stem + "ajos"} ; + Voc => stem + "ie" } } ; Fem => table { @@ -129,14 +147,16 @@ oper Gen => stem + "ās" ; Dat => case stem of {s + "ēj" => stem + "ai" ; _ => stem + "ajai"} ; Acc => stem + "o" ; - Loc => case stem of {s + "ēj" => stem + "ā" ; _ => stem + "ajā"} + Loc => case stem of {s + "ēj" => stem + "ā" ; _ => stem + "ajā"} ; + Voc => stem + "ā" } ; Pl => table { Nom => stem + "ās" ; Gen => stem + "o" ; Dat => case stem of {s + "ēj" => stem + "ām" ; _ => stem + "ajām"} ; Acc => stem + "ās" ; - Loc => case stem of {s + "ēj" => stem + "ās" ; _ => stem + "ajās"} + Loc => case stem of {s + "ēj" => stem + "ās" ; _ => stem + "ajās"} ; + Voc => stem + "ās" } } } @@ -153,14 +173,16 @@ oper Gen => stem + "āka" ; Dat => stem + "ākam" ; Acc => stem + "āku" ; - Loc => stem + "ākā" + Loc => stem + "ākā" ; + Voc => NON_EXISTENT } ; Pl => table { Nom => stem + "āki" ; Gen => stem + "āku" ; Dat => stem + "ākiem" ; Acc => stem + "ākus" ; - Loc => stem + "ākos" + Loc => stem + "ākos" ; + Voc => NON_EXISTENT } } ; Fem => table { @@ -169,14 +191,16 @@ oper Gen => stem + "ākas" ; Dat => stem + "ākai" ; Acc => stem + "āku" ; - Loc => stem + "ākā" + Loc => stem + "ākā" ; + Voc => NON_EXISTENT } ; Pl => table { Nom => stem + "ākas" ; Gen => stem + "āku" ; Dat => stem + "ākām" ; Acc => stem + "ākas" ; - Loc => stem + "ākās" + Loc => stem + "ākās" ; + Voc => NON_EXISTENT } } } ; @@ -187,14 +211,16 @@ oper Gen => stem + "ākā" ; Dat => stem + "ākajam" ; Acc => stem + "āko" ; - Loc => stem + "ākajā" + Loc => stem + "ākajā" ; + Voc => stem + "ākais" } ; Pl => table { Nom => stem + "ākie" ; Gen => stem + "āko" ; Dat => stem + "ākajiem" ; Acc => stem + "ākos" ; - Loc => stem + "ākajos" + Loc => stem + "ākajos" ; + Voc => stem + "ākie" } } ; Fem => table { @@ -203,14 +229,16 @@ oper Gen => stem + "ākās" ; Dat => stem + "ākajai" ; Acc => stem + "āko" ; - Loc => stem + "ākajā" + Loc => stem + "ākajā" ; + Voc => stem + "ākā" } ; Pl => table { Nom => stem + "ākās" ; Gen => stem + "āko" ; Dat => stem + "ākajām" ; Acc => stem + "ākās" ; - Loc => stem + "ākajās" + Loc => stem + "ākajās" ; + Voc => stem + "ākās" } } } @@ -218,5 +246,16 @@ oper -- Superlative degree: Qual only, Def only mkAdjective_Sup : Str -> Gender => Number => Case => Str = \lemma -> - \\g,n,c => "vis" + (mkAdjective_Comp lemma Def) ! g ! n ! c ; + \\g,n,c => "vis" + (mkAdjective_Comp lemma Def) ! g ! n ! c ; + + -- Adverbial form, all 3 degrees + mkAdjective_Adverb : Str -> Degree => Str = \lemma -> + let stem : Str = case lemma of { + s + "ais" => s ; + _ => Predef.tk 1 lemma + } in table { + Posit => stem + "i"; + Compar => stem + "āk"; + Superl => "vis" + stem + "āk" + }; } ; diff --git a/lib/src/latvian/ParadigmsLav.gf b/lib/src/latvian/ParadigmsLav.gf index f28730c7a..f2e9f22ad 100644 --- a/lib/src/latvian/ParadigmsLav.gf +++ b/lib/src/latvian/ParadigmsLav.gf @@ -41,7 +41,13 @@ flags oper second_conjugation : VerbConj = C2 ; third_conjugation : VerbConj = C3 ; - + + nominative : Case = Nom ; + genitive : Case = Gen ; + dative : Case = Dat ; + accusative : Case = Acc ; + locative : Case = Loc ; + mkN = overload { mkN : (lemma : Str) -> N = \l -> lin N (mkNoun l) ; @@ -55,17 +61,134 @@ oper mkN : (lemma : Str) -> Gender -> NounDecl -> Bool -> N = \l,g,d,p -> lin N (mkNounByGendDeclPal l g d p) ; } ; + + mkPN = overload { + mkN : (lemma : Str) -> PN = \l -> lin PN (mkProperNoun l Sg) ; + mkN : (lemma : Str) -> Number -> PN = \l,n -> lin PN (mkProperNoun l n) ; + } ; + + mkN2 = overload { + mkN2 : N -> Prep -> N2 = \n,p -> lin N2 n ** {p = p; isPre = False}; + mkN2 : N -> Prep -> Bool -> N2 = \n,p,isPre -> lin N2 n ** {p = p; isPre = isPre}; + } ; + mkN3 : N -> Prep -> Prep -> N3 = \n,p1,p2 -> lin N3 n ** {p1 = p1; p2 = p2; isPre1 = False; isPre2 = False}; 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) ; } ; + + mkA2 : A -> Prep -> A2 = \a,p -> lin A2 (a ** {p = p}); -- precējies ar ... + + mkAS : A -> AS =\a -> lin A a ; + mkA2S : A -> Prep -> A2S =\a,p -> lin A2 (a ** {p = p}); + mkAV : A -> AV = \a -> lin A a ; + mkA2V : A -> Prep -> A2V = \a,p -> lin A2 (a ** {p = p} ); + + AS, AV : Type = {s : AForm => Str } ; + A2S, A2V : Type = {s : AForm => Str; p: Prep}; mkV = overload { mkV : (lemma : Str) -> V = \l -> lin V (mkVerb_Irreg l) ; mkV : (lemma : Str) -> VerbConj -> V = \l,c -> lin V (mkVerb l c) ; mkV : (lemma : Str) -> Str -> Str -> V = \l1,l2,l3 -> lin V (mkVerbC1 l1 l2 l3) ; } ; + + mkV2 : V -> Prep -> V2 = \v,p -> lin V2 v ** {p = p}; + mkVS : V -> Subj -> VS = \v,s -> lin VS v ** {subj = s}; + mkV2S : V -> Prep -> Subj -> V2S = \v,p,s -> lin V2S v ** {p = p; subj = s}; + mkVA : V -> VA = \v -> lin VA v; + mkV2A : V -> Prep -> V2A = \v,p -> lin V2A v ** {p = p}; + mkVQ : V -> VQ = \v -> lin VQ v; + mkV2Q : V -> Prep -> V2Q = \v,p -> lin V2Q v ** {p = p}; + mkVV : V -> VV = \v -> lin VV v ; + mkV2V : V -> Prep -> V2V = \v,p -> lin V2V v ** {p = p}; + mkV3 : V -> Prep -> Prep -> V3 = \v,p1,p2 -> lin V3 v ** {p1 = p1; p2 = p2}; + + mkCAdv : Str -> Str -> Degree -> CAdv = \s,p,d -> {s = s ; p = p ; d = d; lock_CAdv = <>}; + + mkPrep = overload { + mkPrep : Str -> Case -> Case -> Prep = \prep, sg, pl -> lin Prep { s = prep; c = table { Sg => sg; Pl => pl } }; + mkPrep : Case -> Prep = \c -> lin Prep { s = []; c = table { _ => c } } ; + }; + + -- empty fake prepositions for valences / rections that are expressed by simple cases without any prepositions + nom_Prep = mkPrep Nom; + gen_Prep = mkPrep Gen; + dat_Prep = mkPrep Dat; + acc_Prep = mkPrep Acc; + loc_Prep = mkPrep Loc; + + mkAdv : Str -> Adv = \x -> lin Adv (ss x) ; + mkAdV : Str -> AdV = \x -> lin AdV (ss x) ; + mkAdA : Str -> AdA = \x -> lin AdA (ss x) ; + mkAdN : Str -> AdN = \x -> lin AdN (ss x) ; + + mkConj = overload { + mkConj : Str -> Conj = \y -> mk2Conj [] y Pl ; + mkConj : Str -> Number -> Conj = \y,n -> mk2Conj [] y n ; + mkConj : Str -> Str -> Conj = \x,y -> mk2Conj x y Pl ; + mkConj : Str -> Str -> Number -> Conj = mk2Conj ; + } ; + + mk2Conj : Str -> Str -> Number -> Conj = \x,y,n -> + lin Conj (sd2 x y ** {n = n}) ; + + viens = mkNumSpec "viens" "pirmais" "vien" "" Sg; + mkNum : Str -> Str -> Number -> { s : DForm => CardOrd => Gender => Case => Str } = \pieci,piektais,n -> mkNumSpec pieci piektais (cutStem pieci) (cutStem pieci) n; + + mkNumSpec : Str -> Str -> Str -> Str -> Number -> { s : DForm => CardOrd => Gender => Case => Str } = \pieci,piektais,stem_teen,stem_ten,n -> let + masc = mkNoun_D1 pieci ; + fem = mkNoun_D4 pieci Fem ; + ord = mkAdjective_Pos piektais Def ; + padsmit = mkAdjective_Pos (stem_teen+"padsmitais") Def ; + desmit = mkAdjective_Pos (stem_ten+"desmitais") Def ; + in { + s = table { + unit => table { + NCard => table { + Masc => table { c => masc.s ! n ! c } ; + Fem => table { c => fem.s ! n ! c } + } ; + NOrd => table { + g => table { c => ord ! g ! Sg ! c } --FIXME - pazaudējam kārtas skaitļu daudzskaitli - 'mēs palikām piektie' + } + } ; + teen => table { + NCard => table { g => table { c => stem_teen + "padsmit" } } ; + NOrd => table { g => table { c => padsmit ! g ! Sg ! c } } + } ; + ten => table { + NCard => table { g => table { c => stem_ten + "desmit" } } ; + NOrd => table { g => table { c => desmit ! g ! Sg ! c } } + } + } + }; + + simts : CardOrd => Gender => Number => Case => Str = let + card = mkNoun_D1 "simts" ; + ord = mkAdjective_Pos "simtais" Def ; + in table { + NCard => table { + _ => table { n => table { c => card.s ! n ! c }} + } ; + NOrd => table { + g => table { n => table { c => ord ! g ! n ! c }} + } + }; + + tuukstotis : CardOrd => Gender => Number => Case => Str = let + card = mkNoun_D2 "tūkstotis" True; + ord = mkAdjective_Pos "tūkstošais" Def ; + in table { + NCard => table { + _ => table { n => table { c => card.s ! n ! c }} + } ; + NOrd => table { + g => table { n => table { c => ord ! g ! n ! c }} + } + }; {- diff --git a/lib/src/latvian/ParadigmsNounsLav.gf b/lib/src/latvian/ParadigmsNounsLav.gf index 1cb923ca4..847edfa8c 100644 --- a/lib/src/latvian/ParadigmsNounsLav.gf +++ b/lib/src/latvian/ParadigmsNounsLav.gf @@ -1,27 +1,53 @@ --- Latvian noun paradigms - by Normunds Grūzītis; copied off mini-grammar as of 2011-07-12 +-- Latvian noun paradigms - by Normunds Grūzītis & Pēteris Paikens -resource ParadigmsNounsLav = open - (Predef=Predef), - Prelude, +resource ParadigmsNounsLav = open + (Predef=Predef), + Prelude, ResLav, CatLav in { flags - coding = utf8; - + coding = utf8 ; + oper Noun : Type = {s : Number => Case => Str ; g : Gender} ; - - masculine : Gender = Masc ; - feminine : Gender = Fem ; + ProperNoun : Type = {s : Case => Str; g : Gender; n : Number} ; --- NOUNS + masculine : Gender = Masc ; + feminine : Gender = Fem ; -- No parameters - default assumptions (gender, declension, palatalization) mkNoun : Str -> Noun = \lemma -> mkNounByPal lemma True ; + mkProperNoun : Str -> Number -> ProperNoun = \lemma,number -> + let noun = mkNoun lemma + in { + s = table { + c => noun.s ! number ! c + } ; + g = noun.g ; + n = number + } ; + +{- + mkCardinalNumeral : Str -> CardinalNumeral = \lemma -> + let + stem : Str = cutStem lemma; + masc = mkNoun_D1 lemma; + fem = mkNoun_D4 lemma + "a" Fem + in { + s = table { + Masc => table { + + } ; + Fem => table { + } ; + } + } +-} + -- Specified palatalization; default gender and declension mkNounByPal : Str -> Bool -> Noun = \lemma,pal -> case lemma of { @@ -94,23 +120,28 @@ oper -- Expected endings of a D1 lemma: -- Sg: -s, -š -- Pl: -i + -- should be provided only in the case of plural mass nouns + -- produces an incorrect Sg.Nom form if plural lemma is given + -- the incorrect Sg.Nom forms should be filtered out by a domain lexicon mkNoun_D1 : Str -> Noun = \lemma -> let stem : Str = cutStem lemma in { s = table { Sg => table { - Nom => lemma ; -- FIXME: if Pl lemma (-i) => -s or -š?! (default rule, explicit parameter) + Nom => lemma ; Gen => stem + "a" ; Dat => stem + "am" ; Acc => stem + "u" ; - Loc => stem + "ā" + Loc => stem + "ā" ; + Voc => stem } ; Pl => table { Nom => stem + "i" ; Gen => stem + "u" ; Dat => stem + "iem" ; Acc => stem + "us" ; - Loc => stem + "os" + Loc => stem + "os" ; + Voc => stem + "i" } } ; g = Masc @@ -118,25 +149,30 @@ oper -- Expected endings of a D2 lemma: -- Sg: -is, -s + -- -s is expected only in the case of few predefined exceptions -- Pl: -i - -- Note: ending -s is expected only in the case of few predefined exceptions + -- should be provided only in the case of plural mass nouns + -- produces an incorrect Sg.Nom form if plural lemma is given + -- the incorrect Sg.Nom forms should be filtered out by a domain lexicon mkNoun_D2 : Str -> Bool -> Noun = \lemma,pal -> let stem : Str = cutStem lemma in { s = table { Sg => table { - Nom => lemma ; -- FIXME: if Pl lemma (-i) => -is or -s?! (exceptions only - default rules only?) + Nom => lemma ; Gen => case lemma of {#exception_D2_1 + "s" => lemma ; _ => palatalize stem pal + "a"} ; Dat => stem + "im" ; Acc => stem + "i" ; - Loc => stem + "ī" + Loc => stem + "ī" ; + Voc => stem + "i" } ; Pl => table { Nom => palatalize stem pal + "i" ; Gen => palatalize stem pal + "u" ; Dat => palatalize stem pal + "iem" ; Acc => palatalize stem pal + "us" ; - Loc => palatalize stem pal + "os" + Loc => palatalize stem pal + "os" ; + Voc => palatalize stem pal + "i" } } ; g = Masc @@ -154,14 +190,16 @@ oper Gen => stem + "us" ; Dat => stem + "um" ; Acc => stem + "u" ; - Loc => stem + "ū" + Loc => stem + "ū" ; + Voc => stem + "u" } ; Pl => table { Nom => stem + "i" ; Gen => stem + "u" ; Dat => stem + "iem" ; Acc => stem + "us" ; - Loc => stem + "os" + Loc => stem + "os" ; + Voc => stem + "i" } } ; g = Masc @@ -179,14 +217,16 @@ oper Gen => stem + "as" ; Dat => case gend of {Fem => stem + "ai" ; Masc => stem + "am"} ; Acc => stem + "u" ; - Loc => stem + "ā" + Loc => stem + "ā" ; + Vod => stem + "a" } ; Pl => table { Nom => stem + "as" ; Gen => stem + "u" ; Dat => stem + "ām" ; Acc => stem + "as" ; - Loc => stem + "ās" + Loc => stem + "ās" ; + Voc => stem + "as" } } ; g = gend @@ -204,14 +244,16 @@ oper Gen => stem + "es" ; Dat => case gend of {Fem => stem + "ei" ; Masc => stem + "em"} ; Acc => stem + "i" ; - Loc => stem + "ē" + Loc => stem + "ē" ; + Voc => stem + "e" } ; Pl => table { Nom => stem + "es" ; Gen => palatalize stem pal + "u" ; Dat => stem + "ēm" ; Acc => stem + "es" ; - Loc => stem + "ēs" + Loc => stem + "ēs" ; + Voc => stem + "es" } } ; g = gend @@ -231,7 +273,8 @@ oper Gen => stem + "s" ; Dat => case gend of {Fem => stem + "ij" ; Masc => stem + "im"} ; Acc => stem + "i" ; - Loc => stem + "ī" + Loc => stem + "ī" ; + Voc => stem + "s" } } ; Pl => table { @@ -239,7 +282,8 @@ oper Gen => palatalize stem pal + "u" ; Dat => stem + "īm" ; Acc => stem + "is" ; - Loc => stem + "īs" + Loc => stem + "īs" ; + Voc => stem + "is" } } ; g = gend @@ -256,14 +300,16 @@ oper Gen => stem + "šanās" ; Dat => NON_EXISTENT ; Acc => stem + "šanos" ; - Loc => NON_EXISTENT + Loc => NON_EXISTENT ; + Voc => stem + "šanās" } ; Pl => table { Nom => stem + "šanās" ; Gen => stem + "šanos" ; Dat => NON_EXISTENT ; Acc => stem + "šanās" ; - Loc => NON_EXISTENT + Loc => NON_EXISTENT ; + Voc => stem + "šanās" } } ; g = Fem @@ -278,6 +324,8 @@ oper exception_D4 : pattern Str = #(_ + "puik") ; exception_D6 : pattern Str = #(_ + "ļaud") ; + + -- Auxiliaries cutStem : Str -> Str = \lemma -> diff --git a/lib/src/latvian/ParadigmsPronounsLav.gf b/lib/src/latvian/ParadigmsPronounsLav.gf index 698005528..20c9209bf 100644 --- a/lib/src/latvian/ParadigmsPronounsLav.gf +++ b/lib/src/latvian/ParadigmsPronounsLav.gf @@ -11,8 +11,7 @@ flags coding = utf8; oper - Pron : Type = {s : Number => Case => Str ; p : Person} ; - PronGend : Type = {s : Gender => Number => Case => Str ; p : Person} ; + PronGend : Type = {s : Gender => Number => Case => Str} ; -- PRONOUNS (incl. 'determiners') @@ -35,14 +34,16 @@ oper Gen => stem + "a" ; Dat => stem + "am" ; Acc => stem + "u" ; - Loc => stem + "ā" + Loc => stem + "ā" ; + Voc => NON_EXISTENT } ; Pl => table { Nom => stem + "i" ; Gen => stem + "u" ; Dat => stem + "iem" ; Acc => stem + "us" ; - Loc => stem + "os" + Loc => stem + "os" ; + Voc => NON_EXISTENT } } ; Fem => table { @@ -51,18 +52,19 @@ oper Gen => stem + "as" ; Dat => stem + "ai" ; Acc => stem + "u" ; - Loc => stem + "ā" + Loc => stem + "ā" ; + Voc => NON_EXISTENT } ; Pl => table { Nom => stem + "as" ; Gen => stem + "u" ; Dat => stem + "ām" ; Acc => stem + "as" ; - Loc => stem + "ās" + Loc => stem + "ās" ; + Voc => NON_EXISTENT } } } ; - p = P3 } ; -- A special case (paradigm) of Gender=>Number=>Case P3 pronouns @@ -80,14 +82,16 @@ oper Gen => stem + suff2 ; Dat => stem + suff1 + "m" ; Acc => stem + "o" ; - Loc => stem + "ajā" + Loc => stem + "ajā" ; + Voc => NON_EXISTENT } ; Pl => table { Nom => stem + "ie" ; Gen => stem + "o" ; Dat => stem + "iem" ; Acc => stem + "os" ; - Loc => stem + "ajos" + Loc => stem + "ajos" ; + Voc => NON_EXISTENT } } ; Fem => table { @@ -96,18 +100,19 @@ oper Gen => stem + suff2 + "s" ; Dat => stem + "ai" ; Acc => stem + "o" ; - Loc => stem + "ajā" + Loc => stem + "ajā" ; + Voc => NON_EXISTENT } ; Pl => table { Nom => stem + suff2 + "s" ; Gen => stem + "o" ; Dat => stem + suff2 + "m" ; Acc => stem + suff2 + "s" ; - Loc => stem + "ajās" + Loc => stem + "ajās" ; + Voc => NON_EXISTENT } } } ; - p = P3 } ; } ; diff --git a/lib/src/latvian/ParadigmsVerbsLav.gf b/lib/src/latvian/ParadigmsVerbsLav.gf index 81afa0627..c1dbc310c 100644 --- a/lib/src/latvian/ParadigmsVerbsLav.gf +++ b/lib/src/latvian/ParadigmsVerbsLav.gf @@ -1,4 +1,4 @@ --- Latvian verb paradigms - by Pēteris Paikens & Normunds Grūzītis, copied off mini-grammar as of 2011-07-12 +-- Latvian verb paradigms - by Pēteris Paikens & Normunds Grūzītis resource ParadigmsVerbsLav = open (Predef=Predef), @@ -8,14 +8,11 @@ resource ParadigmsVerbsLav = open in { flags - coding = utf8; + coding = utf8 ; -oper - Verb : Type = {s : Polarity => VerbForm => Str} ; +oper Verb_TMP : Type = {s : VerbForm => Str} ; --- VERBS - -- Second and third conjugations mkVerb : Str -> VerbConj -> Verb = \lemma,conj -> { s = table { @@ -84,7 +81,7 @@ oper Indicative P1 Pl Fut => pal_C1_1 stem3 stem + "sim" ; Indicative P1 Pl Past => stem3 + "ām" ; - Indicative P2 Sg Pres => pal_C1_2 stem3 stem2 ; + Indicative P2 Sg Pres => stem3 ; Indicative P2 Sg Fut => pal_C1_1 stem3 stem + "si" ; Indicative P2 Sg Past => stem3 + "i" ; Indicative P2 Pl Pres => stem2 + "at" ; @@ -104,28 +101,11 @@ oper Debitive => "jā" + stem2 ; DebitiveRelative => "jā" + stem2 + "ot" ; - - Participle Masc Sg Nom => pal_C1_4 stem3 + "is" ; - Participle Masc Sg Gen => pal_C1_3 stem3 + "uša" ; - Participle Masc Sg Dat => pal_C1_3 stem3 + "ušam" ; - Participle Masc Sg Acc => pal_C1_3 stem3 + "ušu" ; - Participle Masc Sg Loc => pal_C1_3 stem3 + "ušā" ; - Participle Masc Pl Nom => pal_C1_3 stem3 + "uši" ; - Participle Masc Pl Gen => pal_C1_3 stem3 + "ušu" ; - Participle Masc Pl Dat => pal_C1_3 stem3 + "ušiem" ; - Participle Masc Pl Acc => pal_C1_3 stem3 + "ušus" ; - Participle Masc Pl Loc => pal_C1_3 stem3 + "ušos" ; - - Participle Fem Sg Nom => pal_C1_3 stem3 + "usi" ; - Participle Fem Sg Gen => pal_C1_3 stem3 + "ušas" ; - Participle Fem Sg Dat => pal_C1_3 stem3 + "ušai" ; - Participle Fem Sg Acc => pal_C1_3 stem3 + "ušu" ; - Participle Fem Sg Loc => pal_C1_3 stem3 + "ušā" ; - Participle Fem Pl Nom => pal_C1_3 stem3 + "ušas" ; - Participle Fem Pl Gen => pal_C1_3 stem3 + "ušu" ; - Participle Fem Pl Dat => pal_C1_3 stem3 + "ušām" ; - Participle Fem Pl Acc => pal_C1_3 stem3 + "ušas" ; - Participle Fem Pl Loc => pal_C1_3 stem3 + "ušās" + + Imperative Sg => stem3 ; + Imperative Pl => stem3 + "iet" ; + + Participle g n c => participle_normal_l g n c (pal_C1_3 stem3) (pal_C1_4 stem3) } } ; @@ -164,28 +144,11 @@ oper Debitive => "jā" + stem ; DebitiveRelative => "jā" + stem + "jot" ; - - Participle Masc Sg Nom => stem + "jis" ; - Participle Masc Sg Gen => stem + "juša" ; - Participle Masc Sg Dat => stem + "jušam" ; - Participle Masc Sg Acc => stem + "jušu" ; - Participle Masc Sg Loc => stem + "jušā" ; - Participle Masc Pl Nom => stem + "juši" ; - Participle Masc Pl Gen => stem + "jušu" ; - Participle Masc Pl Dat => stem + "jušiem" ; - Participle Masc Pl Acc => stem + "jušus" ; - Participle Masc Pl Loc => stem + "jušos" ; - - Participle Fem Sg Nom => stem + "jusi" ; - Participle Fem Sg Gen => stem + "jušas" ; - Participle Fem Sg Dat => stem + "jušai" ; - Participle Fem Sg Acc => stem + "jušu" ; - Participle Fem Sg Loc => stem + "jušā" ; - Participle Fem Pl Nom => stem + "jušas" ; - Participle Fem Pl Gen => stem + "jušu" ; - Participle Fem Pl Dat => stem + "jušām" ; - Participle Fem Pl Acc => stem + "jušas" ; - Participle Fem Pl Loc => stem + "jušās" + + Imperative Sg => stem ; + Imperative Pl => stem + "jiet"; + + Participle g n c => participle_normal g n c (stem + "j") } } ; @@ -224,28 +187,11 @@ oper Debitive => pal_C3_3 stem ; DebitiveRelative => pal_C3_3 stem + "ot" ; + + Imperative Sg => pal_C3_1 stem + "i" ; + Imperative Pl => pal_C3_1 stem + "iet"; - Participle Masc Sg Nom => stem + "jis" ; - Participle Masc Sg Gen => stem + "juša" ; - Participle Masc Sg Dat => stem + "jušam" ; - Participle Masc Sg Acc => stem + "jušu" ; - Participle Masc Sg Loc => stem + "jušā" ; - Participle Masc Pl Nom => stem + "juši" ; - Participle Masc Pl Gen => stem + "jušu" ; - Participle Masc Pl Dat => stem + "jušiem" ; - Participle Masc Pl Acc => stem + "jušus" ; - Participle Masc Pl Loc => stem + "jušos" ; - - Participle Fem Sg Nom => stem + "jusi" ; - Participle Fem Sg Gen => stem + "jušas" ; - Participle Fem Sg Dat => stem + "jušai" ; - Participle Fem Sg Acc => stem + "jušu" ; - Participle Fem Sg Loc => stem + "jušā" ; - Participle Fem Pl Nom => stem + "jušas" ; - Participle Fem Pl Gen => stem + "jušu" ; - Participle Fem Pl Dat => stem + "jušām" ; - Participle Fem Pl Acc => stem + "jušas" ; - Participle Fem Pl Loc => stem + "jušās" + Participle g n c => participle_normal g n c (stem + "j") } } ; @@ -287,28 +233,11 @@ oper Debitive => "jā" + stem2 + "as" ; DebitiveRelative => "jā" + stem2 + "oties" ; + + Imperative Sg => pal_C1_2 stem3 stem2 + "ies" ; + Imperative Pl => pal_C1_2 stem3 stem2 + "ieties" ; - Participle Masc Sg Nom => pal_C1_4 stem3 + "ies" ; - Participle Masc Sg Gen => NON_EXISTENT ; - Participle Masc Sg Dat => NON_EXISTENT ; - Participle Masc Sg Acc => pal_C1_3 stem3 + "ušos" ; - Participle Masc Sg Loc => NON_EXISTENT ; - Participle Masc Pl Nom => pal_C1_3 stem3 + "ušies" ; - Participle Masc Pl Gen => pal_C1_3 stem3 + "ušos" ; - Participle Masc Pl Dat => NON_EXISTENT ; - Participle Masc Pl Acc => pal_C1_3 stem3 + "ušos" ; - Participle Masc Pl Loc => NON_EXISTENT ; - - Participle Fem Sg Nom => pal_C1_3 stem3 + "usies" ; - Participle Fem Sg Gen => pal_C1_3 stem3 + "ušās" ; - Participle Fem Sg Dat => NON_EXISTENT ; - Participle Fem Sg Acc => pal_C1_3 stem3 + "ušos" ; - Participle Fem Sg Loc => NON_EXISTENT ; - Participle Fem Pl Nom => pal_C1_3 stem3 + "ušās" ; - Participle Fem Pl Gen => pal_C1_3 stem3 + "ušos" ; - Participle Fem Pl Dat => NON_EXISTENT ; - Participle Fem Pl Acc => pal_C1_3 stem3 + "ušos" ; - Participle Fem Pl Loc => NON_EXISTENT + Participle g n c => participle_reflexive_l g n c (pal_C1_3 stem3) (pal_C1_4 stem3) } } ; @@ -347,28 +276,11 @@ oper Debitive => "jā" + stem + "jas" ; DebitiveRelative => "jā" + stem + "joties" ; + + Imperative Sg => stem + "jies" ; + Imperative Pl => stem + "jieties" ; - Participle Masc Sg Nom => stem + "jies" ; - Participle Masc Sg Gen => NON_EXISTENT ; - Participle Masc Sg Dat => NON_EXISTENT ; - Participle Masc Sg Acc => stem + "jušos" ; - Participle Masc Sg Loc => NON_EXISTENT ; - Participle Masc Pl Nom => stem + "jušies" ; - Participle Masc Pl Gen => stem + "jušos" ; - Participle Masc Pl Dat => NON_EXISTENT ; - Participle Masc Pl Acc => stem + "jušos" ; - Participle Masc Pl Loc => NON_EXISTENT ; - - Participle Fem Sg Nom => stem + "jusies" ; - Participle Fem Sg Gen => stem + "jušās" ; - Participle Fem Sg Dat => NON_EXISTENT ; - Participle Fem Sg Acc => stem + "jušos" ; - Participle Fem Sg Loc => NON_EXISTENT ; - Participle Fem Pl Nom => stem + "jušās" ; - Participle Fem Pl Gen => stem + "jušos" ; - Participle Fem Pl Dat => NON_EXISTENT ; - Participle Fem Pl Acc => stem + "jušās" ; - Participle Fem Pl Loc => NON_EXISTENT + Participle g n c => participle_reflexive g n c (stem + "j") } } ; @@ -408,33 +320,18 @@ oper Debitive => pal_C3_6 stem + "s" ; DebitiveRelative => pal_C3_6 stem + "oties" ; - Participle Masc Sg Nom => stem + "jies" ; - Participle Masc Sg Gen => NON_EXISTENT ; - Participle Masc Sg Dat => NON_EXISTENT ; - Participle Masc Sg Acc => stem + "jušos" ; - Participle Masc Sg Loc => NON_EXISTENT ; - Participle Masc Pl Nom => stem + "jušies" ; - Participle Masc Pl Gen => stem + "jušos" ; - Participle Masc Pl Dat => NON_EXISTENT ; - Participle Masc Pl Acc => stem + "jušos" ; - Participle Masc Pl Loc => NON_EXISTENT ; - - Participle Fem Sg Nom => stem + "jusies" ; - Participle Fem Sg Gen => stem + "jušās" ; - Participle Fem Sg Dat => NON_EXISTENT ; - Participle Fem Sg Acc => stem + "jušos" ; - Participle Fem Sg Loc => NON_EXISTENT ; - Participle Fem Pl Nom => stem + "jušās" ; - Participle Fem Pl Gen => stem + "jušos" ; - Participle Fem Pl Dat => NON_EXISTENT ; - Participle Fem Pl Acc => stem + "jušās" ; - Participle Fem Pl Loc => NON_EXISTENT + Imperative Sg => pal_C3_1 stem + "ies" ; + Imperative Pl => pal_C3_1 stem + "ieties" ; + + Participle g n c => participle_reflexive g n c (stem + "j") } } ; mkVerb_Irreg : Str -> Verb = \lemma -> case lemma of { - "būt" => mkVerb_toBe + "būt" => mkVerb_toBe ; + "iet" => mkVerb_Walk ; + "gulēt" => mkVerb_Sleep } ; mkVerb_toBe : Verb = { @@ -456,6 +353,43 @@ oper } } } ; + + mkVerb_Walk : Verb = { + s = table { + Pos => table { + Indicative P3 _ Pres => "iet" ; + Debitive => "jāiet" ; + x => (mkVerb_C1 "iet" "eju" "gāju" ).s ! x -- the incorrect form 'esu' will be overriden + } ; + Neg => table { + Indicative P3 _ Pres => "neiet" ; + Debitive => NON_EXISTENT; + DebitiveRelative => NON_EXISTENT; + x => (mkVerb_C1 "neiet" "neeju" "negāju" ).s ! x -- the incorrect form 'neesu' will be overriden + } + } + } ; + + mkVerb_Sleep : Verb = { + s = table { + Pos => table { + Indicative P2 Sg Pres => (mkVerb_C3 "gulēt").s ! Indicative P2 Sg Pres; + Indicative p n Pres => (mkVerb_C3 "guļēt").s ! Indicative p n Pres; + Relative Pres => (mkVerb_C3 "guļēt").s ! Relative Pres; + Debitive => (mkVerb_C3 "guļēt").s ! Debitive; + DebitiveRelative => (mkVerb_C3 "guļēt").s ! DebitiveRelative; + x => (mkVerb_C3 "gulēt").s ! x + } ; + Neg => table { + Indicative P2 Sg Pres => (mkVerb_C3 "negulēt").s ! Indicative P2 Sg Pres; + Indicative p n Pres => (mkVerb_C3 "neguļēt").s ! Indicative p n Pres; + Relative Pres => (mkVerb_C3 "neguļēt").s ! Relative Pres; + Debitive => NON_EXISTENT; + DebitiveRelative => NON_EXISTENT; + x => (mkVerb_C3 "negulēt").s ! x + } + } + } ; -- Auxiliaries (palatalization rules) @@ -465,9 +399,10 @@ oper s + "s" => case stem3 of { _ + "d" => s + "dī" ; _ + "t" => s + "tī" ; - _ + "s" => s + "sī" ; + _ + "s" => s + "sī" ; _ => stem } ; + s + "z" => s + "zī" ; -- lauzt -> lauzīs _ => stem } ; @@ -478,7 +413,12 @@ oper _ + "s" => s + "s" ; _ => stem } ; - s + "ž" => s + "d" ; + s + "t" => case stem of { + _ + "met" => stem ; + _ + "cērt" => stem; + _ => s + "ti" + } ; + -- s + "ž" => s + "d" ; -- aizkomentēts jo noveda pie laužu -> laud nevis lauz s + "ļ" => s + "l" ; s + "mj" => s + "m" ; s + "bj" => s + "b" ; @@ -520,14 +460,7 @@ oper -- Ref. to the Java implementation: mija5 pal_C3_3 : Str -> Str = \stem -> - "jā" + - case stem of { - s + "dā" => s + "d" ; - s + "ā" => s + "a" ; - s + "cī" => s + "ka" ; - s + "ī" => s + "a" ; - _ => Predef.tk 1 stem - } ; + "jā" + pal_C3_5 stem ; -- Ref. to the Java implementation: mija8 pal_C3_4 : Str -> Str = \stem -> @@ -558,5 +491,89 @@ oper s + "inā" => s + "inā" ; _ => Predef.tk 1 stem + "a" } ; + + + -- Participle paradigms + participle_normal : Gender -> Number -> Case -> Str -> Str = \g,n,c, stem -> participle_normal_l g n c stem stem; + participle_normal_l : Gender -> Number -> Case -> Str -> Str -> Str = \g,n,c, stem, lemma_stem -> + case g of { + Masc => case n of { + Sg => case c of { + Nom => lemma_stem + "is" ; + Gen => stem + "uša" ; + Dat => stem + "ušam" ; + Acc => stem + "ušu" ; + Loc => stem + "ušā" ; + Voc => NON_EXISTENT + } ; + Pl => case c of { + Nom => stem + "uši" ; + Gen => stem + "ušu" ; + Dat => stem + "ušiem" ; + Acc => stem + "ušus" ; + Loc => stem + "ušos" ; + Voc => NON_EXISTENT + } + } ; + Fem => case n of { + Sg => case c of { + Nom => stem + "usi" ; + Gen => stem + "ušas" ; + Dat => stem + "ušai" ; + Acc => stem + "ušu" ; + Loc => stem + "ušā" ; + Voc => NON_EXISTENT + }; + Pl => case c of { + Nom => stem + "ušas" ; + Gen => stem + "ušu" ; + Dat => stem + "ušām" ; + Acc => stem + "ušas" ; + Loc => stem + "ušās" ; + Voc => NON_EXISTENT + } + } + } ; + + participle_reflexive : Gender -> Number -> Case -> Str -> Str = \g,n,c, stem -> participle_reflexive_l g n c stem stem; + participle_reflexive_l : Gender -> Number -> Case -> Str -> Str -> Str = \g,n,c, stem, lemma_stem -> + case g of { + Masc => case n of { + Sg => case c of { + Nom => lemma_stem + "ies" ; + Gen => NON_EXISTENT ; + Dat => NON_EXISTENT ; + Acc => stem + "ušos" ; + Loc => NON_EXISTENT ; + Voc => NON_EXISTENT + } ; + Pl => case c of { + Nom => stem + "ušies" ; + Gen => stem + "ušos" ; + Dat => NON_EXISTENT ; + Acc => stem + "ušos" ; + Loc => NON_EXISTENT ; + Voc => NON_EXISTENT + } + } ; + Fem => case n of { + Sg => case c of { + Nom => stem + "usies" ; + Gen => stem + "ušās" ; + Dat => NON_EXISTENT ; + Acc => stem + "ušos" ; + Loc => NON_EXISTENT ; + Voc => NON_EXISTENT + }; + Pl => case c of { + Nom => stem + "ušās" ; + Gen => stem + "ušos" ; + Dat => NON_EXISTENT ; + Acc => stem + "ušos" ; + Loc => NON_EXISTENT ; + Voc => NON_EXISTENT + } + } + } ; } ; diff --git a/lib/src/latvian/PhraseLav.gf b/lib/src/latvian/PhraseLav.gf index cc2922f8a..7157c70fc 100644 --- a/lib/src/latvian/PhraseLav.gf +++ b/lib/src/latvian/PhraseLav.gf @@ -1,29 +1,29 @@ -concrete PhraseLav of Phrase = CatLav ** open Prelude, ResLav in { +concrete PhraseLav of Phrase = CatLav ** open Prelude, ResLav, VerbLav in { +flags + coding = utf8; + lin PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ; - UttS s = s ; + + UttS s = {s = s.s} ; + UttQS qs = {s = qs.s } ; + UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! Sg } ; + UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Pl } ; + UttImpPol pol imp = {s = pol.s ++ "lūdzu" ++ imp.s ! pol.p ! Pl } ; + + UttNP np = {s = np.s ! Nom} ; + UttCN n = {s = n.s ! Indef ! Sg ! Nom} ; + UttAP ap = {s = ap.s ! Indef ! Masc ! Sg ! Nom} ; + UttAdv adv = adv ; + UttVP vp = {s = build_VP vp Pos Infinitive (AgP3 Pl Masc)} ; --FIXME - neesmu līdz galam drošs vai agreement ir tieši (AgPr Pl) + UttIP ip = { s = ip.s ! Nom }; + UttIAdv iadv = iadv ; + UttCard n = { s = n.s ! Masc ! Nom}; NoPConj = {s = []} ; NoVoc = {s = []} ; - -{- - - UttQS qs = {s = qs.s ! QDir} ; - UttImpSg pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Sg False} ; - UttImpPl pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Pl False} ; - UttImpPol pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Sg True} ; - - UttIP ip = {s = ip.s ! Nom} ; --- Acc also - UttIAdv iadv = iadv ; - UttNP np = {s = np.s ! Nom} ; - UttVP vp = {s = infVP False vp (agrP3 Sg)} ; - UttAdv adv = adv ; - UttCN n = {s = n.s ! Sg ! Nom} ; - UttCard n = {s = n.s ! Nom} ; - UttAP ap = {s = ap.s ! agrP3 Sg} ; - - PConjConj conj = {s = conj.s2} ; --- - - VocNP np = {s = "," ++ np.s ! Nom} ; --} + + VocNP np = {s = "," ++ np.s ! ResLav.Voc} ; + PConjConj conj = {s = conj.s2} ; + } diff --git a/lib/src/latvian/QuestionLav.gf b/lib/src/latvian/QuestionLav.gf index 882baeaa3..c5c7e017e 100644 --- a/lib/src/latvian/QuestionLav.gf +++ b/lib/src/latvian/QuestionLav.gf @@ -1,55 +1,51 @@ -concrete QuestionLav of Question = CatLav ** open ResLav, Prelude in { -{- - flags optimize=all_subs ; +concrete QuestionLav of Question = CatLav ** open ResLav, VerbLav, Prelude, ParadigmsVerbsLav in { + flags + optimize=all_subs ; + coding = utf8; lin - QuestCl cl = { - s = \\t,a,p => - let cls = cl.s ! t ! a ! p - in table { - QDir => cls ! OQuest ; - QIndir => "if" ++ cls ! ODir - } ---- "whether" in ExtEng - } ; + s = \\m,p => "vai" ++ cl.s ! m ! p + } ; + + QuestVP ip vp = { + s = \\m,p => ip.s ! Nom ++ buildVerb vp.v m p (AgP3 ip.n Masc) + } ; + + QuestSlash ip slash = { + s = \\m,p => slash.p.s ++ ip.s ! (slash.p.c ! ip.n) ++ slash.s ! m ! p + } ; + + QuestIAdv iadv cl = { + s = \\m,p => iadv.s ++ cl.s ! m ! p ; + }; + + QuestIComp icomp np = { + s = \\m,p => icomp.s ++ buildVerb mkVerb_toBe m p np.a ++ np.s ! Nom + }; - QuestVP qp vp = - let cl = mkClause (qp.s ! Nom) (agrP3 qp.n) vp - in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! ODir} ; - - QuestSlash ip slash = - mkQuestion (ss (slash.c2 ++ ip.s ! Acc)) slash ; - --- stranding in ExratEng - - QuestIAdv iadv cl = mkQuestion iadv cl ; - - QuestIComp icomp np = - mkQuestion icomp (mkClause (np.s ! Nom) np.a (predAux auxBe)) ; - - - PrepIP p ip = {s = p.s ++ ip.s ! Acc} ; + IdetQuant idet num = { + s = \\g => idet.s ! g ! num.n ++ num.s ! g ! Nom ; + n = num.n + } ; AdvIP ip adv = { s = \\c => ip.s ! c ++ adv.s ; n = ip.n - } ; - + } ; + + PrepIP p ip = {s = p.s ++ ip.s ! (p.c ! ip.n)} ; + IdetCN idet cn = { - s = \\c => idet.s ++ cn.s ! idet.n ! c ; + s = \\c => idet.s ! cn.g ++ cn.s ! Def ! idet.n ! c ; n = idet.n - } ; + } ; IdetIP idet = { - s = \\c => idet.s ; + s = \\c => (idet.s ! Masc) | (idet.s ! Fem) ; n = idet.n - } ; + } ; - IdetQuant idet num = { - s = idet.s ! num.n ++ num.s ! Nom ; - n = num.n - } ; - - CompIAdv a = a ; + CompIAdv a = a ; CompIP p = ss (p.s ! Nom) ; --} } diff --git a/lib/src/latvian/RelativeLav.gf b/lib/src/latvian/RelativeLav.gf index be0994e6b..db1bf1630 100644 --- a/lib/src/latvian/RelativeLav.gf +++ b/lib/src/latvian/RelativeLav.gf @@ -1,42 +1,46 @@ -concrete RelativeLav of Relative = CatLav ** open ResLav in { -{- - flags optimize=all_subs ; +concrete RelativeLav of Relative = CatLav ** open ResLav, VerbLav in { +flags optimize=all_subs ; lin RelCl cl = { - s = \\t,a,p,_ => "such" ++ "that" ++ cl.s ! t ! a ! p ! ODir ; - c = Nom - } ; - + s = \\m,p,_ => "ka" ++ cl.s ! m ! p + } ; + RelVP rp vp = { - s = \\t,ant,b,ag => - let - agr = case rp.a of { - RNoAg => ag ; - RAg a => a - } ; - cl = mkClause (rp.s ! RC (fromAgr agr).g Nom) agr vp - in - cl.s ! t ! ant ! b ! ODir ; - c = Nom - } ; + s = \\m,p,ag => rp.s ! Nom ++ buildVerb vp.v m p (toAgr (fromAgr ag).n P3 (fromAgr ag).g) ++ vp.s2 ! ag + } ; + + RelSlash rp slash = { -- FIXME - vrdu secba; nevis 'kas ml viu' bet 'kas viu ml' + s = \\m,p,ag => + slash.p.s ++ rp.s ! (slash.p.c ! Sg) ++ slash.s ! m ! p ; + } ; + {- -- Pied piping: "at which we are looking". Stranding and empty -- relative are defined in $ExtraEng.gf$ ("that we are looking at", -- "we are looking at"). - RelSlash rp slash = { - s = \\t,a,p,agr => - slash.c2 ++ rp.s ! RPrep (fromAgr agr).g ++ slash.s ! t ! a ! p ! ODir ; - c = Acc - } ; FunRP p np rp = { s = \\c => np.s ! Acc ++ p.s ++ rp.s ! RPrep (fromAgr np.a).g ; a = RAg np.a } ; - + -} + --FIXME placeholder + FunRP p np rp = { s = \\_ => NON_EXISTENT } ; + + IdRP = { + s = table { + Nom => "kas"; + Gen => "k"; + Dat => "kam"; + Acc => "ko"; + Loc => "kur"; + ResLav.Voc => NON_EXISTENT + } + }; + {- IdRP = { s = table { RC _ Gen => "whose" ; @@ -47,6 +51,5 @@ concrete RelativeLav of Relative = CatLav ** open ResLav in { RPrep _ => "whom" } ; a = RNoAg - } ; --} + } ; -} } diff --git a/lib/src/latvian/ResLav.gf b/lib/src/latvian/ResLav.gf index 8286bd5d3..0f90643d3 100644 --- a/lib/src/latvian/ResLav.gf +++ b/lib/src/latvian/ResLav.gf @@ -13,7 +13,7 @@ resource ResLav = ParamX ** open Prelude in { param -- Nouns - Case = Nom | Gen | Dat | Acc | Loc ; + Case = Nom | Gen | Dat | Acc | Loc | Voc; Gender = Masc | Fem ; Restriction = AllForms | SgOnly | PlOnly | SgGenOnly | PlGenOnly ; NounDecl = D0 | D1 | D2 | D3 | D4 | D5 | D6 | DR ; @@ -21,6 +21,7 @@ resource ResLav = ParamX ** open Prelude in { -- Adjectives Definite = Indef | Def ; AdjType = AdjQual | AdjRel | AdjIndecl ; + AForm = AAdj Degree Definite Gender Number Case | AAdv Degree; --TODO prveidot uz du formu lai ir ar apstka vrdi kas atvasinti no pabas vrdiem -- Verbs -- Ind = Indicative @@ -28,14 +29,18 @@ resource ResLav = ParamX ** open Prelude in { -- Deb = Debitive (Latvian specific: http://www.isocat.org/rest/dc/3835) -- Condit = Conditional -- DebitiveRelative - the relative subtype of debitive - VerbForm = Infinitive | Indicative Person Number Tense | Relative Tense | Debitive | - DebitiveRelative | Participle Gender Number Case ; -- Imperative nav pielikts, bet tur ir kaut kdas patnbas globlaj ParamsX modul par imperatvu + VerbForm = Infinitive | Indicative Person Number Tense | Relative Tense | Debitive | Imperative Number | + DebitiveRelative | Participle Gender Number Case ; + -- TODO - divdabim noteikt forma un ar prk / visprk pakpe VerbMood = Ind Anteriority Tense | Rel Anteriority Tense | Deb Anteriority Tense | Condit Anteriority ; VerbConj = C2 | C3 ; - Agr = Ag Gender Number ; + --Agr = Ag Gender Number ; + Agr = AgP1 Number | AgP2 Number | AgP3 Number Gender ; ThisOrThat = This | That ; + CardOrd = NCard | NOrd ; + DForm = unit | teen | ten ; oper @@ -48,7 +53,40 @@ resource ResLav = ParamX ** open Prelude in { NON_EXISTENT : Str = "NON_EXISTENT" ; + Verb : Type = {s : Polarity => VerbForm => Str} ; + VP = {v : Verb ; s2 : Agr => Str} ; -- s2 = object(s), complements, adverbial modifiers. + VPSlash = VP ** {p : prep} ; -- princip rekur ir objekts kuram jau kaut kas ir bet ir vl viena brva valence.. + prep = {s : Str; 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 + toAgr : Number -> Person -> Gender -> Agr = \n,p,g -> + case p of { + P1 => AgP1 n ; + P2 => AgP2 n ; + P3 => AgP3 n g + } ; + fromAgr : Agr -> {n : Number ; p : Person ; g : Gender} = \a -> case a of { + AgP1 n => {n = n ; p = P1 ; g = Masc} ; --fixme 'es esmu skaista' failos... + AgP2 n => {n = n ; p = P2 ; g = Masc} ; -- fixme 'tu esi skaista' failos... + AgP3 n g => {n = n ; p = P3 ; g = g} + } ; + + conjAgr : Agr -> Agr -> Agr = \a0,b0 -> + let a = fromAgr a0 ; b = fromAgr b0 + in + toAgr + (conjNumber a.n b.n) + (conjPerson a.p b.p) --FIXME - personu apvienoana ir tricky un ir juztaisa korekti + (conjGender a.g b.g) ; + + conjGender : Gender -> Gender -> Gender = \a,b -> + case a of { + Fem => b ; + _ => Masc + } ; + + agrgP3 : Number -> Gender -> Agr = \n,g -> toAgr n P3 g ; + {- -- Agreement of $NP$ has 8 values. $Gender$ is needed for "who"/"which" and -- for "himself"/"herself"/"itself". diff --git a/lib/src/latvian/SentenceLav.gf b/lib/src/latvian/SentenceLav.gf index 25046a11b..adacbd6e7 100644 --- a/lib/src/latvian/SentenceLav.gf +++ b/lib/src/latvian/SentenceLav.gf @@ -1,91 +1,52 @@ -concrete SentenceLav of Sentence = CatLav ** open Prelude, ResLav, ParadigmsVerbsLav in { +concrete SentenceLav of Sentence = CatLav ** open Prelude, ResLav, VerbLav in { flags optimize=all_subs ; - lin +lin + PredVP np vp = mkClause np vp; + + ImpVP vp = { + s = \\pol, n => vp.v.s ! pol ! (Imperative n) ++ vp.s2 ! (AgP2 n) + } ; + + SlashVP np vp = + mkClause np vp ** {p = vp.p} ; + AdvSlash slash adv = { + s = \\m,p => slash.s ! m ! p ++ adv.s ; + p = slash.p + } ; + SlashPrep cl prep = cl ** {p = prep}; + SlashVS np vs slash = mkClause np (lin VP {v = vs; s2 = \\_ => "," ++ vs.subj.s ++ slash.s}) ** {p = slash.p}; + + ComplVS v s = {v = v; s2 = \\_ => "," ++ v.subj.s ++ s.s}; + + EmbedS s = {s = "ka" ++ s.s} ; --TODO - noekot kpc te ir tiei 'ka' + EmbedQS qs = {s = qs.s } ; + EmbedVP vp = {s = build_VP vp Pos Infinitive (AgP3 Pl Masc)} ; --FIXME - neesmu ldz galam dros vai agreement ir tiei (AgPr Pl) UseCl t p cl = {s = t.s ++ p.s ++ cl.s ! (Ind t.a t.t) ! p.p} ; + UseQCl t p cl = {s = t.s ++ p.s ++ cl.s ! (Ind t.a t.t) ! p.p} ; + UseRCl t p cl = + { s = \\ag => t.s ++ p.s ++ cl.s ! (Ind t.a t.t) ! p.p ! ag } | + { s = \\ag => t.s ++ p.s ++ cl.s ! (Rel t.a t.t) ! p.p ! ag }; + UseSlash t p slash = {s = t.s ++ p.s ++ slash.s ! (Ind t.a t.t) ! p.p; p = slash.p}; - PredVP np vp = - let - part = vp.v.s ! ResLav.Pos ! (Participle np.g np.n Nom) ; - obj = vp.obj ! (Ag np.g np.n) - in { + --FIXME placeholder + AdvS a s = { s = NON_EXISTENT } ; + +oper + mkClause : NP -> VP -> Cl = \np,vp -> lin Cl { s = \\mood,pol => - case mood of { -- Subject - Deb _ _ => np.s ! Dat ; + case mood of { -- Subject + Deb _ _ => np.s ! Dat ; -- FIXME jeko valences, reizm ar stenbas izteiksm - 'man patk kaut kas' _ => np.s ! Nom - } ++ - case mood of { -- Verb - Ind Simul tense => vp.v.s ! pol ! (Indicative np.p np.n tense) ; - Ind Anter tense => mkVerb_toBe.s ! pol ! (Indicative np.p np.n tense) ++ part ; - - Rel _ Past => ResLav.NON_EXISTENT ; -- FIXME (?) - Rel Simul tense => vp.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) ++ - vp.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) ++ vp.v.s ! ResLav.Pos ! Debitive ; - - Condit Simul => vp.v.s ! pol ! (Indicative np.p np.n Cond) ; - Condit Anter => mkVerb_toBe.s ! pol ! (Indicative np.p np.n Cond) ++ part - } ++ - obj -- Object + } ++ + buildVerb vp.v mood pol np.a ++ -- Verb + vp.s2 ! np.a -- Object(s), complements, adverbial modifiers; } ; - + {- - PredVP np vp = mkClause (np.s ! Nom) np.a vp ; - PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ; - ImpVP vp = { - s = \\pol,n => - let - agr = AgP2 (numImp n) ; - verb = infVP True vp agr ; - dont = case pol of { - CNeg True => "don't" ; - CNeg False => "do" ++ "not" ; - _ => [] - } - in - dont ++ verb - } ; - - SlashVP np vp = - mkClause (np.s ! Nom) np.a vp ** {c2 = vp.c2} ; - - AdvSlash slash adv = { - s = \\t,a,b,o => slash.s ! t ! a ! b ! o ++ adv.s ; - c2 = slash.c2 - } ; - - SlashPrep cl prep = cl ** {c2 = prep.s} ; - - SlashVS np vs slash = - mkClause (np.s ! Nom) np.a - (insertObj (\\_ => conjThat ++ slash.s) (predV vs)) ** - {c2 = slash.c2} ; - - EmbedS s = {s = conjThat ++ s.s} ; - EmbedQS qs = {s = qs.s ! QIndir} ; - EmbedVP vp = {s = infVP False vp (agrP3 Sg)} ; --- agr - - UseCl t p cl = { - s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! ODir - } ; - UseQCl t p cl = { - s = \\q => t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! q - } ; - UseRCl t p cl = { - s = \\r => t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! r ; - c = cl.c - } ; - UseSlash t p cl = { - s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! ODir ; - c2 = cl.c2 - } ; AdvS a s = {s = a.s ++ "," ++ s.s} ; diff --git a/lib/src/latvian/StructuralLav.gf b/lib/src/latvian/StructuralLav.gf index 07df1de29..e1628260f 100644 --- a/lib/src/latvian/StructuralLav.gf +++ b/lib/src/latvian/StructuralLav.gf @@ -1,6 +1,5 @@ concrete StructuralLav of Structural = CatLav ** - open MorphoLav, ResLav, ParadigmsLav, ParadigmsPronounsLav, MakeStructuralLav, - (C = ConstructX), Prelude in { + open MorphoLav, ResLav, ParadigmsLav, ParadigmsPronounsLav, MakeStructuralLav, Prelude in { flags optimize = all ; @@ -24,23 +23,349 @@ lin n = Pl ; d = Indef } ; + + this_Quant = { + s = (mkPronoun_ThisThat This).s ; + d = Def + } ; + + that_Quant = { + s = (mkPronoun_ThisThat That).s ; + d = Def + } ; + i_Pron = { + s = table { + Nom => "es"; + Gen => "manis"; + Dat => "man"; + Acc => "mani"; + Loc => "manī"; + Voc => NON_EXISTENT + } ; + possessive = table { + Masc => table { + Sg => table { + Nom => "mans"; + Gen => "mana"; + Dat => "manam"; + Acc => "manu"; + Loc => "manā"; + Voc => "mans" + }; + Pl => table { + Nom => "mani"; + Gen => "manu"; + Dat => "maniem"; + Acc => "manus"; + Loc => "manos"; + Voc => "mani" + } + } ; + Fem => table { + Sg => table { + Nom => "mana"; + Gen => "manas"; + Dat => "manai"; + Acc => "manu"; + Loc => "manā"; + Voc => "mana" + }; + Pl => table { + Nom => "manas"; + Gen => "manu"; + Dat => "manām"; + Acc => "manas"; + Loc => "manās"; + Voc => "manas" + } + } + } ; + a = AgP1 Sg ; + } ; + + we_Pron = { + s = table { + Nom => "mēs"; + Gen => "mūsu"; + Dat => "mums"; + Acc => "mūs"; + Loc => "mūsos"; + Voc => NON_EXISTENT + } ; + possessive = table { + _ => table { + _ => table { + _ => "mūsu" + } + } + } ; + a = AgP1 Pl ; + } ; + + youSg_Pron = { + s = table { + Nom => "tu"; + Gen => "tevis"; + Dat => "tev"; + Acc => "tevi"; + Loc => "tevī"; + Voc => "tu" + } ; + possessive = table { + Masc => table { + Sg => table { + Nom => "tavs"; + Gen => "tava"; + Dat => "tavam"; + Acc => "tavu"; + Loc => "tavā" ; + Voc => "tavs" + }; + Pl => table { + Nom => "tavi"; + Gen => "tavu"; + Dat => "taviem"; + Acc => "tavus"; + Loc => "tavos"; + Voc => "tavi" + } + } ; + Fem => table { + Sg => table { + Nom => "tava"; + Gen => "tavas"; + Dat => "tavai"; + Acc => "tavu"; + Loc => "tavā"; + Voc => "tava" + }; + Pl => table { + Nom => "tavas"; + Gen => "tavu"; + Dat => "tavām"; + Acc => "tavas"; + Loc => "tavās"; + Voc => "tavas" + } + } + } ; + a = AgP2 Sg ; + } ; + + youPl_Pron = { + s = table { + Nom => "jūs"; + Gen => "jūsu"; + Dat => "jums"; + Acc => "jūs"; + Loc => "jūsos"; + Voc => "jūs" + } ; + possessive = table { + _ => table { + _ => table { + _ => "jūsu" + } + } + } ; + a = AgP2 Pl ; + } ; + + youPol_Pron = { + s = table { + Nom => "jūs"; + Gen => "jūsu"; + Dat => "jums"; + Acc => "jūs"; + Loc => "jūsos"; + Voc => "jūs" + } ; + possessive = table { + _ => table { + _ => table { + _ => "jūsu" + } + } + } ; + a = AgP2 Pl ; + } ; + + he_Pron = { + s = (\\c => (mkPronoun_Gend "viņš").s ! Masc ! Sg ! c) ; + possessive = table { + _ => table { + _ => table { + _ => "viņa" + } + } + } ; + a = AgP3 Sg Masc ; + } ; + + she_Pron = { + s = (\\c => (mkPronoun_Gend "viņš").s ! Fem ! Sg ! c) ; + possessive = table { + _ => table { + _ => table { + _ => "viņas" + } + } + } ; + a = AgP3 Sg Fem ; + } ; + + they_Pron = { + s = (\\c => (mkPronoun_Gend "viņš").s ! Masc ! Pl ! c) ; + possessive = table { + _ => table { + _ => table { + _ => "viņu" + } + } + } ; + a = AgP3 Pl Masc ; + } | + { + s = (\\c => (mkPronoun_Gend "viņš").s ! Fem ! Pl ! c) ; + possessive = table { + _ => table { + _ => table { + _ => "viņu" + } + } + } ; + a = AgP3 Pl Fem ; + } ; + + it_Pron = { + s = \\c => (mkPronoun_ThisThat That).s ! Masc ! Sg ! c; + possessive = table { _ => table { _ => table { _ => "tā" }}}; + a = AgP3 Sg Masc + } | { + s = \\c => (mkPronoun_ThisThat That).s ! Fem ! Sg ! c; + possessive = table { _ => table { _ => table { _ => "tās" }}}; + a = AgP3 Sg Fem + }; + + -- manuprāt prievārdi tomēr ir valodas-specifiski un nebūtu tieši 1-pret-1 jātulko + above_Prep = mkPrep "virs" Gen Dat; + after_Prep = mkPrep "pēc" Gen Dat; + before_Prep = mkPrep "pirms" Gen Dat; + behind_Prep = mkPrep "aiz" Gen Dat; + between_Prep = mkPrep "starp" Acc Dat; + for_Prep = mkPrep "priekš" 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 ; + to_Prep = mkPrep "līdz" Dat Dat; --FIXME - ļoti dažādi tulkojas + possess_Prep = mkPrep Gen ; --FIXME - reku vajadzētu vārdu secību otrādi, ka pirms paskaidrojamā vārda likt + under_Prep = mkPrep "zem" Gen Dat; + with_Prep = mkPrep "ar" Acc Dat; + without_Prep = mkPrep "bez" Gen Dat; + + very_AdA = mkAdA "ļoti" ; + almost_AdA = mkAdA "gandrīz" ; + so_AdA = mkAdA "tik" ; + too_AdA = mkAdA "pārāk" ; + + and_Conj = mkConj "un" ; + or_Conj = mkConj "vai" Sg ; + + but_PConj = ss "bet" ; + otherwise_PConj = ss "tomēr" ; --? + therefore_PConj = ss "tātad" ; --? + + more_CAdv = (mkCAdv [] "nekā" Compar) | (mkCAdv "vairāk" "nekā" Posit); + less_CAdv = mkCAdv "mazāk" "nekā" Posit; + as_CAdv = mkCAdv "tikpat" "kā" Posit; + + here_Adv = mkAdv "šeit" ; + there_Adv = mkAdv "tur" ; + + both7and_DConj = mkConj "gan" ("," ++ "gan"); --FIXME - komati nav tā kā vajag + either7or_DConj = mkConj ("vai" ++ "nu") ("," ++ "vai") Sg ; --FIXME - komati nav tā kā vajag + + want_VV = mkVV (mkV "gribēt" third_conjugation) ; + + whoSg_IP = { + s = table { + Nom => "kurš"; -- FIXME - Fem? + Gen => "kura"; + Dat => "kuram"; + Acc => "kuru"; + Loc => "kurā"; + Voc => NON_EXISTENT + }; + n = Sg + }; + whoPl_IP = { + s = table { + Nom => "kuri"; + Gen => "kuru"; + Dat => "kuriem"; + Acc => "kurus"; + Loc => "kuros"; + Voc => NON_EXISTENT + }; + n = Pl + }; + + why_IAdv = ss "kāpēc" ; + how_IAdv = ss "kā" ; + how8much_IAdv = ss "cik daudz" ; + when_IAdv = ss "kad" ; + where_IAdv = ss "kur" ; + + which_IQuant = {s = table { + Masc => table { Sg => "kurš"; Pl => "kuri"}; + Fem => table { Sg => "kura"; Pl => "kuras"} + } + } ; + + when_Subj = ss "kad" ; + although_Subj = ss "kaut arī" ; + because_Subj = ss "jo" ; + if_Subj = ss "ja" ; + that_Subj = ss "ka" ; -- ja pareizi saprotu šo konkrēto 'that' pielietojumu + + all_Predet = { s = table { + Masc => "visi"; + Fem => "visas" + } + }; + only_Predet = { s = table { _ => "tikai"} }; + most_Predet = { s = table { _ => "vairums"} }; + + yes_Utt = ss "jā" ; + please_Voc = ss "lūdzu" ; + + almost_AdN = mkAdN "gandrīz" ; + at_least_AdN = mkAdN "vismaz" ; + at_most_AdN = mkAdN "ne vairāk kā" ; + + always_AdV = mkAdV "vienmēr" ; + +--FIXME placeholder + by8agent_Prep = mkPrep NON_EXISTENT Nom Nom; + whatSg_IP = {s = \\_ => NON_EXISTENT; n= Sg}; + +oper + reflPron : Case => Str = table { + Nom => NON_EXISTENT; + Gen => "sevis"; + Dat => "sev"; + Acc => "sevi"; + Loc => "sevī"; + Voc => NON_EXISTENT + } ; + + lai_Subj = ss "lai" ; + kameer_Subj = ss "kamēr" ; + {- - above_Prep = mkPrep "above" ; - after_Prep = mkPrep "after" ; - all_Predet = ss "all" ; - almost_AdA = mkAdA "almost" ; - almost_AdN = mkAdN "almost" ; - although_Subj = ss "although" ; - always_AdV = mkAdV "always" ; - and_Conj = mkConj "and" ; - because_Subj = ss "because" ; - before_Prep = mkPrep "before" ; - behind_Prep = mkPrep "behind" ; - between_Prep = mkPrep "between" ; - both7and_DConj = mkConj "both" "and"; - but_PConj = ss "but" ; by8agent_Prep = mkPrep "by" ; by8means_Prep = mkPrep "by" ; can8know_VV, can_VV = { @@ -56,31 +381,17 @@ lin isAux = True } ; during_Prep = mkPrep "during" ; - either7or_DConj = mkConj "either" "or" singular ; everybody_NP = regNP "everybody" singular ; every_Det = mkDeterminer singular "every" ; everything_NP = regNP "everything" singular ; everywhere_Adv = mkAdv "everywhere" ; few_Det = mkDeterminer plural "few" ; --- first_Ord = ss "first" ; DEPRECATED - for_Prep = mkPrep "for" ; - from_Prep = mkPrep "from" ; - he_Pron = mkPron "he" "him" "his" "his" singular P3 masculine ; - here_Adv = mkAdv "here" ; here7to_Adv = mkAdv ["to here"] ; here7from_Adv = mkAdv ["from here"] ; - how_IAdv = ss "how" ; - how8much_IAdv = ss "how much" ; how8many_IDet = mkDeterminer plural ["how many"] ; - if_Subj = ss "if" ; in8front_Prep = mkPrep ["in front of"] ; - i_Pron = mkPron "I" "me" "my" "mine" singular P1 human ; - in_Prep = mkPrep "in" ; - it_Pron = mkPron "it" "it" "its" "its" singular P3 nonhuman ; - less_CAdv = C.mkCAdv "less" "than" ; many_Det = mkDeterminer plural "many" ; - more_CAdv = C.mkCAdv "more" "than" ; - most_Predet = ss "most" ; much_Det = mkDeterminer singular "much" ; must_VV = { s = table { @@ -96,54 +407,26 @@ lin } ; ---b no_Phr = ss "no" ; no_Utt = ss "no" ; - on_Prep = mkPrep "on" ; ---- one_Quant = mkDeterminer singular "one" ; -- DEPRECATED - only_Predet = ss "only" ; - or_Conj = mkConj "or" singular ; - otherwise_PConj = ss "otherwise" ; part_Prep = mkPrep "of" ; - please_Voc = ss "please" ; - possess_Prep = mkPrep "of" ; quite_Adv = mkAdv "quite" ; - she_Pron = mkPron "she" "her" "her" "hers" singular P3 feminine ; - so_AdA = mkAdA "so" ; somebody_NP = regNP "somebody" singular ; - someSg_Det = mkDeterminer singular "some" ; - somePl_Det = mkDeterminer plural "some" ; something_NP = regNP "something" singular ; somewhere_Adv = mkAdv "somewhere" ; that_Quant = mkQuant "that" "those" ; - there_Adv = mkAdv "there" ; there7to_Adv = mkAdv "there" ; there7from_Adv = mkAdv ["from there"] ; - therefore_PConj = ss "therefore" ; - they_Pron = mkPron "they" "them" "their" "theirs" plural P3 human ; this_Quant = mkQuant "this" "these" ; through_Prep = mkPrep "through" ; - too_AdA = mkAdA "too" ; - to_Prep = mkPrep "to" ; - under_Prep = mkPrep "under" ; - very_AdA = mkAdA "very" ; - want_VV = mkVV (regV "want") ; - we_Pron = mkPron "we" "us" "our" "ours" plural P1 human ; + whatPl_IP = mkIP "what" "what" "what's" plural ; whatSg_IP = mkIP "what" "what" "what's" singular ; - when_IAdv = ss "when" ; - when_Subj = ss "when" ; - where_IAdv = ss "where" ; - which_IQuant = {s = \\_ => "which"} ; ---b whichPl_IDet = mkDeterminer plural ["which"] ; ---b whichSg_IDet = mkDeterminer singular ["which"] ; whoPl_IP = mkIP "who" "whom" "whose" plural ; whoSg_IP = mkIP "who" "whom" "whose" singular ; - why_IAdv = ss "why" ; - without_Prep = mkPrep "without" ; - with_Prep = mkPrep "with" ; + ---b yes_Phr = ss "yes" ; - yes_Utt = ss "yes" ; - youSg_Pron = mkPron "you" "you" "your" "yours" singular P2 human ; - youPl_Pron = mkPron "you" "you" "your" "yours" plural P2 human ; - youPol_Pron = mkPron "you" "you" "your" "yours" singular P2 human ; not_Predet = {s = "not" ; lock_Predet = <>} ; no_Quant = mkQuant "no" "no" "none" "none" ; @@ -151,15 +434,9 @@ lin nobody_NP = regNP "nobody" singular ; nothing_NP = regNP "nothing" singular ; - at_least_AdN = mkAdN "at least" ; - at_most_AdN = mkAdN "at most" ; - except_Prep = mkPrep "except" ; - - as_CAdv = C.mkCAdv "as" "as" ; - + have_V2 = dirV2 (mk5V "have" "has" "had" "had" "having") ; - that_Subj = ss "that" ; lin language_title_Utt = ss "English" ; -} } diff --git a/lib/src/latvian/VerbLav.gf b/lib/src/latvian/VerbLav.gf index f899dddfc..52c360532 100644 --- a/lib/src/latvian/VerbLav.gf +++ b/lib/src/latvian/VerbLav.gf @@ -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 valencm, lai ir semantisks 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 testts +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} ; -} }