diff --git a/lib/src/polish/AdjectiveMorphoPol.gf b/lib/src/polish/AdjectiveMorphoPol.gf new file mode 100644 index 000000000..c86ad7665 --- /dev/null +++ b/lib/src/polish/AdjectiveMorphoPol.gf @@ -0,0 +1,198 @@ +--# -path=.:../prelude:../common +--# -coding=utf8 + +-- A Polish adjective Resource Morphology + +-- Adam Slaski, 2009 + + +resource AdjectiveMorphoPol = ResPol ** open Prelude, (Predef=Predef) in { + + flags coding=utf8; + +-- Polish adjectives and adverbs have three degrees. Some of them have +-- comparative and superlative forms compound of the adverb 'bardzo' (in +-- proper degree) and the positive form like this: +-- chory / bardziej chory / najbardziej chory (ill / more ill / most ill). +-- The others have simple forms: +-- miły / milszy / najmilszy (kind / kinder / kindest). + +-- Polish adjective in particular degree is inflected by case, number and +-- gender, however each of them has at most only 11 different forms, +-- as ilustrated on the following table from +-- the article by Zygmunt Saloni ("Rygorystyczny opis polskiej deklinacji +-- przymiotnikowej" [in:] "Zeszyty naukowe Wydziału Humanistycznego +-- Uniwersytetu Gdańskiego. Filologia polska. Prace językoznawcze" nr 16 +-- year 1992). + +-- m1, m2 and m3 mean respectivly masculine personal, masculine animate +-- and masculine inanimate. -m1 means all genders but m1. + +-- sg pl +-- m1 m2 m3 n f m1 -m1 +-- --------------------------- +-- N |1 1 1 5 6 9 5 +-- G |2 2 2 2 7 10 10 +-- D |3 3 3 3 7 4 4 +-- A |2 2 1 5 8 10 5 +-- I |4 4 4 4 8 11 11 +-- L |4 4 4 4 7 10 10 +-- (V = N) + + +-- oper adj11forms : Type = { s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11 : Str }; +-- +-- oper Adj : Type = { +-- pos : adj11forms; +-- comp : adj11forms; +-- super : adj11forms; +-- advpos : Str; +-- advcomp : Str; +-- advsuper : Str; +-- }; + + -- temat na spółgłoskę miękką + + oper model1 : Str -> adj11forms = \form -> -- glupi + let stem = Predef.tk 1 form in + { + s1=stem + "i"; s2=stem + "iego"; s3=stem + "iemu"; s4=stem + "im"; + s5=stem + "ie"; s6=stem + "ia"; s7=stem + "iej"; s8=stem + "ią"; + s9=stem + "i"; s10=stem + "ich"; s11=stem + "imi" + }; + + oper model1l : Str -> adj11forms = \form -> -- chocholi + let stem = Predef.tk 1 form in + { + s1=stem + "i"; s2=stem + "ego"; s3=stem + "emu"; s4=stem + "im"; + s5=stem + "e"; s6=stem + "a"; s7=stem + "ej"; s8=stem + "ą"; + s9=stem + "i"; s10=stem + "ich"; s11=stem + "imi" + }; + + oper model1j : Str -> adj11forms = \form -> -- żmii + let stem = Predef.tk 1 form in + { + s1=stem + "i"; s2=stem + "jego"; s3=stem + "jemu"; s4=stem + "im"; + s5=stem + "je"; s6=stem + "ja"; s7=stem + "jej"; s8=stem + "ją"; + s9=stem + "i"; s10=stem + "ich"; s11=stem + "imi" + }; + +-- temat na spłgłoskę stwardniałą + + oper model2 : Str -> adj11forms = \form -> -- wilczy + let stem = Predef.tk 1 form in + { + s1=stem + "y"; s2=stem + "ego"; s3=stem + "emu"; s4=stem + "ym"; + s5=stem + "e"; s6=stem + "a"; s7=stem + "ej"; s8=stem + "ą"; + s9=stem + "y"; s10=stem + "ych"; s11=stem + "ymi" + }; + +-- temat na spółgłoskę tylnojęzykową (k lub g) + + oper model3k : Str -> adj11forms = \form -> -- dziki + let stem = Predef.tk 2 form in + { + s1=stem + "ki"; s2=stem + "kiego"; s3=stem + "kiemu"; s4=stem + "kim"; + s5=stem + "kie"; s6=stem + "ka"; s7=stem + "kiej"; s8=stem + "ką"; + s9=stem + "cy"; s10=stem + "kich"; s11=stem + "kimi" + }; + + oper model3g : Str -> adj11forms = \form -> -- ubogi + let stem = Predef.tk 2 form in + { + s1=stem + "gi"; s2=stem + "giego"; s3=stem + "giemu"; s4=stem + "gim"; + s5=stem + "gie"; s6=stem + "ga"; s7=stem + "giej"; s8=stem + "gą"; + s9=stem + "dzy"; s10=stem + "gich"; s11=stem + "gimi" + }; + +-- temat na spółgłoskę twardą TODO + + oper model4 : Str -> Str -> adj11forms = \form,form9 -> -- glupi + let stem = Predef.tk 1 form in + { + s1=stem + "y"; s2=stem + "ego"; s3=stem + "emu"; s4=stem + "ym"; + s5=stem + "e"; s6=stem + "a"; s7=stem + "ej"; s8=stem + "ą"; + s9=form9; s10=stem + "ych"; s11=stem + "ymi" + }; + + oper model_comp : Str -> adj11forms = \comp -> model4 comp ((Predef.tk 2 comp)+"i"); + + oper guess_model : Str -> adj11forms = \form -> + case form of { + x + ("pi"|"bi"|"fi"|"wi"|"mi"|"si"|"zi"|"ci"|"dzi"|"ni") => model1 form; + x + "li" => model1l form; + x + ("ii"|"yi"|"ai"|"ei"|"oi"|"ui"|"ói") => model1j form; + x + ("czy"|"dży"|"rzy"|"cy"|"dzy") => model2 form; + x + "ki" => model3k form; + x + "gi" => model3g form; + x + "smy" => model4 form (x+"śmi"); + x + "zmy" => model4 form (x+"źmi"); + x + "sty" => model4 form (x+"śći"); + x + "ty" => model4 form (x+"ci"); + x + "zdy" => model4 form (x+"ździ"); + x + "dy" => model4 form (x+"dzi"); + x + "szy" => model4 form (x+"si"); + x + "smy" => model4 form (x+"śmi"); + x + "ży" => model4 form (x+"zi"); + x + "ry" => model4 form (x+"rzy"); + x + "rzły" => model4 form (x+"źli"); --obmierzły - obmierźli (probably misprint in the article) + x + "szły" => model4 form (x+"szli"); + x + "zły" => model4 form (x+"źli"); + x + "ły" => model4 form (x+"li"); + x + "sny" => model4 form (x+"śni"); + x + "zny" => model4 form (x+"źni"); + x + "chy" => model4 form (x+"si"); + x + "hy" => model4 form (x+"zi"); -- błahy - błazi (not really in use) + x + y@("py"|"by"|"fy"|"wy"|"my"|"sy"|"zy"|"ny") => model4 form ((Predef.tk 1 form)+"i") + }; + + -- oper for simple forms + + oper mkRegAdj = overload { + mkRegAdj : Str -> Str -> Str -> Str -> Adj = + \pos, comp, advpos, advcomp -> { + pos = guess_model pos; + comp = model_comp comp; + super = model_comp ("naj" + comp); + advpos = advpos; + advcomp = advcomp; + advsuper = "naj" + advcomp; + }; + mkRegAdj : Str -> Str -> Adj = + \pos, comp -> { + pos = guess_model pos; + comp = model_comp comp; + super = model_comp ("naj" + comp); + advpos = "["++pos ++ [": the adjective positive form does not exist]"]; + advcomp = "["++pos ++ [": the adjective comparative form does not exist]"]; + advsuper = "["++pos ++ [": the adjective superlative form does not exist]"] + }; + }; + + oper mkCompAdj = overload { + mkCompAdj : Str -> Str -> Adj = + \pos, advpos -> { + pos = guess_model pos; + comp = guess_model ("bardziej" ++ pos); + super = guess_model ("najbardziej" ++ pos); + advpos = advpos; + advcomp = ("bardziej" ++ advpos); + advsuper = ("najbardziej" ++ advpos); + }; + mkCompAdj : Str -> Adj = + \pos -> { + pos = guess_model pos; + comp = guess_model ("bardziej" ++ pos); + super = guess_model ("najbardziej" ++ pos); + advpos = "["++pos ++ [": the adjective positive form does not exist]"]; + advcomp = "["++pos ++ [": the adjective comparative form does not exist]"]; + advsuper = "["++pos ++ [": the adjective superlative form does not exist]"] + }; + }; + + addComplToAdj : Adj -> Str -> Case -> (Adj ** { c:Complement }); + addComplToAdj a s c = { pos = a.pos; comp=a.comp; super=a.super; + advpos=a.advpos; advcomp=a.advcomp; advsuper=a.advsuper; + c = mkCompl s c + }; +} diff --git a/lib/src/polish/AdjectivePol.gf b/lib/src/polish/AdjectivePol.gf new file mode 100644 index 000000000..761effb4c --- /dev/null +++ b/lib/src/polish/AdjectivePol.gf @@ -0,0 +1,45 @@ +--# -path=.:../abstract:../common:../prelude + +-- Adam Slaski, 2009 + +concrete AdjectivePol of Adjective = CatPol ** open ResPol, Prelude in { +flags coding=utf8 ; + + lin + + PositA a = { s = mkAtable a.pos; adv = a.advpos}; + + UseComparA a = { s = mkAtable a.comp; adv=a.advcomp}; + + ComparA a np = { s = \\af => (mkAtable a.comp) ! af ++ "niż" ++ np.nom ; adv=a.advcomp }; + + AdjOrd o = {s=o.s; adv="["++o.s!AF MascPersSg Nom ++ [": the adverb form does not exist (fun AdjOrd)]"]}; + + AdAP ada ap = { s = \\af => ada.s ++ ap.s ! af; adv = ada.s ++ ap.adv}; + +-- CAdvAP : CAdv -> AP -> NP -> AP ; -- as cool as John + CAdvAP c a n = { + s = \\af=> c.s ++ a.s!af ++ c.p ++ n.nom; + adv = c.s ++ a.adv ++ c.p ++ n.nom; + }; + +-- ComplA2 : A2 -> NP -> AP ; -- married to her + ComplA2 a n = { + s = \\af=>(mkAtable a.pos)!af ++ a.c.s ++ n.dep!a.c.c; + adv = a.advpos ++ a.c.s ++ n.dep!a.c.c + }; + +-- ReflA2 : A2 -> AP ; -- married to itself + ReflA2 a = { + s = \\af=>(mkAtable a.pos)!af ++ a.c.s ++ siebie!(extract_case!a.c.c); + adv = a.advpos ++ a.c.s ++ siebie!(extract_case!a.c.c) + }; + +-- UseA2 : A2 -> AP ; -- married + UseA2 a = { s = mkAtable a.pos; adv=a.advpos}; + +-- SentAP : AP -> SC -> AP ; -- good that she is here -- I have bad feelling about this function + SentAP a s = {s=\\_=>a.adv ++ s.s; adv=a.adv ++ s.s }; + +}; + diff --git a/lib/src/polish/AdverbPol.gf b/lib/src/polish/AdverbPol.gf new file mode 100644 index 000000000..18af7e6e5 --- /dev/null +++ b/lib/src/polish/AdverbPol.gf @@ -0,0 +1,30 @@ +--# -path=.:../abstract:../common:../prelude + +-- Adam Slaski, 2009 + +concrete AdverbPol of Adverb = CatPol ** open ResPol, Prelude in { + flags coding=utf8 ; + + lin + PositAdvAdj a = {s = a.advpos } ; + +-- ComparAdvAdj : CAdv -> A -> NP -> Adv ; -- more warmly than John + ComparAdvAdj c a n = { + s = c.s ++ a.advpos ++ c.p ++ n.nom + } ; + +-- ComparAdvAdjS : CAdv -> A -> S -> Adv ; -- more warmly than he runs + ComparAdvAdjS c a s = { + s = c.s ++ a.advpos ++ c.p ++ s.s + } ; + +-- AdnCAdv : CAdv -> AdN ; -- less (than five) + AdnCAdv cadv = { s=cadv.sn ++ cadv.pn }; + + + PrepNP na stol = ss (na.s ++ stol.dep ! na.c); + + AdAdv = cc2 ; + + SubjS = cc2 ; +} diff --git a/lib/src/polish/CatPol.gf b/lib/src/polish/CatPol.gf new file mode 100644 index 000000000..63a028745 --- /dev/null +++ b/lib/src/polish/CatPol.gf @@ -0,0 +1,128 @@ +--# -path=.:../abstract:../common:../prelude + +-- Adam Slaski, 2009 + +concrete CatPol of Cat = CommonPol ** open ResPol, Prelude, (R = ParamX) in { + + flags optimize=all_subs; coding=utf8; + + lincat + +---- Tensed/Untensed + + S = {s : Str}; + QS = {s : Str}; + RS = {s : GenNum => Str}; + SSlash = {s : Str; c : Complement}; + +---- Sentence +-- clause (variable tense) e.g. "John walks"/"John walked" + Cl = {s : Polarity => Anteriority => R.Tense => Str}; + ClSlash = {s : Polarity => Anteriority => R.Tense => Str} + ** { c : Complement }; + Imp = { s : Polarity => Number => Str }; + +---- Question + + QCl = {s : Polarity => Anteriority => R.Tense => Str}; + +-- interrogative pronoun "who" + IP = NounPhrase; + +-- interrrogatove complement of copula "where" + IComp = {s : Str}; + +-- interrogative determiner "which" : "który", "jaki" + IDet = IDeterminer; + IQuant = { s : AForm => Str }; + +---- Relative + + RCl = {s : GenNum => Polarity => Anteriority => R.Tense => Str}; + RP = {s : AForm => Str; mgn : MaybeGenNum}; + +-- Verb +-- s - verb +-- s2 - adverbials +-- s3 - object + +---- Adjective + + AP = AdjPhrase; + +---- Noun + +-- CommNoun : Type = { s : SubstForm => Str; g : Gender }; + CN = { s : Number => Case => Str; g : Gender }; + +-- NounPhrase : Type = { s : PronForm => Str; n : Number; g: Gender; p : Person }; + NP = NounPhrase; + +-- oper Pron = { s : PronForm => Str ; sp: AForm => Str ; n : Number ; p : Person ; +-- g: PronGen } ; + Pron = ResPol.Pron; + + Det = Determiner; + Predet = {s : AForm => Str; np:NounPhrase; adj:Bool }; +-- 'all', 'most' and 'only' belong in Polish to three completly different parts of speach + Quant = {s,sp : AForm => Str}; + + +---- Numeral + + Num = { s: Case => Gender => Str; + a:Accom; n : Number; hasCard : Bool }; + Numeral = { s: Case => Gender => Str; + o: AForm => Str; + a:Accom; n:Number }; + Card = { s: Case => Gender => Str; + a:Accom; n:Number }; + Ord = { s: AForm => Str }; + Digits = { s:Str; o:Str; a:Accom; n:Number }; + + +---- Structural + + Conj = {s1,s2,sent1,sent2 : Str}; + Subj = {s : Str}; + Prep = Complement; --{s : Str; c: ComplCase }; + +---- Open lexical classes, e.g. Lexicon + + V = Verb; -- defined in ResPol.gf + V2 = Verb ** { c : Complement }; + V3 = Verb ** { c, c2 : Complement }; + + VV = Verb; -- verb-phrase-complement verb e.g. "want" + VS = Verb; -- sentence-complement verb e.g. "claim" + VQ = Verb; -- question-complement verb e.g. "wonder" +-- VA ; -- adjective-complement verb e.g. "look" + V2V = Verb ** { c : Complement }; -- verb with NP and V complement e.g. "cause" + V2S = Verb ** { c : Complement }; -- verb with NP and S complement e.g. "tell" + V2Q = Verb ** { c : Complement }; -- verb with NP and Q complement e.g. "ask" +-- V2A ; -- verb with NP and AP complement e.g. "paint" + + VA = Verb ** { c:{ c:Case; s:Str; adv:Bool } }; + V2A = Verb ** { c:{ c:Case; s:Str; adv:Bool }; c2:Complement }; + + VPSlash = VerbPhrase ** { c : Complement }; + + VP = VerbPhrase; + Comp = { s: GenNum => Str }; + + Ord = { s : AForm => Str }; + + A = Adj; + A2 = Adj ** { c : Complement }; + + +-- Substantives moreover have an inherent gender. + N = {s : SubstForm => Str; g : Gender}; + + N2 = {s : SubstForm => Str; g : Gender} ** { c : Complement } ; + + N3 = {s : SubstForm => Str; g : Gender} ** { c, c2 : Complement } ; + + PN = NounPhrase; +}; + diff --git a/lib/src/polish/CommonPol.gf b/lib/src/polish/CommonPol.gf new file mode 100644 index 000000000..8d8af3edb --- /dev/null +++ b/lib/src/polish/CommonPol.gf @@ -0,0 +1,34 @@ +concrete CommonPol of Common = open (R = ParamX) in { + + lincat + Text = {s : Str} ; --lock_Text : {}} ; + Phr = {s : Str} ; --lock_Phr : {}} ; + Utt = {s : Str} ; --lock_Utt : {}} ; + Voc = {s : Str} ; --lock_Voc : {}} ; + SC = {s : Str} ; --lock_SC : {}} ; + Adv = {s : Str} ; --lock_Adv : {}} ; + AdV = {s : Str} ; --lock_AdV : {}} ; + AdA = {s : Str} ; --lock_AdA : {}} ; + AdN = {s : Str} ; --lock_AdN : {}} ; + IAdv = {s : Str} ; --lock_IAdv : {}} ; + CAdv = {s,p,sn,pn : Str} ; --lock_CAdv : {}} ; + PConj = {s : Str} ; --lock_PConj : {}} ; + + Temp = {s : Str ; t : R.Tense ; a : R.Anteriority} ; + Tense = {s : Str ; t : R.Tense} ; + Ant = {s : Str ; a : R.Anteriority} ; + Pol = {s : Str ; p : R.Polarity} ; + + lin + TTAnt t a = {s = t.s ++ a.s ; t = t.t ; a = a.a} ; + + PPos = {s = []} ** {p = R.Pos} ; + PNeg = {s = []} ** {p = R.Neg} ; + TPres = {s = []} ** {t = R.Pres} ; + TPast = {s = []} ** {t = R.Past} ; --# notpresent + TFut = {s = []} ** {t = R.Fut} ; --# notpresent + TCond = {s = []} ** {t = R.Cond} ; --# notpresent + ASimul = {s = []} ** {a = R.Simul} ; + AAnter = {s = []} ** {a = R.Anter} ; --# notpresent + +} diff --git a/lib/src/polish/ConjunctionPol.gf b/lib/src/polish/ConjunctionPol.gf new file mode 100644 index 000000000..1c26123a3 --- /dev/null +++ b/lib/src/polish/ConjunctionPol.gf @@ -0,0 +1,88 @@ +--# -path=.:../abstract:../common:../../prelude + +-- Adam Slaski, 2009 + +concrete ConjunctionPol of Conjunction = + CatPol ** open ResPol, Coordination, Prelude in { + + flags optimize=all_subs ; coding=utf8 ; + + lin + + ConjS conj list = { + s = conj.sent1 ++ list.s1 ++ conj.sent2 ++ list.s2; + }; + + ConjAdv conj list = { + s = conj.s1 ++ list.s1 ++ conj.s2 ++ list.s2; + }; + + + ConjNP conj list ={ + nom = conj.s1 ++ list.np1.nom ++ conj.s2 ++ list.np2.nom; + voc = conj.s1 ++ list.np1.voc ++ conj.s2 ++ list.np2.voc; + dep = \\c => conj.s1 ++ list.np1.dep !c ++ conj.s2 ++ list.np2.dep !c; + gn = case of { + <(MascPersSg|MascPersPl), (MascPersSg|MascPersPl)> => MascPersPl; + <_,_> => OthersPl + }; + p = case of { + => P1; + <_, P1> => P1; + => P2; + <_, P2> => P2; + <_,_> => P3 + } + }; + + ConjAP conj list = { + adv = conj.s1 ++ list.ap1.adv ++ conj.s2 ++ list.ap2.adv; + s = \\af=>conj.s1 ++ list.ap1.s!af ++ conj.s2 ++ list.ap2.s!af; + }; + ConjRS = conjunctDistrTable GenNum; + + +-- ---- These fun's are generated from the list cat's. +-- + BaseS = twoSS ; + ConsS = consrSS comma ; + BaseAdv = twoSS ; + ConsAdv = consrSS comma ; + BaseRS = twoTable GenNum ; + ConsRS = consrTable GenNum comma; + + BaseNP np1 np2 = { np1=np1; np2=np2 }; + ConsNP np npl = { np2=npl.np2; + np1 = { + nom = np.nom ++ "," ++ npl.np1.nom; + voc = np.voc ++ "," ++ npl.np1.voc; + dep = \\c => np.dep !c ++ "," ++ npl.np1.dep !c; + gn = case of { + <(MascPersSg|MascPersPl), (MascPersSg|MascPersPl)> => MascPersPl; + <_,_> => OthersPl + }; + p = case of { + => P1; + <_, P1> => P1; + => P2; + <_, P2> => P2; + <_,_> => P3 + } + } + }; + + BaseAP ap1 ap2 = { ap1=ap1; ap2=ap2 }; + ConsAP ap apl = { ap2=apl.ap2; ap1={ + s = \\af=> ap.s!af ++ "," ++ apl.ap1.s!af; + adv = ap.adv ++ "," ++ apl.ap1.adv + } }; + + lincat + + [S] = {s1,s2 : Str} ; + [Adv] = {s1,s2 : Str} ; + [NP] = {np1,np2 : NounPhrase} ; + [AP] = {ap1,ap2 : AdjPhrase} ; + [RS] = {s1,s2 : GenNum => Str} ; + +} diff --git a/lib/src/polish/ExtraPol.gf b/lib/src/polish/ExtraPol.gf new file mode 100644 index 000000000..2d34dc095 --- /dev/null +++ b/lib/src/polish/ExtraPol.gf @@ -0,0 +1,3 @@ +--concrete ExtraPol of ExtraPolAbs = CatPol ** { +-- +-- } diff --git a/lib/src/polish/GrammarPol.gf b/lib/src/polish/GrammarPol.gf new file mode 100644 index 000000000..4b1de6143 --- /dev/null +++ b/lib/src/polish/GrammarPol.gf @@ -0,0 +1,19 @@ +--# -path=.:../abstract:../common:../prelude + +-- Adam Slaski, 2009 + +concrete GrammarPol of Grammar = + NounPol, + VerbPol, + AdjectivePol, + AdverbPol, + NumeralPol, + SentencePol, + QuestionPol, + RelativePol, + ConjunctionPol, + PhrasePol, + TextPol, + StructuralPol, + IdiomPol + ** { flags startcat = Phr ; unlexer = text ; lexer = text ;} ; diff --git a/lib/src/polish/IdiomPol.gf b/lib/src/polish/IdiomPol.gf new file mode 100644 index 000000000..78b6e97c0 --- /dev/null +++ b/lib/src/polish/IdiomPol.gf @@ -0,0 +1,52 @@ +--# -path=.:../abstract:../common:../prelude + +-- Adam Slaski, 2009 + +concrete IdiomPol of Idiom = CatPol ** open Prelude, ResPol, VerbMorphoPol in { + + flags optimize=all_subs ; coding=utf8 ; + + lin + +-- ImpersCl : VP -> Cl ; -- it is hot + ImpersCl vp = { + s = \\pol,anter,tense => + vp.prefix !pol !NeutSg ++ + ((indicative_form vp.verb vp.imienne pol) !) ++ + vp.sufix !pol !NeutSg ++ vp.postfix !pol !NeutSg; + }; + +-- ImpPl1 : VP -> Utt ; -- let's go + ImpPl1 vp = { + s = vp.prefix !Pos !MascPersPl ++ + (imperative_form vp.verb vp.imienne Pos MascPersPl P1) ++ + vp.sufix !Pos !MascPersPl ++ vp.postfix !Pos !MascPersPl; + }; + +-- GenericCl : VP -> Cl ; -- one sleeps + GenericCl vp = { + s = \\pol,anter,tense => + "ktoś" ++ vp.prefix !pol !MascPersSg ++ + ((indicative_form vp.verb vp.imienne pol) !) ++ + vp.sufix !pol !MascPersSg ++ vp.postfix !pol !MascPersSg; + }; + +-- CleftNP : NP -> RS -> Cl ; -- it is I who did it + CleftNP np rs = {s=\\pol,_,_ => "to" ++ (case pol of {Neg=>"nie";Pos=>""}) ++ np.nom ++ rs.s!np.gn }; + +-- CleftAdv : Adv -> S -> Cl ; -- it is here she slept + CleftAdv adv s = {s=\\_,_,_ => adv.s ++ s.s }; + +-- ExistNP : NP -> Cl ; -- there is a house + ExistNP np = {s=\\pol,anter,tense => case pol of { + Pos=> case np.gn of {MascPersPl|OthersPl => "są" ; _=>"jest"} ++ np.nom; -- not in every case + Neg=>["nie ma"] ++ np.dep!GenNoPrep } }; + +-- ExistIP : IP -> QCl ; -- which houses are there + ExistIP ip = {s=\\pol,_,_ => case pol of { + Pos=>ip.nom; -- not in every case + Neg=>ip.dep!GenNoPrep ++ ["nie ma"]} }; + +-- ProgrVP : VP -> VP ; -- be sleeping + ProgrVP vp = vp; +} ; diff --git a/lib/src/polish/LangPol.gf b/lib/src/polish/LangPol.gf new file mode 100644 index 000000000..4c87c7fde --- /dev/null +++ b/lib/src/polish/LangPol.gf @@ -0,0 +1,8 @@ +--# -path=.:../abstract:../common:../prelude + +-- Adam Slaski, 2009 + +concrete LangPol of Lang = + GrammarPol, + LexiconPol + ** { flags startcat = Phr ; unlexer = text ; lexer = text; } ; diff --git a/lib/src/polish/LexiconPol.gf b/lib/src/polish/LexiconPol.gf new file mode 100644 index 000000000..1c9238b25 --- /dev/null +++ b/lib/src/polish/LexiconPol.gf @@ -0,0 +1,386 @@ +--# -path=.:../abstract:../common:../prelude + +-- Ilona Nowak, Wintersemester 2007/08 + +-- Adam Slaski, 2009 + + concrete LexiconPol of Lexicon = CatPol ** + open ParadigmsPol, Prelude, StructuralPol, MorphoPol in { + + flags + optimize =values ; coding =utf8 ; + +lin +-- jury_N = mkIndeclinableNoun "jury" neuter ; -- for undeclinable noun +-- cocoa_N = mkIndeclinableNoun "kakao" neuter ; -- for undeclinable noun +-- menu_N = mkIndeclinableNoun "menu" neuter ; -- for undeclinable noun + art_N = nApteka "sztuka"; + airplane_N = nSad "samolot"; + apartment_N = nDanie "mieszkanie"; + apple_N = nJablko "jabłko"; + baby_N = nCiele "niemowlę"; + bad_A = mkRegAdj "zły" "gorszy" "źle" "gorzej"; + bank_N = nBrzeg "bank"; + beautiful_A = mkRegAdj "piękny" "piękniejszy" "pięknie" "piękniej"; + beer_N = nPiwo "piwo"; + big_A = mkRegAdj "duży" "większy" "dużo" "więcej"; + bike_N = nWal "rower"; + bird_N = nPtak "ptak"; + black_A = mkRegAdj "czarny" "czarniejszy" "czarno" "czarniej"; + blue_A = mkCompAdj "niebieski" "niebiesko"; + boat_N = nLodz "łódź"; + book_N = nMatka "książka"; + boot_N = nBat "but"; + boss_N = nArab "szef"; + boy_N = nChlopiec "chłopiec"; + bread_N = nChleb "chleb"; + broad_A = mkRegAdj "szeroki" "szerszy" "szeroko" "szerzej"; + brother_N2 = mkN2 (nBrat "brat"); + brown_A = mkCompAdj "brązowy" "brązowo"; + butter_N = nTlo "masło"; + camera_N = nSila "kamera"; + cap_N = nMatka "czapka"; + car_N = nOgrod "samochód"; + carpet_N = nDym "dywan"; + cat_N = nKot "kot"; + ceiling_N = nSad "sufit"; + chair_N = nTlo "krzesło"; + cheese_N = nSer "ser"; + child_N = nDziecko "dziecko"; + correct_A = mkCompAdj "poprawny" "poprawnie"; + church_N = nKosciol "kościół"; + city_N = nGniazdo "miasto"; + clean_A = mkRegAdj "czysty" "czystszy" "czysto" "czyściej"; + clever_A = mkRegAdj "mądry" "mądrzejszy" "mądrze" "mądrzej"; + coat_N = nWiersz "płaszcz"; + cold_A = mkRegAdj "zimny" "zimniejszy" "zimno" "zimniej"; + computer_N = nSer "komputer"; + country_N = nGaj "kraj"; + cousin_N = nFacet "kuzyn"; + cow_N = nDoba "krowa"; + dirty_A = mkRegAdj "brudny" "brudniejszy" "brudno" "brudniej"; + doctor_N = nLekarz "lekarz"; + dog_N = nPies "pies"; + door_N = nDrzwi "drzwi"; + dry_A = mkRegAdj "suchy" "suchszy" "sucho" "suszej"; + dull_A = mkRegAdj "tępy" "tępszy" "tępo" "tępiej"; + enemy_N = nWrog "wróg"; + factory_N = nApteka "fabryka"; + far_Adv = ss "daleko"; + father_N2 = mkN2 (nOjciec "ojciec"); + fish_N = nLiczba "ryba"; + floor_N = nDroga "podłoga"; + fridge_N = nMatka "lodówka"; + friend_N = nPrzyjaciel "przyjaciel"; + fruit_N = nGaj "owoc"; + full_A = mkRegAdj "pełny" "pełniejszy" "pełno" "pełniej"; + garden_N = nOgrod "ogród"; + girl_N = nLiczba "dziewczyna"; + glove_N = nUlica "rękawica"; + gold_N = nUdo "złoto"; + good_A = mkRegAdj "dobry" "lepszy" "dobrze" "lepiej"; + grammar_N = nApteka "gramatyka"; + green_A = mkRegAdj "zielony" "zieleńszy" "zielono" "zieleniej"; + harbour_N = nSad "port"; + hat_N = nWiersz "kapelusz"; + hill_N = nSerce "wzgórze"; + horse_N = nKon "koń"; + hot_A = mkRegAdj "gorący" "gorętszy" "gorąco" "goręcej"; + house_N = nDom "dom"; + important_A = mkRegAdj "ważny" "ważniejszy" "ważnie" "ważniej"; + industry_N = nWal "przemysł"; + iron_N = nPiwo "żelazo"; + king_N = nKrol "król"; + lake_N = nZero "jezioro"; + lamp_N = nLiczba "lampa"; + language_N = nKajak "język"; + leather_N = nDoba "wątroba"; + long_A = mkRegAdj "długi" "dłuższy" "długo" "dłużej"; + love_N = nSiec "miłość"; + man_N = nMezczyzna "mężczyzna"; + meat_N = nPiwo "mięso"; + milk_N = nWojsko "mleko"; + moon_N = nWiersz "księżyc"; + mother_N2 = mkN2 (nMatka "matka"); + mountain_N = nSila "góra"; + music_N = nApteka "muzyka"; + narrow_A = mkRegAdj "wąski" "węższy" "wąsko" "węziej"; + new_A = mkRegAdj "nowy" "nowszy" "nowo" "nowiej"; + newspaper_N = nKobieta "gazeta"; + oil_N = nGaj "olej"; + old_A = mkRegAdj "stary" "starszy" "staro" "starzej"; + paper_N = nWal "papier"; + peace_N = nPokoj "pokój"; + pen_N = nMlotek "ołówek"; + planet_N = nKobieta "planeta"; +-- paris_PN = mkPN (nKoc "Paryż"); + plastic_N = nBrzeg "plastyk"; + policeman_N = nFacet "policjant"; + priest_N = nKsiadz "ksiądz"; + queen_N = nKrolowa "królowa"; + radio_N = nStudio "radio"; + red_A = mkRegAdj "czerwony" "czerwieńszy" "czerwono" "czerwieniej"; + religion_N = nLilia "religia"; + restaurant_N = nLilia "restauracja"; + river_N = nApteka "rzeka"; + rock_N = nSila "skała"; + roof_N = nDom "dach"; + rubber_N = nMatka "gumka"; + rule_N = nSila "reguła"; + school_N = nSzkola "szkoła"; + science_N = nApteka "nauka"; + sea_N = nMorze "morze"; + sheep_N = nOwca "owca"; + ship_N = nStatek "statek"; + shirt_N = nFala "koszula"; + shoe_N = nBat "but"; + shop_N = nDym "sklep"; + short_A = mkRegAdj "krótki" "krótszy" "krótko" "krócej"; + silver_N = nZebro "srebro"; + sister_N = nSzkola "siostra"; + small_A = mkRegAdj "mały" "mniejszy" "mało" "mniej"; + snake_N = nWaz "wąż"; + sock_N = nMatka "skarpetka"; + star_N = nGwiazda "gwiazda"; + steel_N = nKapiel "stal"; + stone_N = nCien "kamień"; + stove_N = nKoc "piec"; + student_N = nFacet "student"; + stupid_A = mkRegAdj "głupi" "głupszy" "głupio" "głupiej"; + sun_N = nSerce "słońce"; + table_N = nDol "stół"; + teacher_N = nKowal "nauczyciel"; + television_N = nLilia "telewizja"; + thick_A = mkRegAdj "gruby" "grubszy" "grubo" "grubiej"; + thin_A = mkRegAdj "cienki" "cieńszy" "cienko" "cieniej"; + today_Adv = ss "dziś"; + train_N = nBrzeg "pociąg"; + tree_N = nPiwo "drzewo"; + ugly_A = mkRegAdj "brzydki" "brzydszy" "brzydko" "brzydziej"; + university_N = nSad "uniwersytet"; + village_N = nWies "wieś"; + warm_A = mkRegAdj "ciepły" "cieplejszy" "ciepło" "cieplej"; + war_N = nWojna "wojna"; + water_N = nWoda "woda"; + white_A = mkRegAdj "biały" "bielszy" "biało" "bielej"; + window_N = nOkno "okno"; + wine_N = nPiwo "wino"; + woman_N = nKobieta "kobieta"; + wood_N = nOkno "drewno"; + yellow_A = mkRegAdj "żółty" "żółtszy" "żółto" "żółciej"; + young_A = mkRegAdj "młody" "młodszy" "młodo" "młodziej"; + now_Adv = ss "teraz"; + already_Adv = ss "właśnie"; + song_N = nMatka "piosenka"; + number_N = nLiczba "liczba"; + distance_N3 = mkN3 (nSiec "odległość") from_Prep to_Prep ; +-- fun_AV = mkRegAdj "wesoły"; +-- easy_A2V = mkRegAdj2 (mkRegAdj "łatwy") "dla" genitive ; + empty_A = mkRegAdj "pusty" "puściejszy" "pusto" "puściej"; + married_A2 = addComplToAdj ( mkCompAdj "zaślubiony" ) "" Dat; + probable_AS = mkRegAdj "możliwy" "możliwszy" "możliwie" "możliwiej"; + animal_N = nCiele "zwierzę"; + ashes_N = nPopiol "popiół"; + back_N = nDrzwi "plecy"; + bark_N = nSila "kora"; + belly_N = nMiech "brzuch"; + bird_N = nPtak "ptak"; + blood_N = nKonew "krew"; + bone_N = nKosc "kość"; + breast_N = nSiec "pierś"; + cloud_N = nSila "chmura"; + day_N = nDzien "dzień"; + dust_N = nGaj "kurz"; + ear_N = nUcho "ucho"; + earth_N = nZiemia "ziemia"; + egg_N = nJablko "jajko"; + eye_N = nOko "oko"; + fat_N = nKoc "tłuszsz"; + feather_N = nLiczba "sprężyna"; + fingernail_N = nPien "paznokieć"; + fire_N = nPien "ogień"; + fish_N = nLiczba "ryba"; + flower_N = nKwiat "kwiat"; + fog_N = nMgla "mgła"; + foot_N = nDoba "stopa"; + forest_N = nLas "las"; + fruit_N = nGaj "owoc"; + grass_N = nLiczba "trawa"; + guts_N = nDrzwi "wnętrzności"; + hair_N = nChleb "włos"; + hand_N = nReka "ręka"; + head_N = nDoba "głowa"; + heart_N = nSerce "serce"; + horn_N = nProg "róg"; + husband_N = nMaz "mąż"; + ice_N = nOgrod "lód"; + knee_N = nPiwo "kolano"; + lake_N = nZero "jezioro"; + leaf_N = nLisc "liść"; + leg_N = nDroga "noga"; + liver_N = nDoba "wątroba"; + louse_N = nWesz "wesz"; + meat_N = nPiwo "mięso"; + mountain_N = nSila "góra"; + mouth_N = nDrzwi "usta"; + name_N = nImie "imię"; + neck_N = nLilia "szyja"; +-- neck_N = nBrzeg "kark"; + night_N = nNoc "noc"; + nose_N = nChleb "nos"; + person_N = nDoba "osoba"; + question_N = nDanie "pytanie"; + rain_N = nGaj "deszcz"; + ready_A = mkCompAdj "gotowy"; + reason_N = nOgrod "powód"; + road_N = nDroga "droga"; + root_N = nCien "korzeń"; + rope_N = nLiczba "lina"; + salt_N = nSul "sól"; + sand_N = nStatek "piasek"; + sea_N = nMorze "morze"; + seed_N = nNasienie "nasienie"; + skin_N = nSila "skóra"; + sky_N = nNiebo "niebo"; + smoke_N = nDym "dym"; + snow_N = nBrzeg "śnieg"; + star_N = nGwiazda "gwiazda"; + stick_N = nKajak "patyk"; + tail_N = nChleb "ogon"; + tongue_N = nKajak "język"; + tooth_N = nZab "ząb"; + uncertain_A = mkCompAdj "niepewny" "niepewnie"; + water_N = nWoda "woda"; + wife_N = nLiczba "żona"; + wind_N = nWiatr "wiatr"; + wing_N = nTlo "skrzydło"; + worm_N = nPtak "robak"; + year_N = nRok "rok" "lata"; + heavy_A = mkRegAdj "ciężki" "cięższy" "ciężko" "ciężej"; + near_A = mkRegAdj "bliski" "bliższy" "blisko" "bliżej"; + rotten_A = mkCompAdj "zepsuty"; + round_A = mkRegAdj "okrągły" "okrąglejszy" "okrągło" "okręglej"; + sharp_A = mkRegAdj "ostry" "ostrzejszy" "ostro" "ostrzej"; + smooth_A = mkRegAdj "gładki" "gładszy" "gładko" "gładziej"; + straight_A = mkRegAdj "prosty" "prostszy" "prosto" "prościej"; + wet_A = mkCompAdj "mokry" "mokro"; + wide_A = mkRegAdj "szeroki" "szerszy" "szeroko" "szerzej"; + + right_Ord = { s = mkAtable (guess_model "prawy") }; + left_Ord = { s = mkAtable (guess_model "lewy") }; + + rain_V0 = mkItVerb (mkMonoVerb "padać" conj98 Imperfective); + wonder_VQ = mkItVerb (mkReflVerb (mkV "zastanawiać" conj98 "zastanowić" conj77a)); + fear_VS = mkReflVerb (mkMonoVerb "bać" conjbac Imperfective); + hope_VS = mkItVerb (mkComplicatedVerb (mkMonoVerb "mieć" conj100 Imperfective) "nadzieję"); + know_VS = mkMonoVerb "wiedzieć" conj103 Imperfective; + say_VS = mkV "mówić" conj72 "powiedzieć" conj103; + become_VA = (mkReflVerb (mkV "stawać" conj57 "stać" conj3)) ** {c={c=Nom;s="";adv=False}}; + answer_V2S = mkV2 (mkV "odpowiadać" conj98 "odpowiedzieć" conj103) "" dative; + ask_V2Q = dirV2 (mkV "pytać" conj98 "spytać" conj98); +-- beg_V2V = mkV2 (mkV "prosić" conj83 Imperfective) "" "o" accusative accusative; -- no such verb in Polish; beg is V2S + paint_V2A = (mkV1 "malować" conj53 "pomalować" conj53) ** ({c={c=Nom;s="na";adv=True}; c2={c=AccNoPrep;s=""}}); + + add_V3 = mkV3 (mkV "dodawać" conj57 "dodać" conj99) "" "do" accusative genitive; + sell_V3 = dirV3 (mkV "sprzedawać" conj57 "sprzedać" conj99); + send_V3 = mkV3 (mkV "wysyłać" conj98 "wysłać" conj67 ) "" "do" accusative genitive ; + talk_V3 = mkV3 (mkV "rozmawiać" conj98 "porozmawiać" conj98) "z" "о" instrumental locative; + give_V3 = mkV3 (mkV "dawać" conj57 "dać" conj99) "" "" Dat Acc ; + + fear_V2 = mkV2 (mkReflVerb (mkMonoVerb "bać" conjbac Imperfective)) "" Gen; + hit_V2 = dirV2 (mkV "bić" conj51 "pobić" conj51); + cut_V2 = dirV2 (mkV "ciąć" conj23 "pociąć" conj23); + pull_V2 = dirV2 (mkV "ciągnąć" conj5 "pociągnąć" conj5); + wait_V2 = mkV2 (mkItVerb (mkV "czekać" conj98 "poczekać" conj98)) "na" accusative; + read_V2 = dirV2 (mkV "czytać" conj98 "przeczytać" conj98); + scratch_V2 = dirV2 (mkV "drapać" conj70 "podrapać" conj70); + split_V2 = dirV2 (mkV "dzielić" conj75 "podzielić" conj75); + stab_V2 = dirV2 (mkV "dźgać" conj98 "dźgnąć" conj5); + play_V2 = {-variants {-} mkV2 (mkItVerb (mkV "grać" conj98 "zagrać" conj98)) "w" accusative; +-- mkV2 (mkItVerb (mkV "grać" conj98 "zagrać" conj98)) "na" locative } ; + bite_V2 = dirV2 (mkV "gryźć" conj26a "ugryźć" conj26a); + lose_V2 = dirV2 (mkV "gubić" conj72 "zgubić" conj72); + eat_V2 = dirV2 (mkV "jeść" conj102 "zjeść" conj102); + put_V2 = dirV2 (mkV "kłaść" conj25 "położyć" conj88a); + love_V2 = dirV2 (mkMonoVerb "kochać" conj98 Imperfective); + buy_V2 = dirV2 (mkV "kupić" conj72 "kupować" conj53); + count_V2 = dirV2 (mkV "liczyć" conj87 "policzyć" conj87); + like_V2 = dirV2 (mkV "lubić" conj72em "polubić" conj72); + break_V2 = dirV2 (mkV "łamać" conj70 "złamać" conj70); + wash_V2 = dirV2 (mkV "myć" conj51 "umyć" conj51); + hate_V2 = dirV2 (mkV "nienawidzić" conj80 "znienwidzić" conj80); + watch_V2 = dirV2 (mkV "oglądać" conj98 "obejrzeć" conj94a); + leave_V2 = dirV2 (mkV "opuszczać" conj98 "opuścić" conj84); + open_V2 = dirV2 (mkV "otwierać" conj98 "otworzyć" conj88); + push_V2 = dirV2 (mkV "pchać" conj98 "pchnąć" conj5); + drink_V2 = dirV2 (mkV "pić" conj51 "wypić" conj51); + write_V2 = dirV2 (mkV "pisać" conj60 "napisać" conj60); + hunt_V2 = mkV2 (mkItVerb (mkMonoVerb "polować" conj53 Imperfective)) "na" accusative; + do_V2 = dirV2 (mkV "robić" conj77 "zrobić" conj77); + speak_V2 = mkV2 (mkMonoVerb "rozmawiać" conj98 Imperfective) "z" instrumental; + understand_V2 = dirV2 (mkV "rozumieć" conj101 "zrozumieć" conj101); + throw_V2 = dirV2 (mkV "rzucać" conj98 "rzucić" conj81); + listen_V2 = dirV2 (mkV "słuchać" conj98 "posłuchać" conj98); + hear_V2 = dirV2 (mkV "słyszeć" conj94 "usłyszeć" conj94); + suck_V2 = dirV2 (mkMonoVerb "ssać" conj65 Imperfective); + seek_V2 = dirV2 (mkMonoVerb "szukać" conj98 Imperfective); + wipe_V2 = dirV2 (mkV "wycierać" conj98 "trzeć" conj43); + squeeze_V2 = dirV2 (mkV "ściskać" conj98 "ścisnąć" conj6); + rub_V2 = dirV2 (mkMonoVerb "trzeć" conj43 Imperfective); + hold_V2 = dirV2 (mkMonoVerb "trzymać" conj98 Imperfective); + learn_V2 = dirV2 (mkReflVerb (mkV "uczyć" conj87 "nauczyć" conj87)); + teach_V2 = dirV2 (mkV "uczyć" conj87 "nauczyć" conj87); + fight_V2 = mkV2 (mkItVerb (mkMonoVerb "walczyć" conj87 Imperfective)) "z" instrumental; + tie_V2 = dirV2 (mkMonoVerb "wiązać" conj59 Imperfective); + see_V2 = dirV2 (mkV "widzieć" conj92 "zobaczyć" conj87); + know_V2 = dirV2 (mkMonoVerb "wiedzieć" conj103 Imperfective); + switch8on_V2 = dirV2 (mkV "włączać" conj98 "włączyć" conj87); + win_V2 = dirV2 (mkV "wygrywać" conj98 "wygrać" conj98); + switch8off_V2 = dirV2 (mkV "wyłączać" conj98 "wyłączyć" conj87); + kill_V2 = dirV2 (mkV "zabijać" conj98 "zabić" conj51); + close_V2 = dirV2 (mkV "zamknąć" conj5 "zamykać" conj98); + forget_V2 = dirV2 (mkV "zapominać" conj98 "zapomnieć" conj91); + find_V2 = dirV2 (mkV "znaleźć" conj40 "znajdywać" conj54); + + + run_V = mkV1 "biec" conj15 "pobiec" conj15; + smell_V = mkV1 "czuć" conj51 "poczuć" conj51; + blow_V = mkV1 "dmuchać" conj98 "dmuchnąć" conj5; + float_V = mkV1 "dryfować" conj53 "zdryfować" conj53; + play_V = mkV1 "grać" conj98 "zagrać" conj98; + go_V = mkV1 "iść" conj41a "pójść" conj42; + lie_V = mkV1 "kłamać" conj70 "skłamać" conj70; + dig_V = mkV1 "wykopywać" conj54 "wykopać" conj70; -- + fly_V = mkMonoVerb "latać" conj98 Imperfective; + think_V = mkV1 "myśleć" conj90 "pomyśleć" conj90; + turn_V = mkReflVerb (mkV1 "obracać" conj98 "obrócić" conj81); + breathe_V = mkV1 "oddychać" conj98 "odetchnąć" conj5; + burn_V = mkMonoVerb "palić" conj75 Imperfective; + spit_V = mkV1 "pluć" conj51 "plunąć" conj4; + flow_V = mkMonoVerb "płynąć" conj4 Imperfective; + swim_V = mkMonoVerb "pływać" conj98 Imperfective; + travel_V = mkMonoVerb "podróżować" conj53 Imperfective; + come_V = mkV1 "przyjść" conj41 "przychodzić" conj80; + swell_V = mkV1 "puchnąć" conj7 "spuchnąć" conj7; + vomit_V = mkV1 "rzygać" conj98 "rzygnąć" conj5; + sit_V = mkMonoVerb "siedzieć" conj92 Imperfective; + jump_V = mkV1 "skakać" conj61 "skoczyć" conj87; + walk_V = mkV1 "spacerować" conj53 "pospacerować" conj53; + sleep_V = mkMonoVerb "spać" conj96 Imperfective; + fall_V = mkV1 "spaść" conj17 "spadać" conj98; + laugh_V = mkReflVerb (mkV1 "śmiać" conj52 "roześmiać" conj52); + sing_V = mkV1 "śpiewać" conj98 "zaśpiewać" conj98; + stand_V = mkMonoVerb "stać" conj95 Imperfective; + sew_V = mkV1 "szyć" conj51 "uszyć" conj51; + die_V = mkV1 "umierać" conj98 "umrzeć" conj43; + freeze_V = mkV1 "zamarzać" conj98 "zamarznąć" conj7; + stop_V = mkV1 "zatrzymywać" conj54 "zatrzymać" conj98; + live_V = mkV1 "żyć" conj51 "pożyć" conj51; + + john_PN = { nom = "Jan"; voc="Janie"; dep=table{GenPrep|GenNoPrep|AccPrep|AccNoPrep=>"Jana"; DatPrep|DatNoPrep=>"Janowi"; + InstrNoPrep|InstrPrep=>"Janem"; LocPrep=>"Janie"}; + gn=MascPersSg; p=P3}; + paris_PN = { nom = "Paryż"; voc="Paryżu"; dep=table{GenPrep|GenNoPrep=>"Paryża"; AccPrep|AccNoPrep=>"Paryż"; + DatPrep|DatNoPrep=>"Paryżowi"; InstrNoPrep|InstrPrep=>"Paryżem"; LocPrep=>"Paryżu"}; + gn=MascPersSg; p=P3}; +} ; diff --git a/lib/src/polish/MorphoPol.gf b/lib/src/polish/MorphoPol.gf new file mode 100644 index 000000000..ea3261b2f --- /dev/null +++ b/lib/src/polish/MorphoPol.gf @@ -0,0 +1,278 @@ +--# -path=.:../prelude:../common:../abstract +--# -coding=utf8 + +--1 A polish Resource Morphology +-- +-- Ilona Nowak, Wintersemester 2007/08 +-- +-- Adam Slaski, 2009 +-- +-- This resource morphology contains definitions +-- of the lexical entries needed in the resource syntax. +-- It moreover contains copies of the most usual inflectional patterns. + +-- I use the parameter types and word classes defined for morphology. + +resource MorphoPol = + ResPol, + VerbMorphoPol, + PronounMorphoPol, + AdjectiveMorphoPol, + NounMorphoPol ** open Prelude, (Predef=Predef) in { + + flags coding=utf8; + +-- definitions for structural objects + + oper + wszyscy : NounPhrase = { + nom = "wszyscy" ; + voc = "wszyscy" ; + dep = table { + (GenNoPrep|GenPrep) => "wszystkich"; + (DatNoPrep|DatPrep) => "wszystkim"; + (AccNoPrep|AccPrep) => "wszystkich"; + (InstrNoPrep|InstrPrep) => "wszystkimi"; + LocPrep => "wszystkich" + }; + p = P3 ; + gn = MascPersPl -- in fact it is plurale tantum ver. 3 + }; + + wszystko : NounPhrase = { + nom = "wszystko" ; + voc = "wszystko" ; + dep = table { + (GenNoPrep|GenPrep) => "wszystkiego"; + (DatNoPrep|DatPrep) => "wszystkiemu"; + (AccNoPrep|AccPrep) => "wszystko"; + (InstrNoPrep|InstrPrep) => "wszystkim"; + LocPrep => "wszystkim" + }; + p = P3; + gn = NeutSg -- in fact it is plurale tantum ver. 3 + }; + + ktos : NounPhrase = { + nom = "ktoś" ; + voc = "ktosiu" ; + dep = table { + (GenNoPrep|GenPrep) => "kogoś"; + (DatNoPrep|DatPrep) => "komuś"; + (AccNoPrep|AccPrep) => "kogoś"; + (InstrNoPrep|InstrPrep) => "kimś"; + LocPrep => "kimś" + }; + p = P3 ; + gn = MascPersSg + }; + + cos : NounPhrase = { + nom = "coś" ; + voc = "coś" ; + dep = table { + (GenNoPrep|GenPrep) => "czegoś"; + (DatNoPrep|DatPrep) => "czemuś"; + (AccNoPrep|AccPrep) => "coś"; + (InstrNoPrep|InstrPrep) => "czymś"; + LocPrep => "czymś" + }; + p = P3 ; + gn = NeutSg + }; + + + kto : NounPhrase = { + nom = "kto" ; + voc = "kto" ; + dep = table { + (GenNoPrep|GenPrep) => "kogo"; + (DatNoPrep|DatPrep) => "komu"; + (AccNoPrep|AccPrep) => "kogo"; + (InstrNoPrep|InstrPrep) => "kim"; + LocPrep => "kim" + }; + p = P3 ; + gn = MascPersSg + }; + + co : NounPhrase = { + nom = "co" ; + voc = "co" ; + dep = table { + (GenNoPrep|GenPrep) => "czego"; + (DatNoPrep|DatPrep) => "czemu"; + (AccNoPrep|AccPrep) => "co"; + (InstrNoPrep|InstrPrep) => "czym"; + LocPrep => "czym" + }; + p = P3 ; + gn = NeutSg + }; + + kazdyDet : Determiner = { + s,sp = table { + Nom => table {Masc _ => "każdy"; Fem => "każda"; (Neut|NeutGr) => "każde" }; + Gen => table {Masc _ => "każdego"; Fem => "każdą"; (Neut|NeutGr) => "każdego" }; + Dat => table {Masc _ => "każdemu"; Fem => "każdej"; (Neut|NeutGr) => "każdemu" }; + Acc => table {Masc (Personal|Animate) => "każdego"; Masc Inanimate => "każdy"; Fem => "każdą"; (Neut|NeutGr) => "każde" }; + Instr => table {Masc _ => "każdym"; Fem => "każdą"; (Neut|NeutGr) => "każdym" }; + Loc => table {Masc _ => "każdym"; Fem => "każdej"; (Neut|NeutGr) => "każdym" }; + VocP => table {Masc _ => "każdy"; Fem => "każda"; (Neut|NeutGr) => "każde" } + }; + n = Sg; + a = NoA; + }; + + pareDet : Determiner = { + s,sp = table { + Nom => table {Masc Personal => "paru"; _ => "parę" }; + Gen => table { _ => "paru" }; + Dat => table { _ => "paru" }; + Acc => table {Masc Personal => "paru"; _ => "parę" }; + Instr => table { _ => "paroma" }; + Loc => table { _ => "paru" }; + VocP => table {Masc Personal => "paru"; _ => "parę" } + }; + n = Pl; + a = StoA + }; + + wieleDet : Determiner = { + s,sp = table { + Nom => table {Masc Personal => "wielu"; _ => "wiele" }; + Gen => table { _ => "wielu" }; + Dat => table { _ => "wielu" }; + Acc => table {Masc Personal => "wielu"; _ => "wiele" }; + Instr => table { _ => "wieloma" }; + Loc => table { _ => "wielu" }; + VocP => table {Masc Personal => "wielu"; _ => "wiele" } + }; + n = Pl; + a = StoA + }; + + duzoDet : Determiner = { + s,sp = \\_,_=>"dużo";{- + table { + Nom => table { _ => "dużo" }; + Gen => table { _ => "dużo" }; + Dat => table { _ => variants {} }; + Acc => table { _ => "dużo" }; + Instr => table { _ => variants {} }; + Loc => table { _ => variants {} }; + VocP => table {_ => "dużo" } + };-} + n = Pl; + a = StoA + }; + + ileDet : IDeterminer = { + s = table { + Nom => table {Masc Personal => "ilu"; _ => "ile" }; + Gen => table { _ => "ilu" }; + Dat => table { _ => "ilu" }; + Acc => table {Masc Personal => "ilu"; _ => "ile" }; + Instr => table { _ => "ilu" }; + Loc => table { _ => "ilu" }; + VocP => table {Masc Personal => "ilu"; _ => "ile" } + }; + n = Pl; + a = StoA + }; + + -- for "nobody", "noone", "none" + oper niktNP : NounPhrase = + { voc,nom="nikt"; + dep = table { + (GenNoPrep|GenPrep) => "nikogo"; + (DatNoPrep|DatPrep) => "nikomu"; + (AccNoPrep|AccPrep) => "nikogo"; + (InstrNoPrep|InstrPrep) => "nikim"; + LocPrep => "nikim" + }; + p=P3; + gn= MascPersSg + }; + +-- for "nothing" + oper nicNP : NounPhrase = + { voc,nom="nic"; + dep = table { + (GenNoPrep|GenPrep) => "niczego"; + (DatNoPrep|DatPrep) => "niczemu"; + (AccNoPrep|AccPrep) => "niczego"; + (InstrNoPrep|InstrPrep) => "niczym"; + LocPrep => "niczym" + }; + p=P3; + gn= NeutSg + }; + + zadenQuant : { s,sp:AForm=>Str } = {s,sp=table { + AF (MascPersSg|MascAniSg|MascInaniSg) Nom => "żaden"; + AF (MascPersSg|MascAniSg|MascInaniSg) Gen => "żadnego"; + AF (MascPersSg|MascAniSg|MascInaniSg) Dat => "żadnemu"; + AF MascInaniSg Acc => "żaden"; -- który stół widzę + AF (MascPersSg|MascAniSg) Acc => "żadnego"; -- którego psa / przyjaciela widzę + AF (MascPersSg|MascAniSg|MascInaniSg) Instr => "żadnym"; + AF (MascPersSg|MascAniSg|MascInaniSg) Loc => "żadnym"; + AF (MascPersSg|MascAniSg|MascInaniSg) VocP => "żadny"; + + AF FemSg Nom => "żadna" ; + AF FemSg Gen => "żadnej"; + AF FemSg Dat => "żadnej"; + AF FemSg Acc => "żadną"; + AF FemSg Instr => "żadną"; + AF FemSg Loc => "żadnej"; + AF FemSg VocP => "żadna"; + + AF NeutSg Nom => "żadne" ; + AF NeutSg Gen => "żadnego"; + AF NeutSg Dat => "żadnemu"; + AF NeutSg Acc => "żadne"; + AF NeutSg Instr => "żadnym"; + AF NeutSg Loc => "żadnym"; + AF NeutSg VocP => "żadne"; + + AF MascPersPl Nom => "żadni"; + AF (MascPersPl|OthersPl) Nom => "żadne"; + AF (MascPersPl|OthersPl) Gen => "żadnych"; + AF (MascPersPl|OthersPl) Dat => "żadnym"; + AF MascPersPl Acc => "żadnych"; + AF (MascPersPl|OthersPl) Acc => "żadne"; + AF (MascPersPl|OthersPl) Instr => "żadnymi"; + AF (MascPersPl|OthersPl) Loc => "żadnych"; + AF MascPersPl VocP => "żadni"; + AF (MascPersPl|OthersPl) VocP=> "żadne" + }}; + + pewienDet : Determiner = { + s,sp = table { + Nom => table {Masc _ => "pewien"; Fem=>"pewna"; _ => "pewne" }; + Gen => table { Fem=>"pewnej"; _ => "pewnego" }; + Dat => table { Fem=>"pewnej"; _ => "pewnemu" }; + Acc => table { Masc Inanimate => "pewien"; Masc _ => "pewnego"; Fem=>"pewną"; _ => "pewne" }; + Instr => table { Fem=>"pewną"; _=> "pewnym" }; + Loc => table { Fem=>"pewnej"; _=> "pewnym" }; + VocP => table {Masc _ => "pewny"; Fem=>"pewna"; _ => "pewne" } + }; + n = Sg; + a = NoA + }; + + pewniDet : Determiner = { + s,sp = table { + Nom => table {Masc Personal => "pewni"; _ => "pewne" }; + Gen => table { _ => "pewnych" }; + Dat => table { _ => "pewnym" }; + Acc => table {Masc Personal => "pewnych"; _ => "pewne" }; + Instr => table { _ => "pewnymi" }; + Loc => table { _ => "pewnych" }; + VocP => table {Masc Personal => "pewni"; _ => "pewne" } + }; + n = Pl; + a = NoA + }; + +} diff --git a/lib/src/polish/NounMorphoPol.gf b/lib/src/polish/NounMorphoPol.gf new file mode 100644 index 000000000..656061d92 --- /dev/null +++ b/lib/src/polish/NounMorphoPol.gf @@ -0,0 +1,3539 @@ +--# -path=.:../../prelude:../common +--# -coding=utf8 + +--1 A polish Resource Morphology +-- +-- Ilona Nowak, Wintersemester 2007/08 +-- +resource NounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in { + + flags coding=utf8; optimize=all_subs; + + +--1 Nouns + +-- Die Eigennamen im Polnischen sind wie +-- die CommNoun (S:SubstForm => Str; gender). +-- Sie werden wie CommNoun dekliniert. Die Endung +-- des Wortes ist immer entscheidend. +-- Deswegen vrauche ich eine Funktion, die +-- ein CommNoun zu einem PN macht. + +-- oper ProperName = {s : SubstForm => Str; g : Gender}; +-- mkProperName : CommNoun -> ProperName = \cn -> +-- {s = \\c => cn.s! (SF Sg c); g=cn.g }; + + +----- Abbreviations used in names of declensions ----- + +-- VA1 - vowel alternation 1: o:ó, ó:o +-- VA2 - vowel alternation 2: a:e, e:o, ę:o, o:e +-- VA3 - vowel alternation 3: ę:ą, ą:ę +-- CA - consonant alternation +-- CL - consonant lengthening +-- CAL - consonant alternation and lengthening +-- F - feminine +-- N - neuter +-- MP - masculine personal +-- MA - masculine animate +-- MI - masculine inanimate + +-- In Polish there are almost 125 main paradigms for noun declension. +-- (the classification of G. Jagodziński) +-- In this work I make only paradigms, that are needed for +-- building lexicon entries. + + +--1.2 Operations for feminine nouns + + +-- oper for feminine, noun ending in -l, +-- no alternation +-- 104 paradigm by Grzegorz Jagodziński +-- by Nowak 104_4 +-- oper nKapiel fo stal in GF lexicon + + oper l_End_F_1 : Str -> CommNoun = \kapiel -> + let + x = kapiel; + in + { s = table { + SF Sg Nom => x; + SF Sg Acc => x; + SF Sg Instr => x + "ą"; + SF Sg _ => x + "i"; + SF Pl Gen => x + "i"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "e" + }; + g = Fem + }; + + +-- oper for feminine, subject ending in -dź, +-- consonant alternation in gen, dat, loc, instr Sg +-- and in all plural forms. +-- Vowel alternation in almost all forms. +-- Only nom and acc Sg haven't any changes. +-- 104' paradigm by Grzegorz Jagodziński +-- by Nowak 104'_1 +-- oper nLodz for łódź in GF lexicon +-- dzx = dź +-- ludz = łódź + + oper dzx_End_VA1_CAL_F : Str -> CommNoun = \ludz -> + let + x = vowAlt1 ludz; + y = consAlt x; + z = consLength y; + in + { s = table { + SF Sg Nom => ludz; + SF Sg Acc => ludz; + SF Sg Instr => z + "ą"; + SF Sg _ => y + "i"; + SF Pl Gen => y + "i"; + SF Pl Dat => z + "om"; + SF Pl Instr => z + "ami"; + SF Pl Loc => z + "ach"; + SF Pl _ => z + "e" + }; + g = Fem + }; + + +-- oper for feminine, subject ending in -l, +-- vowel alternation in almost all forms. +-- Only nom and dat Sg haven't vowel alternation. +-- 104' paradigm by Grzegorz Jagodziński +-- by Nowak 104'_3 +-- oper nSul for sól in GF lexicon + + oper l_End_VA1_F : Str -> CommNoun = \sul -> + let + x = vowAlt1 sul; + in + { s = table { + SF Sg Nom => sul; + SF Sg Acc => sul; + SF Sg Instr => x + "ą"; + SF Sg _ => x + "i"; + SF Pl Gen => x + "i"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "e" + }; + g = Fem + }; + + +-- oper for feminine, subject ending in -w, +-- fleeting e- minus between 2 consonants. +-- 104* paradigm number by Grzegorz Jagodziński +-- by Nowak 104*_1 +-- oper nKonew for krew in GF lexicon + + oper w_End_FleetingEminus_F : Str -> CommNoun = \konew -> + let + x = fleetingEminus konew; + y = consLength x; + in + { s = table { + SF Sg Nom => konew; + SF Sg Acc => konew; + SF Sg Instr => y + "ą"; + SF Sg _ => x + "i"; + SF Pl Gen => x + "i"; + SF Pl Dat => y + "om"; + SF Pl Instr => y + "ami"; + SF Pl Loc => y + "ach"; + SF Pl _ => y + "e" + }; + g = Fem + }; + + +-- oper for feminine, subject ending in -ś, +-- subject change: wieś : wsi +-- 104** paradigm by Grzegorz Jagodziński +-- by Nowak 104** +-- oper nWies only for wieś in GF lexicon +-- sx = ś +-- wies = wieś + + oper sx_End_CAL_FleetingIEminus_F : Str -> CommNoun = \wies -> + let + x = consAlt wies; + y = fleetingIEminus x; + z = consLength y; + in + { s = table { + SF Sg Nom => wies; + SF Sg Acc => wies; + SF Sg Instr => z + "ą"; + SF Sg _ => y + "i"; + SF Pl Gen => y + "i"; + SF Pl Dat => z + "om"; + SF Pl Instr => z + "ami"; + SF Pl Loc => z + "ach"; + SF Pl _ => z + "e" + }; + g = Fem + }; + + +-- oper for feminine, subject ending in -ń, +-- consonant alternation, consonant lengthening. +-- 105 paradigm by Grzegorz Jagodziński +-- 105_1 by Nowak +-- oper nDlon for dłoń GF lexicon +-- nx = ń +-- dlon = dłoń + + oper nx_End_CAL_F : Str -> CommNoun = \dlon -> + let + x = consAlt dlon; + y = consLength x; + in + { s = table { + SF Sg Nom => dlon; + SF Sg Acc => dlon; + SF Sg Instr => y + "ą"; + SF Sg _ => x + "i"; + SF Pl Gen => x + "i"; + SF Pl Dat => y + "om"; + SF Pl Instr => dlon + "mi"; + SF Pl Loc => y + "ach"; + SF Pl _ => y + "e" + }; + g = Fem + }; + +-- oper for feminine, subject ending in -ć (sieć), +-- -ść (miłość), -ś (pierś), -dź (odpowiedź) +-- consonant alternation on last consonant +-- 106 paradigm by Grzegorz Jagodziński +-- 106_1 by Nowak +-- oper nSiec for miłość, odległość, pierś in GF lexicon +-- cx = ć +-- siec = sieć + + oper cx_End_CAL_F_1 : Str -> CommNoun = \siec -> + let + x = consAlt siec; + y = consLength x; + in + { s = table { + SF Sg Nom => siec; + SF Sg Acc => siec; + SF Sg Instr => y + "ą"; + SF Pl Dat => y + "om"; + SF Pl Instr => y + "ami"; + SF Pl Loc => y + "ach"; + SF _ _ => x + "i" + }; + g = Fem + }; + + +-- oper for nouns having only the plural form +-- 98 by Grzegorz Jagodziński for usta - 98_2 by Nowak +-- 106 by Grzegorz Jagodziński for wnętrzności - 106_2 by Nowak +-- 106 by Grzegorz Jagodziński for drzwi - 106_3 by Nowak +-- 117 by Grzegorz Jagodziński for spodnie - 117_2 by Nowak +-- oper nDrzwi for drzwi, wnętrzności, usta, spodnie in GF-lexicon + + oper onlyPlNoun : Str -> CommNoun = \drzwi -> + let + i = my1Last drzwi; + drzw = last1Minus drzwi; + x = case i of { + "a" => last1Minus drzwi; + "e" => drzw; + "i" => drzwi; + "y" => drzw + "ów"}; + in + { s = table { + SF Sg _ => "[" ++ drzwi ++ [": the singl form does not exist]"]; + SF Pl Gen => x; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => drzwi + }; + g = Neut + }; + + + +-- oper for feminine, subject ending in -ść (kość), -ć(nić) +-- consonant alternation and lengthening. Similar to nSiec, but different +-- in instr pl in the declension ending sieci-ami, kość-mi. +-- 107 paradigm by Grzegorz Jagodziński +-- 107 by Nowak +-- oper nKosc for kość in GF lexicon +-- cx = ć +-- kosc = kość + + oper cx_End_CAL_F_2 : Str -> CommNoun = \kosc -> + let + x = consAlt kosc; + y = consLength x; + in + { s = table { + SF Sg Nom => kosc; + SF Sg Acc => kosc; + SF Sg Instr => y + "ą"; + SF Pl Dat => y + "om"; + SF Pl Instr => kosc + "mi"; + SF Pl Loc => y + "ach"; + SF _ _ => x + "i" + }; + g = Fem + }; + + +-- oper for feminine, subject ending in -c,-cz,-rz,-ż, +-- 108 paradigm by Grzegorz Jagodziński +-- 108 by Nowak +-- oper nNoc for noc in GF lexicon + oper hardened_End_F_1 : Str -> CommNoun = \noc -> + { s = table { + SF Sg Nom => noc; + SF Sg Acc => noc; + SF Sg Instr => noc + "ą"; + SF Sg _ => noc + "y"; + SF Pl Gen => noc + "y"; + SF Pl Dat => noc + "om"; + SF Pl Instr => noc + "ami"; + SF Pl Loc => noc + "ach"; + SF Pl _ => noc + "e" + }; + g = Fem + }; + + +-- oper for feminine, subject ending in -sz, +-- fleeting -e between 2 consonants. +-- 109* paradigm by Grzegorz Jagodziński +-- 109* by Nowak +-- oper nWesz for wesz in GF lexicon + + oper sz_End_FleetingEminus_F : Str -> CommNoun = \wesz -> + let + x = fleetingEminus wesz; + in + { s = table { + SF Sg Nom => wesz; + SF Sg Acc => wesz; + SF Sg Instr => x + "ą"; + SF Sg _ => x + "y"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Fem + }; + + +-- oper for feminine, subject ending in -wa, +-- 112 paradigm by Grzegorz Jagodziński +-- 112 by Nowak +-- oper nKrolowa for królowa (queen) in GF lexicon + + oper wa_na_End_F : Str -> CommNoun = \krolowa -> + let + krolow = last1Minus krolowa; + in + { s = table { + SF Sg Nom => krolowa; + SF Sg Acc => krolow + "ą"; + SF Sg Instr => krolow + "ą"; + SF Sg VocP => krolow + "o"; + SF Sg _ => krolow + "ej"; + SF Pl Gen => krolow + "ych"; + SF Pl Dat => krolow + "ym"; + SF Pl Instr => krolow + "ymi"; + SF Pl Loc => krolow + "ych"; + SF Pl _ => krolow + "e" + }; + g = Fem + }; + + +-- oper for feminine, subject ending in -wa, +-- 113'@ paradigm by Grzegorz Jagodziński +-- 113'@ by Nowak +-- oper nReka for ręka in GF lexicon + + oper k_End_Unregulary_VA3_CA_F : Str -> CommNoun = \reka -> + let + x = last1Minus reka; + y = vowAlt3 x; + z = consAlt x; + in + { s = table { + SF Sg Nom => reka; + SF Sg Gen => x + "i"; + SF Sg Acc => x + "ę"; + SF Sg Instr => x + "ą"; + SF Sg VocP => x + "o"; + SF Sg _ => z + "e"; + SF Pl Gen => y; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "oma"; + SF Pl Loc => x + "ach"; + SF Pl _ => z + "e" + }; + g = Fem + }; + + +-- oper for feminine, subject ending in -k (frytka), -g (ostryga, waga) +-- consonant alternation in dat, loc Sg. +-- 114 paradigm by Grzegorz Jagodziński +-- oper nApteka for fabryka, gramatyka, muzyka, +-- nauka, rzeka, sztuka in GF lexicon + + oper g_k_End_CA_F : Str -> CommNoun = \apteka -> + let + x = last1Minus apteka; + y = consAlt apteka; + in + { s = table { + SF Sg Nom => x + "a"; + SF Sg Gen => x + "i"; + SF Sg Acc => x + "ę"; + SF Sg Instr => x + "ą"; + SF Sg VocP => x + "o"; + SF Sg _ => y + "e"; + SF Pl Gen => x; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "i" + }; + g = Fem + }; + + +-- oper for feminine, subject ending in -g, +-- consonant alternation in dat, loc sg, +-- vowel alternation in gen pl: o-ó (droga-dróg). +-- 114' paradigm by Grzegorz Jagodziński +-- by Nowak 114' +-- oper nDroga for podłoga, noga in GF lexicon + + oper g_End_VA1_CA_F : Str -> CommNoun = \droga -> + let + x = last1Minus droga; + y = consAlt droga; + z = vowAlt1 droga; + in + { s = table { + SF Sg Nom => x + "a"; + SF Sg Gen => x + "i"; + SF Sg Acc => x + "ę"; + SF Sg Instr => x + "ą"; + SF Sg VocP => x + "o"; + SF Sg _ => y + "e"; + SF Pl Gen => z; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "i" + }; + g = Fem + }; + + +-- oper for feminine, subject ending in -k, +-- consonant alternation in dat, loc sg, +-- fleeting -e plus in gen pl. +-- 114* paradigm by Grzegorz Jagodziński +-- by Nowak 114*_1 +-- oper nMatka for matka, piosenka, książka, kurtka, +-- lodówka, skarpetka, gumka in GF lexicon + + oper k_End_CA_FleetingEplus_F : Str -> CommNoun = \matka -> + let + x = last1Minus matka; + y = consAlt x; + z = fleetingEplus x; + in + { s = table { + SF Sg Nom => x + "a"; + SF Sg Gen => x + "i"; + SF Sg Acc => x + "ę"; + SF Sg Instr => x + "ą"; + SF Sg VocP => x + "o"; + SF Sg _ => y + "e"; + SF Pl Gen => z; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "i" + }; + g = Fem + }; + + +-- oper for feminine, subject ending in -ia, +-- 116 paradigm by Grzegorz Jagodziński +-- 116_5 by Nowak +-- oper nZiemia for ziemia (earth) in GF lexicon + + oper ia_End_F_1 : Str -> CommNoun = \ziemia -> + let + ziemi = last1Minus ziemia; + ziem = last1Minus ziemi; + in + { s = table { + SF Sg Nom => ziemi + "a"; + SF Sg Acc => ziemi + "ę"; + SF Sg Instr => ziemi + "ą"; + SF Sg VocP => ziemi + "o"; + SF Sg _ => ziem + "i"; + SF Pl Gen => ziem; + SF Pl Dat => ziemi + "om"; + SF Pl Instr => ziemi + "ami"; + SF Pl Loc => ziemi + "ach"; + SF Pl _ => ziemi + "e" + }; + g = Fem + }; + + +-- oper for feminine, subject ending in -l, +-- 116 paradigm by Grzegorz Jagodziński +-- 116_6 by Nowak +-- oper nFala for koszula in GF lexicon + + oper l_End_F_2 : Str -> CommNoun = \fala -> + let + fal = last1Minus fala; + in + { s = table { + SF Sg Nom => fal + "a"; + SF Sg Acc => fal + "ę"; + SF Sg Instr => fal + "ą"; + SF Sg VocP => fal + "o"; + SF Sg _ => fal + "i"; + SF Pl Gen => fal; + SF Pl Dat => fal + "om"; + SF Pl Instr => fal + "ami"; + SF Pl Loc => fal + "ach"; + SF Pl _ => fal + "e" + }; + g = Fem + }; + + +-- oper for feminine, subject ending in -ia, -ja: +-- in the spoken version of the word is -ja. Both +-- -ia and -ja have the same pronunciation. +-- genitive sg ending in -ii. +-- 117 paradigm by Grzegorz Jagodziński +-- 117_4 by Nowak too +-- oper nLilia for religia, telewizja, restauracja in GF lexicon + + oper ia_End_F_2 : Str -> CommNoun = \lilia -> + let + lili = last1Minus lilia; + in + { s = table { + SF Sg Nom => lili + "a"; + SF Sg Acc => lili + "ę"; + SF Sg Instr => lili + "ą"; + SF Sg VocP => lili + "o"; + SF Sg _ => lili + "i"; + SF Pl Gen => lili + "i"; + SF Pl Dat => lili + "om"; + SF Pl Instr => lili + "ami"; + SF Pl Loc => lili + "ach"; + SF Pl _ => lili + "e" + }; + g = Fem + }; + + +-- oper for feminine, subject ending in -t --------------------------------------, +-- 121 paradigm by Grzegorz Jagodziński +-- 121_1 by Nowak +-- By Jagodziński there are many words in this group, +-- that don't have consonant alternation in dat sg, +-- but only a consonantLengthening p: pi, n:ni, s:si +-- at the end of the subject. +-- So I create a new group here for małpa, lipa, benzyna, +-- cytryna, szosa etc. S. nLiczba, below, 121_2 by Nowak +-- oper nKobieta for moneta, planeta, gazeta, ojczyzna in GF lexicon + + oper hard_End_CAL_F : Str -> CommNoun = \kobieta -> + let + x = last1Minus kobieta; + y = consAlt x; + z = consLength y; + in + { s = table { + SF Sg Nom => x + "a"; + SF Sg Gen => x + "y"; + SF Sg Acc => x + "ę"; + SF Sg Instr => x + "ą"; + SF Sg VocP => x + "o"; + SF Sg _ => z + "e"; + SF Pl Gen => x; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Fem + }; + + +-- oper for feminine, subject ending in -t, -d, -b, -n, -w +-- (a hard consonant) +-- 121 paradigm by Grzegorz Jagodziński +-- 121_2 by Nowak +-- Only a consonantLengthening b:bi, p: pi, n:ni, s:si +-- at the end of the subject. +-- oper nLiczba for żona, trawa, dziewczyna, ryba, lampa, liczba in GF lexicon + + oper hard_End_CL_F : Str -> CommNoun = \liczba -> + let + x = last1Minus liczba; + y = consLength x; + in + { s = table { + SF Sg Nom => x + "a"; + SF Sg Gen => x + "y"; + SF Sg Acc => x + "ę"; + SF Sg Instr => x + "ą"; + SF Sg VocP => x + "o"; + SF Sg _ => y + "e"; + SF Pl Gen => x; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Fem + }; + + +-- oper for feminine, subject ending in -ł, -r, -ch +-- 121 paradigm by Grzegorz Jagodziński +-- 121_3 by Nowak +-- oper nSila for skała, reguła, chmura, góra, kamera, +-- kora, mucha in GF lexicon +-- sixa = siła + + oper hard_End_CA_F : Str -> CommNoun = \sixa -> + let + x = last1Minus sixa; + y = consAlt x; + in + { s = table { + SF Sg Nom => x + "a"; + SF Sg Gen => x + "y"; + SF Sg Acc => x + "ę"; + SF Sg Instr => x + "ą"; + SF Sg VocP => x + "o"; + SF Sg _ => y + "e"; + SF Pl Gen => x; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Fem + }; + + +-- oper for feminine, subject ending in hard consonants +-- f.e. -b(osoba), -p(stopa), -w (połowa), -z (koza) +-- vowel alternation o:ó in gen Pl and +-- consonant lengthening in dat, loc sg. +-- 121' paradigm by Grzegorz Jagodziński +-- 121'_1 by Nowak +-- oper nNora for stopa, wątroba, krowa +-- in GF lexicon + + oper hard_End_VA1_CL_F : Str -> CommNoun = \doba -> + let + x = last1Minus doba; + y = consLength x; + z = vowAlt1 x; + in + { s = table { + SF Sg Nom => x + "a"; + SF Sg Gen => x + "y"; + SF Sg Acc => x + "ę"; + SF Sg Instr => x + "ą"; + SF Sg VocP => x + "o"; + SF Sg _ => y + "e"; + SF Pl Gen => z; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Fem + }; + + +-- oper for feminine, subject ending in -d (broda, jagoda, moda), +-- -t (cnota, robota, sobota). +-- consonant alternation and lengthening d:dzi (woda:wodzie), +-- t:ci(sobota:sobocie) in dat, loc sg, +-- vowel alternation o:ó (woda:wód, sobota:sobót) in gen pl. +-- 121' paradigm by Grzegorz Jagodziński +-- 121'_2 by Nowak +-- oper nWoda for woda in GF lexicon + + oper hard_End_VA1_CAL_F : Str -> CommNoun = \woda -> + let + x = last1Minus woda; + y = consLength (consAlt x); + z = vowAlt1 x; + in + { s = table { + SF Sg Nom => x + "a"; + SF Sg Gen => x + "y"; + SF Sg Acc => x + "ę"; + SF Sg Instr => x + "ą"; + SF Sg VocP => x + "o"; + SF Sg _ => y + "e"; + SF Pl Gen => z; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Fem + }; + + +-- oper for feminine, subject ending in -oła, -stra: +-- (pszczoła, szkoła, siostra). +-- consonant alternation ł:l, r:rz (szkoła:szkole, +-- siostra:siostrze) in dat, loc sg, +-- vowel alternation o:ó (szkoła:szkół, siostra:sióstr) in gen pl. +-- 121' paradigm by Grzegorz Jagodziński +-- 121'_3 by Nowak +-- oper nSzkola for szkoła, siostra in GF lexicon + + oper hard_End_VA1_CA_F : Str -> CommNoun = \szkola -> + let + x = last1Minus szkola; + y = consAlt x; + z = vowAlt1 x; + in + { s = table { + SF Sg Nom => x + "a"; + SF Sg Gen => x + "y"; + SF Sg Acc => x + "ę"; + SF Sg Instr => x + "ą"; + SF Sg VocP => x + "o"; + SF Sg _ => y + "e"; + SF Pl Gen => z; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Fem + }; + + +-- oper for feminine, subject ending in -two consonants: +-- -jn, -łz, -łn, -żw +-- consonant lengthening +-- 121* paradigm by Grzegorz Jagodziński +-- 121*_1 by Nowak +-- oper nWojna for wojna GF lexicon + + oper hard_End_CL_FleetingEplus_F : Str -> CommNoun = \wojna -> + let + x = last1Minus wojna; + y = consLength x; + z = fleetingEplus x; + in + { s = table { + SF Sg Nom => x + "a"; + SF Sg Gen => x + "y"; + SF Sg Acc => x + "ę"; + SF Sg Instr => x + "ą"; + SF Sg VocP => x + "o"; + SF Sg _ => y + "e"; + SF Pl Gen => z; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Fem + }; + + +-- oper for feminine, subject ending in -sn +-- is almost like nWojna, but consonant alternation s:ś too +-- 121* paradigm by Grzegorz Jagodziński +-- 121*_1 by Nowak +-- oper nWiosna + + oper sn_End_CAL_FleetingIEplus_F : Str -> CommNoun = \wiosna -> + let + x = last1Minus wiosna; + y = consLength (consAlt x); + z = fleetingEplus x; + in + { s = table { + SF Sg Nom => x + "a"; + SF Sg Gen => x + "y"; + SF Sg Acc => x + "ę"; + SF Sg Instr => x + "ą"; + SF Sg VocP => x + "o"; + SF Sg _ => y + "e"; + SF Pl Gen => z; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Fem + }; + + +-- oper for feminine, subject ending in -consonant + ł +-- f.e. like mgła, igła +-- fleeting -ie plus +-- 121** paradigm by Grzegorz Jagodziński +-- 121**_2 by Nowak +-- oper nMgla for mgła GF lexicon +-- x = ł +-- mgxa = mgła + + oper hard_l_End_CA_FleetingIEplus_F : Str -> CommNoun = \mgxa -> + let + x = last1Minus mgxa; + y = consAlt x; + z = fleetingIEplus x; + in + { s = table { + SF Sg Nom => x + "a"; + SF Sg Gen => x + "y"; + SF Sg Acc => x + "ę"; + SF Sg Instr => x + "ą"; + SF Sg VocP => x + "o"; + SF Sg _ => y + "e"; + SF Pl Gen => z; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Fem + }; + + +-- oper nGwiazda for gwiazda in GF-lexicon +-- 121^ paradigm by Grzegorz Jagodziński +-- 121^_1 by Nowak +-- only for words ending in -zda, -sta (gwiazda, niewiasta) + + oper zd_st_End_VA2_CAL_F : Str -> CommNoun = \gwiazda-> + let + x = last1Minus gwiazda; + y = consLength (consAlt (vowAlt2 x)); + in + { s = table { + SF Sg Nom => x + "a"; + SF Sg Gen => x + "y"; + SF Sg Acc => x + "ę"; + SF Sg Instr => x + "ą"; + SF Sg VocP => x + "o"; + SF Sg _ => y + "e"; + SF Pl Gen => x; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Fem + }; + + +-- oper for feminine, subject ending in -c,-cz,-rz,-ż, +-- 124 paradigm by Grzegorz Jagodziński +-- 124_1 by Nowak +-- oper nUlica for ulica, rękawica GF lexicon + + oper hardened_End_F_2 : Str -> CommNoun = \ulica -> + let + x = last1Minus ulica; + in + { s = table { + SF Sg Nom => x + "a"; + SF Sg Acc => x + "ę"; + SF Sg Instr => x + "ą"; + SF Sg VocP => x + "o"; + SF Sg _ => x + "y"; + SF Pl Gen => x; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "e" + }; + g = Fem + }; + +-- oper for feminine, subject ending in -c, +-- irregulary form in genitive Pl +-- 124** paradigm by Grzegorz Jagodziński +-- 124**_1 by Nowak +-- oper nOwca for owca in GF lexicon + + oper c_End_FleetingIEplus_F : Str -> CommNoun = \owca -> + let + x = last1Minus owca; + y = fleetingIEplus x; + in + { s = table { + SF Sg Nom => x + "a"; + SF Sg Acc => x + "ę"; + SF Sg Instr => x + "ą"; + SF Sg VocP => x + "o"; + SF Sg _ => x + "y"; + SF Pl Gen => y; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "e" + }; + g = Fem + }; + + +--1.3 Operations for neuter nouns + +-- oper for neuter where subject ending in -ni, +-- functional weak ------- consonant +-- consonant alternation ni:ń in genitive Pl +-- 91 paradigm by Grzegorz Jagodziński +-- 91_1 by Nowak +-- oper nDanie for mieszkanie in GF lexicon + + oper ci_ni_week_End_CA_N : Str -> CommNoun = \danie -> + let + x = last1Minus danie; + y = consAlt x; + in + { s = table { + SF Sg Gen => x + "a"; + SF Sg Dat => x + "u"; + SF Sg Instr => x + "em"; + SF Sg Loc => x + "u"; + SF Sg _ => x + "e"; + SF Pl Gen => y; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "a" + }; + g = Neut + }; + + +-- oper for neuter, subject ending in -c, +-- functional weak consonant +-- 91 paradigm by Grzegorz Jagodziński +-- 91_4 by Nowak +-- oper nSerce for słońce, serce, wzgórze GF lexicon + + oper hardened_End_N : Str -> CommNoun = \serce -> + let + x = last1Minus serce; + in + { s = table { + SF Sg Gen => x + "a"; + SF Sg Dat => x + "u"; + SF Sg Instr => x + "em"; + SF Sg Loc => x + "u"; + SF Sg _ => x + "e"; + SF Pl Gen => x; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "a" + }; + g = Neut + }; + + +-- oper for neuter, subject ending in - +-- 91@ paradigm by Grzegorz Jagodziński +-- 91@ by Nowak +-- oper nNasienie for nasienie GF lexicon +-- this is only for nasienie in polish language + + oper ni_End_VA2_N : Str -> CommNoun = \nasienie -> + let + x = fleetingEminus nasienie; + w = fleetingIEminus nasienie; + y = vowAlt2 w; + in + { s = table { + SF Sg Gen => x + "a"; + SF Sg Dat => x + "u"; + SF Sg Instr => x + "em"; + SF Sg Loc => x + "u"; + SF Sg _ => x + "e"; + SF Pl Gen => y; + SF Pl Dat => y + "om"; + SF Pl Instr => y + "ami"; + SF Pl Loc => y + "ach"; + SF Pl _ => y + "a" + }; + g = Neut + }; + + +-- oper for neuter, subject ending in -rz +-- in genitive Pl vowel alternation o:ó +-- here u=ó; both letters have the same pronunciation +-- 91' paradigm by Grzegorz Jagodziński +-- 91' by Nowak +-- oper nMorze for morze GF lexicon + + oper rz_zx_End_VA1_N : Str -> CommNoun = \morze -> + let + x = last1Minus morze; + y = vowAlt1 morze; + in + { s = table { + SF Sg Gen => x + "a"; + SF Sg Dat => x + "u"; + SF Sg Instr => x + "em"; + SF Sg Loc => x + "u"; + SF Sg _ => x + "e"; + SF Pl Gen => y; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "a" + }; + g = Neut + }; + + +-- oper for neuter, subject ending in -ę +-- in gen pl vowel alternation ę:o +-- (imię:imiona, znamię:znamiona) +-- 97 paradigm by Grzegorz Jagodziński +-- 97_1 by Nowak +-- oper nImie for imię GF lexicon + + oper ex_End_VA2_N : Str -> CommNoun = \imie -> + let + w = last1Minus imie; + x = w + "eni"; + y = vowAlt2 imie; + z = y + "n"; + in + { s = table { + SF Sg Gen => x + "a"; + SF Sg Dat => x + "u"; + SF Sg Instr => x + "em"; + SF Sg Loc => x + "u"; + SF Sg _ => w + "ę"; + SF Pl Gen => z; + SF Pl Dat => z + "om"; + SF Pl Instr => z + "ami"; + SF Pl Loc => z + "ach"; + SF Pl _ => z + "a" + }; + g = Neut + }; + + +-- oper for neuter, subject ending in -ę +-- genitive Pl -ęta +-- 97 paradigm by Grzegorz Jagodziński +-- 97_2 by Nowak +-- oper nCiele for zwierzę, niemowlę GF lexicon + + oper ex_End_VA3_N : Str -> CommNoun = \ciele -> + let + w = last1Minus ciele; + x = ciele + "ci"; + y = vowAlt3 ciele + "t"; + z = ciele + "t"; + in + { s = table { + SF Sg Gen => x + "a"; + SF Sg Dat => x + "u"; + SF Sg Instr => x + "em"; + SF Sg Loc => x + "u"; + SF Sg _ => w + "ę"; + SF Pl Gen => y; + SF Pl Dat => z + "om"; + SF Pl Instr => z + "ami"; + SF Pl Loc => z + "ach"; + SF Pl _ => z + "a" + }; + g = Neut + }; + + +-- According to G.Jagodziński "udo" and "piwo" have +-- the same declention type. I part it, because "udo" +-- changes in "udzie". +-- first there is consonant alternation d:dz +-- and then consonant lengthening dz: dz' (dzi). +-- "Piwo" has only consonant lengthening w:w' (wi) + +-- oper for neuter, subject ending in a consonant + "o" +-- 98 paradigm by Grzegorz Jagodziński +-- 98_1_a by Nowak +-- oper nUdo for złoto GF lexicon + + oper hard_End_CAL_N : Str -> CommNoun = \udo -> + let + x = last1Minus udo ; + y = consLength (consAlt udo); + in + { s = table { + SF Sg Gen => x + "a"; + SF Sg Dat => x + "u"; + SF Sg Instr => x + "em"; + SF Sg Loc => y + "e"; + SF Sg _ => x + "o"; + SF Pl Gen => x; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "a" + }; + g = Neut + }; + + +-- oper for neuter, subject ending in a consonant + "o" +-- 98 paradigm by Grzegorz Jagodziński +-- 98_1_b by Nowak +-- oper nPiwo for piwo, wino, drzewo, kolano, +-- mięso, żelazo GF lexicon + + oper hard_End_CL_N : Str -> CommNoun = \piwo -> + let + x = last1Minus piwo; + y = consLength piwo; + in + { s = table { + SF Sg Gen => x + "a"; + SF Sg Dat => x + "u"; + SF Sg Instr => x + "em"; + SF Sg Loc => y + "e"; + SF Sg _ => x + "o"; + SF Pl Gen => x; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "a" + }; + g = Neut + }; + + +-- oper for neuter, subject ending in -r +-- consonant alternation r:rz +-- 98 paradigm by Grzegorz Jagodziński +-- 98_4 by Nowak +-- oper nZero for jezioro, pióro GF lexicon + + oper r_End_CA_N : Str -> CommNoun = \zero -> + let + x = last1Minus zero; + y = consAlt zero; + in + { s = table { + SF Sg Gen => x + "a"; + SF Sg Dat => x + "u"; + SF Sg Instr => x + "em"; + SF Sg Loc => y + "e"; + SF Sg _ => x + "o"; + SF Pl Gen => x; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "a" + }; + g = Neut + }; + + +-- oper for neuter "niebo" - only +-- irregularly form in Pl "niebiosa" +-- 98@ paradigm by Grzegorz Jagodziński and by Nowak +-- oper nNiebo for GF lexicon +-- only for niebo in polish language + + oper niebo_Unregulary_N : Str -> CommNoun = \niebo -> + let + x = last1Minus niebo; +-- y = consLength niebo; + z = x + "ios"; + in + { s = table { + SF Sg Gen => x + "a"; + SF Sg Dat => x + "u"; + SF Sg Instr => x + "em"; + SF Sg Loc => x + "ie"; + SF Sg _ => x + "o"; + SF Pl Gen => z; + SF Pl Dat => z + "om"; + SF Pl Instr => z + "ami"; + SF Pl Loc => z + "ach"; + SF Pl _ => z + "a" + }; + g = Neut + }; + + +-- oper for neuter, subject ending in -ł +-- consonant alternation +-- 98* paradigm by Grzegorz Jagodziński +-- 98*_3 by Nowak +-- oper nTlo for krzesło, masło, skrzydło GF lexicon +-- x = ł +-- txo = tło + + oper lx_End_CA_FleetingEplus_N : Str -> CommNoun = \txo -> + let + x = last1Minus txo; + y = consAlt txo; + z = fleetingEplus txo; + in + { s = table { + SF Sg Gen => x + "a"; + SF Sg Dat => x + "u"; + SF Sg Instr => x + "em"; + SF Sg Loc => y + "e"; + SF Sg _ => x + "o"; + SF Pl Gen => z; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "a" + }; + g = Neut + }; + + +-- oper for neuter, subject ending in -r +-- genitive Pl fleetingEplus +-- 98* paradigm by Grzegorz Jagodziński +-- 98*_5 by Nowak +-- oper nZebro for srebro GF lexicon + + oper hard_End_CA_FleetingEplus_N : Str -> CommNoun = \zebro -> + let + x = last1Minus zebro; + y = consAlt zebro; + z = fleetingEplus zebro; + in + { s = table { + SF Sg Gen => x + "a"; + SF Sg Dat => x + "u"; + SF Sg Instr => x + "em"; + SF Sg Loc => y + "e"; + SF Sg _ => x + "o"; + SF Pl Gen => z; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "a" + }; + g = Neut + }; + + +-- oper for neuter, subject ending in -n +-- consonant lengthening +-- 98** paradigm by Grzegorz Jagodziński +-- 98**_1 by Nowak +-- oper nOkno for okno, drewno GF lexicon + + oper n_End_CL_FleetingIEplus_N : Str -> CommNoun = \okno -> + let + x = last1Minus okno; + y = consLength okno; + z = fleetingIEplus okno; + in + { s = table { + SF Sg Gen => x + "a"; + SF Sg Dat => x + "u"; + SF Sg Instr => x + "em"; + SF Sg Loc => y + "e"; + SF Sg _ => x + "o"; + SF Pl Gen => z; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "a" + }; + g = Neut + }; + + +-- oper for neuter, subject ending in -zdo, -sto +-- locative Sg gnieździe, mieście +-- 98^ paradigm by Grzegorz Jagodziński +-- 98^_1 by Nowak +-- oper nGniazdo for miasto GF lexicon + + oper hard_End_VA_CAL_N : Str -> CommNoun = \gniazdo -> + let + x = last1Minus gniazdo; + y = vowAlt2 gniazdo; + z = consAlt y; + t = consLength z; + in + { s = table { + SF Sg Gen => x + "a"; + SF Sg Dat => x + "u"; + SF Sg Instr => x + "em"; + SF Sg Loc => t + "e"; + SF Sg _ => x + "o"; + SF Pl Gen => x; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "a" + }; + g = Neut + }; + + +-- oper for neuter, subject ending in -k, +-- consonant lengthening in instr Sg +-- 99 paradigm by Grzegorz Jagodziński +-- 99_2 by Nowak +-- oper nWojsko for mleko GF lexicon + + oper k_End_CL_N : Str -> CommNoun = \wojsko -> + let + x = last1Minus wojsko; + y = consLength wojsko; + in + { s = table { + SF Sg Gen => x + "a"; + SF Sg Dat => x + "u"; + SF Sg Instr => y + "em"; + SF Sg Loc => x + "u"; + SF Sg _ => x + "o"; + SF Pl Gen => x; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "a" + }; + g = Neut + }; + + +-- oper for neuter, subject ending in -j, +-- 99 paradigm by Grzegorz Jagodziński +-- 99_4 by Nowak +-- oper nJajo for jajo GF lexicon + + oper j_End_N : Str -> CommNoun = \jajo -> + let + x = last1Minus jajo; + in + { s = table { + SF Sg Gen => x + "a"; + SF Sg Dat => x + "u"; + SF Sg Instr => x + "em"; + SF Sg Loc => x + "u"; + SF Sg _ => x + "o"; + SF Pl Gen => x; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "a" + }; + g = Neut + }; + + +-- oper for neuter, subject ending in -k, +-- consonant lengthening in instr Sg +-- 99* paradigm by Grzegorz Jagodziński +-- 99*_2 by Nowak +-- oper nJablko for jabłko, jajko GF lexicon + + oper k_End_CL_FleetingEplus_N : Str -> CommNoun = \jablko -> + let + x = last1Minus jablko; + y = consLength jablko; + z = fleetingEplus jablko; + in + { s = table { + SF Sg Gen => x + "a"; + SF Sg Dat => x + "u"; + SF Sg Instr => y + "em"; + SF Sg Loc => x + "u"; + SF Sg _ => x + "o"; + SF Pl Gen => z; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "a" + }; + g = Neut + }; + + +-- oper for neuter, noun ending in -o, +-- 100 paradigm by Grzegorz Jagodziński +-- 100_3 by Nowak +-- oper nStudio for radio GF lexicon + + oper o_End_N : Str -> CommNoun = \studio -> + let + x = last1Minus studio; + in + { s = table { + SF Sg Gen => x + "a"; + SF Sg Dat => x + "u"; + SF Sg Instr => x + "em"; + SF Sg Loc => x + "u"; + SF Sg _ => x + "o"; + SF Pl Gen => x + "ów"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "a" + }; + g = Neut + }; + + +-- oper for neuter for dziecko, +-- consonant alternation c:ć in instr Sg. +-- 101 paradigm by Grzegorz Jagodziński & by Nowak +-- oper nDziecko for dziecko GF lexicon + + oper k_End_CAL_N : Str -> CommNoun = \dziecko -> + let + t = last1Minus dziecko; --dzieck + u = last1Minus t; --dziec + w = consLength u; --dzieci + x = consAlt w; --dzieć + y = consLength t; --dziecki + in + { s = table { + SF Sg Gen => t + "a"; + SF Sg Dat => t + "u"; + SF Sg Instr => y + "em"; + SF Sg Loc => t + "u"; + SF Sg _ => t + "o"; + SF Pl Dat => w + "om"; + SF Pl Instr => x + "mi"; + SF Pl Loc => w + "ach"; + SF Pl _ => u + "i" + }; + g = Neut + }; + + +-- oper for neuter, subject ending in -ch, +-- consonant alternation ch:sz +-- 102 paradigm by Grzegorz Jagodziński +-- 102_1 by Nowak +-- oper nUcho for ucho GF lexicon +-- ucho as ear + + oper ch_End_Unregulary_CA_N : Str -> CommNoun = \ucho -> + let + x = last1Minus ucho; + y = consAlt x; + in + { s = table { + SF Sg Gen => x + "a"; + SF Sg Dat => x + "u"; + SF Sg Instr => x + "em"; + SF Sg Loc => x + "u"; + SF Sg _ => x + "o"; + SF Pl Gen => y + "u"; + SF Pl Dat => y + "om"; + SF Pl Instr => y + "ami"; + SF Pl Loc => y + "ach"; + SF Pl _ => y + "y" + }; + g = Neut + }; + +-- oper for neuter, subject ending in -k, +-- consonant alternation for all forms in Pl k:cz +-- 102 paradigm by Grzegorz Jagodziński +-- 102_2 by Nowak +-- oper nOko for oko GF lexicon + + oper k_End_Unregulary_CAL_N : Str -> CommNoun = \oko -> + let + x = last1Minus oko; + y = consAlt oko; + z = consLength x; + in + { s = table { + SF Sg Gen => x + "a"; + SF Sg Dat => x + "u"; + SF Sg Instr => z + "em"; + SF Sg Loc => x + "u"; + SF Sg _ => x + "o"; + SF Pl Gen => y + "u"; + SF Pl Dat => y + "om"; + SF Pl Instr => y + "ami"; + SF Pl Loc => y + "ach"; + SF Pl _ => y + "y" + }; + g = Neut + }; + + + +--1.4 Operations for masculine nouns + + +--1.4.1 Operations for masculine personal + + +-- oper for masculine personal ending in hard consonant +-- -t, -n, nom pl ending in -i +-- consonant alternation t:c, consonant lengthening c:ci, +-- 3 paradigm by Grzegorz Jagodziński +-- 3_1 by Nowak +-- oper nFacet for policjant, student, kuzyn in GF lexicon + + oper hard_End_CAL_MP_1 : Str -> CommNoun = \facet -> + let + x = facet; + y = consAlt x; + z = consLength y; + in + { s = table { + SF Sg Nom => x; + SF Sg Dat => x + "owi"; + SF Sg Instr => x + "em"; + SF Sg Loc => z + "e"; + SF Sg VocP => z + "e"; + SF Sg _ => x + "a"; + SF Pl Nom => y + "i"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl VocP => y + "i"; + SF Pl _ => x + "ów" + }; + g = Masc Personal + }; + + +-- oper for masculine personal ending in hard consonant +-- -t, -n, nom pl ending in -y +-- consonant alternation t:c, consonant lengthening c:ci, +-- 4 paradigm by Grzegorz Jagodziński +-- 4_1 by Nowak +-- oper nArab for szef in GF lexicon + + oper hard_End_CAL_MP_2 : Str -> CommNoun = \Arab -> + let + x = Arab; + y = consLength x; + in + { s = table { + SF Sg Nom => x; + SF Sg Dat => x + "owi"; + SF Sg Instr => x + "em"; + SF Sg Loc => y + "e"; + SF Sg VocP => y + "e"; + SF Sg _ => x + "a"; + SF Pl Nom => x + "owie"; + SF Pl Gen => x + "ów"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Masc Personal + }; + + +-- oper for masculine personal ending in hard consonant +-- -l. Only for przyjaciel (friend). +-- consonant alternation l:ł, vowel alternation e:ó, +-- 7 paradigm by Grzegorz Jagodziński +-- 7 by Nowak +-- oper nPrzyjaciel for przyjaciel in GF lexicon + + oper przyjaciel_VA1_VA2_CA_MP : Str -> CommNoun = \przyjaciel -> + let + t = przyjaciel; + u = vowAlt2 t; -- przyjaciol + w = consAlt u; -- przyjacioł + x = vowAlt1 w; -- przyjaciół + in + { s = table { + SF Sg Nom => t; + SF Sg Dat => t + "owi"; + SF Sg Instr => t + "em"; + SF Sg Loc => t + "u"; + SF Sg VocP => t + "u"; + SF Sg _ => t + "a"; + SF Pl Nom => t + "e"; + SF Pl Dat => w + "om"; + SF Pl Instr => x + "mi"; + SF Pl Loc => w + "ach"; + SF Pl VocP => t + "e"; + SF Pl _ => x + }; + g = Masc Personal + }; + + +-- oper for masculine personal ending in hard consonant -l +-- 8 paradigm by Grzegorz Jagodziński +-- 8_3 by Nowak +-- oper nKowal for nauczyciel (teacher) in GF lexicon + + oper l_End_MP : Str -> CommNoun = \kowal-> + let + t = kowal; + in + { s = table { + SF Sg Nom => t; + SF Sg Dat => t + "owi"; + SF Sg Instr => t + "em"; + SF Sg Loc => t + "u"; + SF Sg VocP => t + "u"; + SF Sg _ => t + "a"; + SF Pl Nom => t + "e"; + SF Pl Dat => t + "om"; + SF Pl Instr => t + "ami"; + SF Pl Loc => t + "ach"; + SF Pl VocP => t + "e"; + SF Pl _ => t + "i" + }; + g = Masc Personal + }; + + +-- oper for masculine personal ending in hard double consonant +-- -rz, -ż, -cz, -sz (piekarz, lekarz, papież, tłumacz, piwosz) +-- 11 paradigm by Grzegorz Jagodziński +-- 11 by Nowak +-- oper nLekarz for lekarz in GF lexicon + + oper hardened_End_MP : Str -> CommNoun = \lekarz -> + let + x = lekarz; + in + { s = table { + SF Sg Nom => x; + SF Sg Dat => x + "owi"; + SF Sg Instr => x + "em"; + SF Sg Loc => x + "u"; + SF Sg VocP => x + "u"; + SF Sg _ => x + "a"; + SF Pl Nom => x + "e"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl VocP => x + "e"; + SF Pl _ => x + "y" + }; + g = Masc Personal + }; + + +-- oper for masculine personal ending in -ul +-- (konsul, król) +-- 13 paradigm by Grzegorz Jagodziński +-- 13_3 by Nowak +-- oper nKrol for król in GF lexicon + + oper ul_End_MP : Str -> CommNoun = \krol-> + let + x = krol; + in + { s = table { + SF Sg Nom => x; + SF Sg Dat => x + "owi"; + SF Sg Instr => x + "em"; + SF Sg Loc => x + "u"; + SF Sg VocP => x + "u"; + SF Sg _ => x + "a"; + SF Pl Nom => x + "owie"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl VocP => x + "e"; + SF Pl _ => x + "ów" + }; + g = Masc Personal + }; + + +-- oper for masculine personal ending in -ż (mąż), +-- vowel alternation ą:ę (mąż:męża) +-- 13' paradigm by Grzegorz Jagodziński +-- 13' by Nowak +-- oper nMaz for mąż in GF lexicon + + oper maz_MP : Str -> CommNoun = \maz -> + let + x = maz; + y = vowAlt3 x; + in + { s = table { + SF Sg Nom => x; + SF Sg Dat => y + "owi"; + SF Sg Instr => y + "em"; + SF Sg Loc => y + "u"; + SF Sg VocP => y + "u"; + SF Sg _ => y + "a"; + SF Pl Nom => y + "owie"; + SF Pl Dat => y + "om"; + SF Pl Instr => y + "ami"; + SF Pl Loc => y + "ach"; + SF Pl VocP => y + "owie"; + SF Pl _ => y + "ów" + }; + g = Masc Personal + }; + + +-- oper for masculine personal ending in -g (wróg), +-- vowel alternation ó:o (wróg:wroga) +-- only for wróg +-- 14' paradigm by Grzegorz Jagodziński +-- 14' by Nowak +-- oper nWrog for wróg in GF lexicon + + oper wrog_VA1_CL_MP : Str -> CommNoun = \wrog -> + let + x = vowAlt1 wrog; + y = consLength x; + in + { s = table { + SF Sg Nom => wrog; + SF Sg Dat => x + "owi"; + SF Sg Instr => y + "em"; + SF Sg Loc => x + "u"; + SF Sg VocP => x + "u"; + SF Sg _ => x + "a"; + SF Pl Nom => x + "owie"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl VocP => x + "owie"; + SF Pl _ => x + "ów" + }; + g = Masc Personal + }; + + +-- oper for masculine personal "ksiądz" +-- 20 paradigm by Grzegorz Jagodziński +-- 20 by Nowak +-- oper nKsiadz for ksiądz in GF lexicon + + oper ksiadz_VA3_CA_MP : Str -> CommNoun = \ksiadz -> + let + x = vowAlt3 ksiadz; -- księdz + y = consAlt x; -- księż + in + { s = table { + SF Sg Nom => ksiadz; + SF Sg Dat => x + "u"; + SF Sg Instr => x + "em"; + SF Sg Loc => x + "u"; + SF Sg VocP => y + "e"; + SF Sg _ => x + "a"; + SF Pl Nom => y + "a"; + SF Pl Dat => y + "om"; + SF Pl Instr => y + "mi"; + SF Pl Loc => y + "ach"; + SF Pl VocP => y + "a"; + SF Pl _ => y + "y" + }; + g = Masc Personal + }; + + +-- oper for masculine personal ending in -ciec +-- (ojciec, praojciec) +-- 21* paradigm by Grzegorz Jagodziński +-- 21* by Nowak +-- oper nOjciec for ojciec in GF lexicon + + oper ciec_End_CA_FleetingIEminus_MP : Str -> CommNoun = \ojciec -> + let + w = fleetingIEminus ojciec; -- ojcc + x = last1Minus w; -- ojc + y = consAlt x; -- ojcz + in + { s = table { + SF Sg Nom => ojciec; + SF Sg Dat => x + "u"; + SF Sg Instr => x + "em"; + SF Sg Loc => x + "u"; + SF Sg VocP => y + "e"; + SF Sg _ => x + "a"; + SF Pl Nom => x + "owie"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl VocP => x + "owie"; + SF Pl _ => x + "ów" + }; + g = Masc Personal + }; + + +-- oper for masculine personal ending in a hard consonant -t +-- 18 paradigm by Grzegorz Jagodziński +-- 18 by Nowak +-- oper nBrat for brat in GF lexicon + + oper hard_End_CAL_MP : Str -> CommNoun = \brat -> + let + x = brat; + y = consAlt x; -- brat:brac + z = consLength y; -- brac:braci + t = consAlt y; -- brac:brać + in + { s = table { + SF Sg Nom => x; + SF Sg Dat => x + "u"; + SF Sg Instr => x + "em"; + SF Sg Loc => z + "e"; + SF Sg VocP => z + "e"; + SF Sg _ => x + "a"; + SF Pl Nom => z + "a"; + SF Pl Dat => z + "om"; + SF Pl Instr => t + "mi"; + SF Pl Loc => z + "ach"; + SF Pl VocP => z + "a"; + SF Pl _ => y + "i" + }; + g = Masc Personal + }; + + +-- oper for masculine personal "bóg" +-- 22' paradigm by Grzegorz Jagodziński +-- 22' by Nowak +-- oper nBog for bóg in GF lexicon + + oper bog_VA1_CAL_MP : Str -> CommNoun = \bog -> + let + x = vowAlt1 bog; -- bog + y = consLength x; -- bogi + z = vowAlt1 (consAlt bog); -- boż + in + { s = table { + SF Sg Nom => bog; + SF Sg Dat => x + "u"; + SF Sg Instr => y + "em"; + SF Sg Loc => x + "u"; + SF Sg VocP => z + "e"; + SF Sg _ => x + "a"; + SF Pl Nom => x + "owie"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl VocP => x + "owie"; + SF Pl _ => x + "ów" + }; + g = Masc Personal + }; + + +-- oper for masculine personal ending in -iec +-- ( chłopiec) +-- 24** paradigm by Grzegorz Jagodziński +-- 24** by Nowak +-- oper nChlopiec for chłopiec in GF lexicon + + oper iec_End_CA_FleetingIEminus_MP : Str -> CommNoun = \chlopiec -> + let + x = fleetingIEminus chlopiec; -- chlopc + y = consAlt x; -- chlopcz + in + { s = table { + SF Sg Nom => chlopiec; + SF Sg Dat => x + "u"; + SF Sg Instr => x + "em"; + SF Sg Loc => x + "u"; + SF Sg VocP => y + "e"; + SF Sg _ => x + "a"; + SF Pl Nom => x + "y"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl VocP => x + "y"; + SF Pl _ => x + "ów" + }; + g = Masc Personal + }; + + +-- oper for masculine personal ending in -zna +-- consinant alternation z:ź, consonant lengthening n:ni +-- 34 paradigm by Grzegorz Jagodziński +-- 34 by Nowak +-- oper nMezczyzna for mężczyzna in GF lexicon + + oper zna_End_CAL_MP : Str -> CommNoun = \mezczyzna -> + let + x = last1Minus mezczyzna; -- mężczyzn + y = consAlt x; -- mężczyźn + z = consLength y;-- mężczyźni + in + { s = table { + SF Sg Nom => x + "a"; + SF Sg Gen => x + "y"; + SF Sg Dat => z + "e"; + SF Sg Acc => x + "ę"; + SF Sg Instr => x + "ą"; + SF Sg Loc => z + "e"; + SF Sg VocP => x + "o"; + SF Pl Nom => y + "i"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl VocP => y + "i"; + SF Pl _ => x + }; + g = Masc Personal + }; + + +-- oper for masculine personal ending in a hard consonant +-- + "a" (tata, gazda, drużba, ortodoksa) +-- 36 paradigm by Grzegorz Jagodziński +-- 36 by Nowak +-- oper nDruzba for tata (synonym for ojciec) in GF lexicon +{- oper hard_plus_a_CAL_MP : Str -> CommNoun = \druzba -> + let + x = last1Minus druzba; + + in + { s = table { + SF Sg Nom => x; + SF Sg Dat => x + "owi"; + SF Sg Instr => x + "em"; + SF Sg Loc => x + "u"; + SF Sg VocP => x + "u"; + SF Sg _ => x + "a"; + SF Pl Nom => x + "e"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl VocP => x + "e"; + SF Pl _ => x + "y" + }; + g = Masc Personal + }; -} + + +--1.4.2 Operations for masculine animate + + +-- oper for masculine animate ending in -ń +-- 59 paradigm by Grzegorz Jagodziński +-- 59 by Nowak +-- oper nKon for koń in GF lexicon + + oper kon_CAL_MA : Str -> CommNoun = \kon -> + let + x = consAlt kon; --kon + y = consLength x; -- koni + in + { s = table { + SF Sg Nom => kon; + SF Sg Dat => y + "owi"; + SF Sg Instr => y + "em"; + SF Sg Loc => y + "u"; + SF Sg VocP => y + "u"; + SF Sg _ => y + "a"; + SF Pl Gen => x + "i"; + SF Pl Dat => y + "om"; + SF Pl Instr => kon + "mi"; + SF Pl Loc => y + "ach"; + SF Pl _ => y + "e" + }; + g = Masc Animate + }; + + +-- oper for masculine animate for "wąż" +-- 61' paradigm by Grzegorz Jagodziński +-- 61' by Nowak +-- oper nWaz for wąż in GF lexicon + + oper waz_VA3_MA : Str -> CommNoun = \waz -> + let + y = vowAlt3 waz; -- węż + in + { s = table { + SF Sg Nom => waz; + SF Sg Dat => y + "owi"; + SF Sg Instr => y + "em"; + SF Sg Loc => y + "u"; + SF Sg VocP => y + "u"; + SF Sg _ => y + "a"; + SF Pl Gen => y + "y"; + SF Pl Dat => y + "om"; + SF Pl Instr => y + "ami"; + SF Pl Loc => y + "ach"; + SF Pl _ => y + "e" + }; + g = Masc Animate + }; + + +-- oper for masculine animate ending in -k +-- 62 paradigm by Grzegorz Jagodziński +-- 62 by Nowak +-- oper nPtak for ptak, robak in GF lexicon + + oper k_End_CL_MA : Str -> CommNoun = \ptak -> + let + y = consLength ptak; -- ptaki + in + { s = table { + SF Sg Nom => ptak; + SF Sg Dat => ptak + "owi"; + SF Sg Instr => y + "em"; + SF Sg Loc => ptak + "u"; + SF Sg VocP => ptak + "u"; + SF Sg _ => ptak + "a"; + SF Pl Gen => ptak + "ów"; + SF Pl Dat => ptak + "om"; + SF Pl Instr => ptak + "ami"; + SF Pl Loc => ptak + "ach"; + SF Pl _ => ptak + "i" + }; + g = Masc Animate + }; + + +-- oper for masculine animate for "kot" +-- 64 paradigm by Grzegorz Jagodziński +-- 64 by Nowak +-- oper nKot for kot in GF lexicon + + oper kot_CAL_MA : Str -> CommNoun = \kot -> + let + x = consAlt kot; --koc + y = consLength x; -- koci + in + { s = table { + SF Sg Nom => kot; + SF Sg Dat => kot + "u"; + SF Sg Instr => kot + "em"; + SF Sg Loc => y + "e"; + SF Sg VocP => y + "e"; + SF Sg _ => kot + "a"; + SF Pl Gen => kot + "ów"; + SF Pl Dat => kot + "om"; + SF Pl Instr => kot + "ami"; + SF Pl Loc => y + "ach"; + SF Pl _ => kot + "y" + }; + g = Masc Animate + }; + + +-- oper for masculine animate for "pies" +-- 64** paradigm by Grzegorz Jagodziński +-- 64** by Nowak +-- oper nPies for pies in GF lexicon + + oper pies_CL_FleetingIEminus_MA : Str -> CommNoun = \pies -> + let + x = fleetingIEminus pies; -- ps + y = consLength x; -- psi + in + { s = table { + SF Sg Nom => pies; + SF Sg Dat => x + "u"; + SF Sg Instr => x + "em"; + SF Sg Loc => y + "e"; + SF Sg VocP => y + "e"; + SF Sg _ => x + "a"; + SF Pl Gen => x + "ów"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Masc Animate + }; + + + +--1.4.3 Operations for masculine inanimate + + +-- oper for masculine inanimate ending in +-- a vowel + a hard consonant +-- consonant alternation t:c and then lengthening c:ci +-- 70 paradigm by Grzegorz Jagodziński +-- 70_1_1 by Nowak +-- oper nBat for but in GF lexicon + + oper vowel_hard_CAL_MI : Str -> CommNoun = \bat -> + let + u = bat; + x = consLength (consAlt u); -- baci + in + { s = table { + SF Sg Nom => u; + SF Sg Dat => u + "owi"; + SF Sg Instr => u + "em"; + SF Sg Loc => x + "e"; + SF Sg VocP => x + "e"; + SF Sg _ => u + "a"; + SF Pl Gen => u + "ów"; + SF Pl Dat => u + "om"; + SF Pl Instr => u + "ami"; + SF Pl Loc => u + "ach"; + SF Pl _ => u + "y" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate ending in +-- a vowel + a hard consonant +-- almost like nBat, but with consonant alternation +-- only consonant lengthening +-- (dzban, chleb, Berlin, kręgosłup, kilogram) +-- 70 paradigm by Grzegorz Jagodziński +-- 70_1_2 by Nowak +-- oper nBat for chleb, włos, nos, ogon in GF lexicon + + oper vowel_hard_CL_MI : Str -> CommNoun = \chleb -> + let + u = chleb; + x = consLength u; -- chlebi + in + { s = table { + SF Sg Nom => u; + SF Sg Dat => u + "owi"; + SF Sg Instr => u + "em"; + SF Sg Loc => x + "e"; + SF Sg VocP => x + "e"; + SF Sg _ => u + "a"; + SF Pl Gen => u + "ów"; + SF Pl Dat => u + "om"; + SF Pl Instr => u + "ami"; + SF Pl Loc => u + "ach"; + SF Pl _ => u + "y" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate ending in -r +-- consonant alternation r:rz (ser:serze) +-- 70 paradigm by Grzegorz Jagodziński +-- 70_5 by Nowak +-- oper nSer for ser in GF lexicon + + oper r_End_CA_MI : Str -> CommNoun = \ser -> + let + x = ser; + y = consAlt ser; -- serz + in + { s = table { + SF Sg Nom => x; + SF Sg Dat => x + "owi"; + SF Sg Instr => x + "em"; + SF Sg Loc => y + "e"; + SF Sg VocP => y + "e"; + SF Sg _ => x + "a"; + SF Pl Gen => x + "ów"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate ending in -ąb +-- consonant alternation ą:ę (ząb:zęba) +-- 70' paradigm by Grzegorz Jagodziński +-- 70'_1 by Nowak +-- oper nZab for ząb in GF lexicon + + oper ab_End_VA3_CL_MI : Str -> CommNoun = \zab -> + let + y = vowAlt3 zab; -- zęb + z = consLength y; + in + { s = table { + SF Sg Nom => zab; + SF Sg Dat => y + "owi"; + SF Sg Instr => y + "em"; + SF Sg Loc => z + "e"; + SF Sg VocP => z + "e"; + SF Sg _ => y + "a"; + SF Pl Gen => y + "ów"; + SF Pl Dat => y + "om"; + SF Pl Instr => y + "ami"; + SF Pl Loc => y + "ach"; + SF Pl _ => y + "y" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate ending for "kościół" +-- 70^' paradigm by Grzegorz Jagodziński +-- 70^' by Nowak +-- oper nKosciol for kościół in GF lexicon + + oper kosciol_VA1_VA2_CA_MI : Str -> CommNoun = \kosciol -> + let + x = vowAlt1 kosciol; -- kościoł + y = consAlt (vowAlt2 x); -- kościel + in + { s = table { + SF Sg Nom => kosciol; + SF Sg Dat => x + "owi"; + SF Sg Instr => x + "em"; + SF Sg Loc => y + "e"; + SF Sg VocP => y + "e"; + SF Sg _ => x + "a"; + SF Pl Gen => x + "ów"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate ending in a weak +-- consonant (promień, Brześć, Niedźwiedź, Zamość) +-- consonant alternation and lengthening +-- 71 paradigm by Grzegorz Jagodziński +-- 71_1 by Nowak +-- oper nCien for korzeń, kamień in GF lexicon + + oper week_End_CAL_MI : Str -> CommNoun = \cien -> + let + x = consAlt cien; -- cień:cien + y = consLength x; -- cieni + in + { s = table { + SF Sg Nom => cien; + SF Sg Gen => y + "a"; + SF Sg Dat => y + "u"; + SF Sg Acc => cien; + SF Sg Instr => y + "em"; + SF Sg _ => y + "u"; + SF Pl Gen => x + "i"; + SF Pl Dat => y + "om"; + SF Pl Instr => y + "ami"; + SF Pl Loc => y + "ach"; + SF Pl _ => y + "e" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate ending in a weak +-- consonant alternation and lengthening +-- fleeting ie minus (łokieć, stopień) +-- 71** paradigm by Grzegorz Jagodziński +-- 71**_1 by Nowak +-- oper nPien for ogień, paznokieć in GF lexicon + + oper week_End_CAL_FleetingIEminus_MI : Str -> CommNoun = \pien -> + let + x = fleetingIEminus pien; -- pń + y = consAlt x; -- pn + z = consLength y; -- pni + in + { s = table { + SF Sg Nom => pien; + SF Sg Dat => z + "u"; + SF Sg Instr => z + "em"; + SF Sg Loc => z + "u"; + SF Sg VocP => z + "u"; + SF Sg _ => z + "a"; + SF Pl Gen => y + "i"; + SF Pl Dat => z + "om"; + SF Pl Instr => z + "ami"; + SF Pl Loc => z + "ach"; + SF Pl _ => z + "e" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate ending in -ść, +-- for liść +-- 72 paradigm by Grzegorz Jagodziński +-- 72 by Nowak +-- oper nLisc for liść in GF lexicon + + oper lisc_CAL_MI : Str -> CommNoun = \lisc -> + let + x = consAlt lisc; -- liśc + y = consLength x; -- liści + in + { s = table { + SF Sg Nom => lisc; + SF Sg Gen => y + "a"; + SF Sg Dat => y + "owi"; + SF Sg Acc => lisc; + SF Sg Instr => y + "em"; + SF Sg _ => y + "u"; + SF Pl Gen => x + "i"; + SF Pl Dat => y + "om"; + SF Pl Instr => lisc + "mi"; + SF Pl Loc => y + "ach"; + SF Pl _ => y + "e" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate ending in +-- a hardened consonant: -ż, -rz, -c, -cz, -dz +-- (gorąc, piec, Kalisz, tłuszcz, bicz, Spisz, Zgierz, Paryż, Łowicz) +-- 73 paradigm by Grzegorz Jagodziński +-- 73_5 by Nowak +-- oper nKoc for piec, tłuszcz, Paryż in GF lexicon + + oper hardened_End_MI_1 : Str -> CommNoun = \koc -> + let + x = koc; + in + { s = table { + SF Sg Nom => x; + SF Sg Dat => x + "owi"; + SF Sg Instr => x + "em"; + SF Sg Loc => x + "e"; + SF Sg VocP => x + "e"; + SF Sg _ => x + "a"; + SF Pl Nom => x + "e"; + SF Pl Gen => x + "ów"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate ending in +-- a hardened consonant: -ż, -rz, -c, -cz, -dz +-- (kapelusz, księżyc) +-- 74 paradigm by Grzegorz Jagodziński +-- 74 by Nowak +-- oper nWiersz for księżyc, kapelusz in GF lexicon + + oper hardened_End_MI_2 : Str -> CommNoun = \wiersz -> + let + x = wiersz; + in + { s = table { + SF Sg Nom => x; + SF Sg Dat => x + "owi"; + SF Sg Instr => x + "em"; + SF Sg Loc => x + "e"; + SF Sg VocP => x + "e"; + SF Sg _ => x + "a"; + SF Pl Gen => x + "y"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "e" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate for "dzień" +-- 76** paradigm by Grzegorz Jagodziński +-- 76** by Nowak +-- oper nDzien for dzień in GF lexicon + + oper dzien_MI : Str -> CommNoun = \dzien -> + let + x = fleetingLettersMinus dzien; -- dń + y = consAlt x; -- dń:dn + z = consLength y; -- dn:dni + in + { s = table { + SF Sg Nom => dzien; + SF Sg Dat => z + "u"; + SF Sg Instr => z + "em"; + SF Sg Loc => z + "e"; + SF Sg VocP => z + "e"; + SF Sg _ => z + "a"; + SF Pl Dat => z + "om"; + SF Pl Instr => z + "ami"; + SF Pl Loc => z + "ach"; + SF Pl _ => y + "i" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate ending in -k, -g +-- consonant lengthening +-- (ranek, skrawek, Owtock, Hamburg, drąg) +-- 77 paradigm by Grzegorz Jagodziński +-- 77_1 by Nowak +-- oper nKajak for język, patyk in GF lexicon + + oper g_k_End_CL_MI_1 : Str -> CommNoun = \kajak -> + let + x = kajak; + y = consLength kajak; -- kajaki + in + { s = table { + SF Sg Gen => x + "a"; + SF Sg Dat => x + "owi"; + SF Sg Instr => y + "em"; + SF Sg Loc => x + "u"; + SF Sg VocP => x + "u"; + SF Sg _ => x ; + SF Pl Gen => x + "ów"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "i" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate ending in -ek +-- fleeting e minus +-- (fiołek, garnek, podkoszulek, przecinek, Włocławek) +-- 77* paradigm by Grzegorz Jagodziński +-- 70* by Nowak +-- oper nMlotek for ołówek in GF lexicon + + oper k_End_CL_FleetingEminus_MI : Str -> CommNoun = \mlotek -> + let + x = fleetingEminus mlotek; -- mlotk + y = consLength x; -- mlotki + in + { s = table { + SF Sg Nom => mlotek; + SF Sg Gen => x + "a"; + SF Sg Dat => x + "owi"; + SF Sg Acc => mlotek; + SF Sg Instr => y + "em"; + SF Sg _ => x + "u"; + SF Pl Gen => x + "ów"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "i" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate ending in -ch +-- (bebech, Wałbrzych, brzuch, łańcuch) +-- 78 paradigm by Grzegorz Jagodziński +-- 78_1 by Nowak +-- oper nMiech for brzuch in GF lexicon + + oper ch_End_MI : Str -> CommNoun = \miech -> + let + x = miech; + in + { s = table { + SF Sg Nom => x; + SF Sg Gen => x + "a"; + SF Sg Dat => x + "owi"; + SF Sg Acc => x; + SF Sg Instr => x + "em"; + SF Sg _ => x + "u"; + SF Pl Gen => x + "ów"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate ending in a hard consonant +-- consonant alternation and lengthening +-- 82 paradigm by Grzegorz Jagodziński +-- 82_1_1 by Nowak +-- oper nSad for samotot, uniwersytet, port, sufit in GF lexicon + + oper hard_End_CAL_MI : Str -> CommNoun = \sad -> + let + x = sad; + y = consLength (consAlt x); -- sadzi + in + { s = table { + SF Sg Nom => x; + SF Sg Gen => x + "u"; + SF Sg Dat => x + "owi"; + SF Sg Acc => x; + SF Sg Instr => x + "em"; + SF Sg _ => y + "e"; + SF Pl Gen => x + "ów"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate ending in a hard consonant +-- consonant lengthening +-- 82 paradigm by Grzegorz Jagodziński +-- 82_1_2 by Nowak +-- oper nDym for dym, dywan, sklep in GF lexicon + + oper hard_End_CL_MI : Str -> CommNoun = \dym -> + let + x = dym; + y = consLength x; -- dymi + in + { s = table { + SF Sg Nom => x; + SF Sg Gen => x + "u"; + SF Sg Dat => x + "owi"; + SF Sg Acc => x; + SF Sg Instr => x + "em"; + SF Sg _ => y + "e"; + SF Pl Gen => x + "ów"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate ending in +-- a hard consonant -ł, -r +-- consonant alternation +-- (artykuł, finał, kryształ, materiał) +-- 82 paradigm by Grzegorz Jagodziński +-- 82_2 + 82_3 by Nowak +-- oper nWal for przemysł, papier, rower in GF lexicon + + oper hard_End_CA_MI : Str -> CommNoun = \wal -> + let + x = wal; + y = consAlt x; -- wał:wal + in + { s = table { + SF Sg Nom => x; + SF Sg Gen => x + "u"; + SF Sg Dat => x + "owi"; + SF Sg Acc => x; + SF Sg Instr => x + "em"; + SF Sg _ => y + "e"; + SF Pl Gen => x + "ów"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate ending in -ó + hard consonant +-- vowel and consonant alternation +-- (rosół, zespół, otwór, wodór ) +-- 82' paradigm by Grzegorz Jagodziński +-- 82' by Nowak +-- oper nDol for stól in GF lexicon + + oper hard_End_VA1_CA_MI : Str -> CommNoun = \dol -> + let + x = vowAlt1 dol; -- dół:doł + y = consAlt x; -- doł:dol + in + { s = table { + SF Sg Nom => dol; + SF Sg Gen => x + "u"; + SF Sg Dat => x + "owi"; + SF Sg Acc => dol; + SF Sg Instr => x + "em"; + SF Sg _ => y + "e"; + SF Pl Gen => x + "ów"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate ending in -ó + hard consonant +-- vowel and consonant alternation +-- (obwód, wschód, przewód, rozwód) +-- 82' paradigm by Grzegorz Jagodziński +-- 82' by Nowak +-- oper nOgrod for ogród, lód, samochód in GF lexicon + + oper hard_End_VA1_CAL_MI : Str -> CommNoun = \ogrod -> + let + x = vowAlt1 ogrod; -- ogród:ogrod + y = consLength (consAlt x); -- ogrod:ogrodz:ogrodzi + in + { s = table { + SF Sg Nom => ogrod; + SF Sg Gen => x + "u"; + SF Sg Dat => x + "owi"; + SF Sg Acc => ogrod; + SF Sg Instr => x + "em"; + SF Sg _ => y + "e"; + SF Pl Gen => x + "ów"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate ending in a hard consonant +-- vowel alternation, +-- consonant alternation and lengthening +-- (najazd, wszechświat, przyjazd) +-- 82^ paradigm by Grzegorz Jagodziński +-- 82^_1_1 by Nowak +-- oper nKwiat for kwiat in GF lexicon + + oper hard_End_VA2_CAL_MI : Str -> CommNoun = \kwiat -> + let + x = kwiat; + y = vowAlt2 kwiat; -- kwiet + z = consLength (consAlt y); -- kwiet:kwiec:kwieci + in + { s = table { + SF Sg Nom => x; + SF Sg Gen => x + "u"; + SF Sg Dat => x + "owi"; + SF Sg Acc => x; + SF Sg Instr => x + "em"; + SF Sg _ => z + "e"; + SF Pl Gen => x + "ów"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate ending in a hard consonant +-- vowel alternation, +-- consonant lengthening +-- 82^ paradigm by Grzegorz Jagodziński +-- 82^_1_2 by Nowak +-- oper nLas for las in GF lexicon + + oper hard_End_VA2_CL_MI : Str -> CommNoun = \las -> + let + x = las; + y = consLength (vowAlt2 x); -- las:les:lesi + in + { s = table { + SF Sg Nom => x; + SF Sg Gen => x + "u"; + SF Sg Dat => x + "owi"; + SF Sg Acc => x; + SF Sg Instr => x + "em"; + SF Sg _ => y + "e"; + SF Pl Gen => x + "ów"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Masc Inanimate + }; + + + +-- oper for masculine inanimate for wiatr +-- vowel alternation, +-- consonant alternation +-- 82^ paradigm by Grzegorz Jagodziński +-- 82^_2 by Nowak +-- oper nWiatr for wiart in GF lexicon + + oper wiatr_VA2_CA_MI : Str -> CommNoun = \wiatr -> + let + x = wiatr; + y = consAlt (vowAlt2 x); -- wiatr:wietr:wietrz + in + { s = table { + SF Sg Nom => x; + SF Sg Gen => x + "u"; + SF Sg Dat => x + "owi"; + SF Sg Acc => x; + SF Sg Instr => x + "em"; + SF Sg _ => y + "e"; + SF Pl Gen => x + "ów"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate for "popiół" +-- vowel and consonant alternation +-- 82^' paradigm by Grzegorz Jagodziński +-- 82^' by Nowak +-- oper nPopiol for popiół in GF lexicon + + oper popiol_VA2_CA_MI : Str -> CommNoun = \popiol -> + let + x = vowAlt1 popiol; -- popiół:popioł + y = consAlt (vowAlt2 x); -- popioł:popieł:popiel + in + { s = table { + SF Sg Nom => popiol; + SF Sg Gen => x + "u"; + SF Sg Dat => x + "owi"; + SF Sg Acc => popiol; + SF Sg Instr => x + "em"; + SF Sg _ => y + "e"; + SF Pl Gen => x + "ów"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate ending in -ój +-- vowel alternation +-- last minus +-- (powój, drobnoustrój, strój, zwój) +-- 85' paradigm by Grzegorz Jagodziński (in the big table) +-- 85'_1 by Nowak +-- oper nPokoj for pokój in GF lexicon + + oper onlySgNoun : Str -> CommNoun = \pokoj -> + let + x = vowAlt1 pokoj; -- pokój:pokoj + y = last1Minus x; -- poko + in + { s = table { + SF Sg Nom => pokoj; + SF Sg Gen => x + "u"; + SF Sg Dat => x + "owi"; + SF Sg Acc => pokoj; + SF Sg Instr => x + "em"; + SF Sg _ => x + "u"; + SF Pl _ => "[" ++ pokoj ++ [": the plural form does not exist]"] + }; + g = Masc Inanimate + }; + +-- oper for masculine inanimate ending in a vowel + -j +-- (obyczaj, tramwaj, przywilej, klej) or in a +-- hardened consonant -ż, -rz, -c, -cz, -dz +-- (Asyż, marsz, pieprz, szkic, wyż, mosiądz) +-- 85 paradigm by Grzegorz Jagodziński +-- 85_1 + 85_3 by Nowak +-- oper nGaj for kraj, olej, deszcz, owoc in GF lexicon + + oper vowel_j_or_handened_End_MI : Str -> CommNoun = \gaj -> + let + x = gaj; + in + { s = table { + SF Sg Nom => x; + SF Sg Dat => x + "owi"; + SF Sg Acc => x; + SF Sg Instr => x + "em"; + SF Sg _ => x + "u"; + SF Pl Gen => x + "ów"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "e" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate ending in consonants -g, -k +-- (blok, dotyk, Kołobrzeg, Bug) +-- 87 paradigm by Grzegorz Jagodziński +-- 87 by Nowak +-- oper nBrzeg for bank, kark in GF lexicon + + oper g_k_End_CL_MI_2 : Str -> CommNoun = \brzeg -> + let + x = brzeg; + y = consLength x; + in + { s = table { + SF Sg Nom => x; + SF Sg Dat => x + "owi"; + SF Sg Acc => x; + SF Sg Instr => y + "em"; + SF Sg _ => x + "u"; + SF Pl Gen => x + "ów"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "i" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate only for rok +-- 87@ paradigm by Grzegorz Jagodziński +-- 87@ by Nowak +-- oper nRok for rok in GF lexicon + + oper rok_UnregularyPl_CL_MI : Str -> Str -> CommNoun = \rok, lata -> + let + x = rok; + y = consLength x; + z = last1Minus lata; + in + { s = table { + SF Sg Nom => x; + SF Sg Dat => x + "owi"; + SF Sg Acc => x; + SF Sg Instr => y + "em"; + SF Sg _ => x + "u"; + SF Pl Gen => z; + SF Pl Dat => z + "om"; + SF Pl Instr => z + "ami"; + SF Pl Loc => z + "ach"; + SF Pl _ => z + "a" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate ending in -óg +-- (stóg, głóg, barłóg) +-- 87' paradigm by Grzegorz Jagodziński +-- 87' by Nowak +-- oper nProg for róg in GF lexicon + + oper ug_End_VA1_CL_MI : Str -> CommNoun = \prog -> + let + x = vowAlt1 prog; + y = consLength x; + in + { s = table { + SF Sg Nom => prog; + SF Sg Dat => x + "owi"; + SF Sg Acc => prog; + SF Sg Instr => y + "em"; + SF Sg _ => x + "u"; + SF Pl Gen => x + "ów"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "i" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate ending in -ek +-- (poniedziałek, obiadek, proszek, początek) +-- 87* paradigm by Grzegorz Jagodziński +-- 87* by Nowak +-- oper nStatek for piasek in GF lexicon + + oper k_End_CL_FleetingEmins_MI : Str -> CommNoun = \statek -> + let + x = fleetingEminus statek; -- statk + y = consLength x; + in + { s = table { + SF Sg Nom => statek; + SF Sg Dat => x + "owi"; + SF Sg Acc => statek; + SF Sg Instr => y + "em"; + SF Sg _ => x + "u"; + SF Pl Gen => x + "ów"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "i" + }; + g = Masc Inanimate + }; + + +-- oper for masculine inanimate ending in -ch and for dom +-- (oddech, uśmiech, zamach, strych) +-- 88 paradigm by Grzegorz Jagodziński +-- 88_1 + 88_2 by Nowak +-- oper nDom for dom, dach in GF lexicon + + oper ch_End_dom_MI : Str -> CommNoun = \dom -> + let + x = dom; + in + { s = table { + SF Sg Nom => x; + SF Sg Dat => x + "owi"; + SF Sg Acc => x; + SF Sg Instr => x + "em"; + SF Sg _ => x + "u"; + SF Pl Gen => x + "ów"; + SF Pl Dat => x + "om"; + SF Pl Instr => x + "ami"; + SF Pl Loc => x + "ach"; + SF Pl _ => x + "y" + }; + g = Masc Inanimate + }; + +--8 Patterns of auxiliary operations mostly used for nouns + +-- for consonant alternation k:c, g:dz at the end of the subject, +-- or at the end of the noun + + oper consAlt : Str -> Str = \s -> + case s of + { x + "ch" + ("a"|"i"|"e"|"o"|"") => x + "sz" ; -- mucha:musze, klecha:klesze + x + "ch" + "y" => x + "s" ; -- głuchy:głusi + x + "sn" + ("a"|"i"|"e"|"o"|"y"|"") => x + "śn" ; -- wiosna:wiośnie + x + "st" + ("a"|"i"|"e"|"o"|"y"|"") => x + "śc" ; -- artysta:artyście + x + "sł" + ("a"|"i"|"e"|"o"|"y"|"") => x + "śl" ; -- krzesło:krześle, masło:maśle + x + "dz" + ("a"|"i"|"e"|"o"|"y"|"") => x + "ż" ; -- ksiądz:księża + x + "dź" + ("a"|"i"|"e"|"o"|"y"|"") => x + "dz" ; -- łódź:łodzi + x + "zn" + ("a"|"i"|"e"|"o"|"y"|"") => x + "źn" ; -- meżczyzna:mężczyźnie + x + "zd" + ("a"|"i"|"e"|"o"|"y"|"") => x + "źdz" ; -- gniazdo:gnieździe + x + "ni" + ("a"|"i"|"e"|"o"|"y"|"") => x + "ń" ; -- danie:dań + x + "ci" + ("a"|"i"|"e"|"o"|"y"|"") => x + "ć" ; + x + "sz" + ("a"|"i"|"e"|"o"|"y"|"") => x + "s" ; + ----------------------------------------------------------------------- + -- The alternation of one consonant has to be behind the alternation of + -- two other consonants, else they aren't checked. + x + "o" + "k" + "o" => "o" + "cz" ;-- oko:oczy + x + "ć" + ("a"|"i"|"e"|"o"|"y"|"") => x + "c" ; --sieć:sieci + x + "j" + "c" => x + "j" + "cz" ; -- ojciec:ojc:ojcze + x + "op" + "c" => x + "op" + "cz" ; -- chłopiec:chłopc:chłopcze + x + "ie" + "c" + ("a"|"i"|"e"|"o"|"y"|"") => x + "ie" + "ć" ; -- dziecko:dziećmi + x + "óg" + "" => x + "óż" ; -- bóg:boże + x + "l" + ("a"|"i"|"e"|"o"|"y"|"") => x + "ł" ; -- przyjaciel:przyjaciół + x + "ł" + ("a"|"i"|"e"|"o"|"y"|"") => x + "l" ; -- siła:sile, biegły:biegli + x + "yn" + ("a"|"i"|"e"|"o"|"y"|"") => x + "yn" ; + x + "n" + ("a"|"i"|"e"|"o"|"y"|"") => x + "n" ; + x + "ń" + ("a"|"i"|"e"|"o"|"y"|"") => x + "n" ; -- dzień:dni ,pień:pni, cień:cieni + x + "r" + ("a"|"i"|"e"|"o"|"y"|"") => x + "rz" ; -- nora:norze, psychiatra:psychiatrze + x + "ś" + ("a"|"i"|"e"|"o"|"y"|"") => x + "s" ; -- pierś:piersi + x + "ź" + ("a"|"i"|"e"|"o"|"y"|"") => x + "z" ; + x + ("g"|"d") + ("a"|"i"|"e"|"o"|"y"|"") => x + "dz" ; -- noga:nodze; sługa:słudze + x + ("k"|"t") + ("a"|"i"|"e"|"o"|"y"|"") => x + "c" ; -- apteka:aptece; moneta:monecie, tata:tacie + x + "c" + ("a"|"i"|"e"|"o"|"y"|"") => x + "ć" ; --brat:bracie:braćmi + x + "ż" + ("a"|"i"|"e"|"o"|"y"|"") => x + "z" ; + _ => last1Minus s + } ; + + + +-- Auxiliary operation for consonant lengthening +-- The consonant in polish is lengthened by a vowel "i" +-- łódź:łodzi, krew:krwi, wieś:wsi + + oper consLength : Str -> Str = \s -> + case s of + { x + y@("b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + ("a"|"u"|"e"|"o"|"") + => x + y + "i" + } ; + +-- Auxiliary operation for vowel alternation +-- o:ó (droga:dróg); +-- ó:o (nierób:nieroba, łódź:łodzi) + + oper vowAlt1 : Str -> Str = \s -> + case s of + { --------------- o:ó ----------------------------------- + -- 1. nouns ending in a vowel after a consonant + -- or in a consonant: woda:wód , doba:dób + u + "o" + w@("b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + ("a"|"e"|"o"|"y"|"") => u + "ó" + w ; + -- 2. nouns ending in a vowel after two consonants + -- or in two consonants + u + "o" + w@("b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + x@("b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dz"|"dź"|"dż"|"") + + ("a"|"e"|"o"|"y"|"") => u + "ó" + w + x ; + -- 3. nouns ending in a vowel after three consonants, + -- needed for declension of siostra in nSzkola + -- siostra:sióstr + u + "o" + w@("b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + x@("a"|"e"|"o"|"y"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dz"|"dź"|"dż"|"") + + y@("a"|"e"|"o"|"y"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dz"|"dź"|"dż"|"") + + ("a"|"e"|"o"|"y"|"")=> u + "ó" + w + x + y; + ------------------------------------------------------- + --------------- ó:o ----------------------------------- + ------------------------------------------------------- + ---- 1. nouns ending in a vowel after a consonant + -- łódź:łodzi, sól:soli + u + "ó" + w@("b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + ("a"|"e"|"o"|"y"|"") => u + "o" + w ; + ---- 2. nouns ending in a vowel after two consonants + u + "ó" + w@("b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + x@("b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dz"|"dź"|"dż"|"") + + ("a"|"e"|"o"|"y"|"") => u + "o" + w + x ; + ---- 3. nouns ending in a vowel after three consonants + u + "ó" + w@("b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + x@("a"|"e"|"o"|"y"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dz"|"dź"|"dż"|"") + + y@("a"|"e"|"o"|"y"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dz"|"dź"|"dż"|"") + + ("a"|"e"|"o"|"y"|"")=> u + "o" + w + x + y; + _ => s + } ; + + +-- Auxiliary operation for the following vowel alternations: +-- a:e (sąsiad:sąsiedzie, światło:świetle), +-- o:e (anioł:aniele, uczony:uczeni), +-- e:o (nasienie: nasiona, ziele:zioła), +-- ę:o (imię:imiona, znamię:znamiona) + + oper vowAlt2 : Str -> Str = \s -> + case s of + { ------------------- a:e, o:e, ó:e ----------------------- + w + ("a"|"o"|"ó") + x@("b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + y@("b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dz"|"dź"|"dż"|"") + + ("a"|"e"|"o"|"y"|"") => w + "e" + x + y ; + ----------------------- e:o, ę:o ------------------------ + w + ("e"|"ę") + x@("b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dz"|"dź"|"dż"|"") + + y@("a"|"e"|"o"|"y"|"i"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dz"|"dź"|"dż"|"") + + ("a"|"e"|"o"|"y"|"i"|"") => w + "o" + x + y ; + _ => s + } ; + +-- Auxiliary operation for a vowel alternation: +-- ą:ę (gołąb:gołębia, mąż:męża, ksiądz:księdza), +-- ę:ą (ręka:rąk, cielę:cieląt) + + oper vowAlt3 : Str -> Str = \s -> + case s of + { ---------------------- ą:ę ----------------------- + -- noun ending in a consonant + x + "ą" + y@("b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"sł"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dz"|"dź"|"dż"|"zd"|"") => x + "ę" + y ; + --------------------- ą:ę ----------------------- + -- noun ending in a vowel + x + "ą" + y@("b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dz"|"dź"|"dż"|"zd") + + ("a"|"o"|"y"|"i") => x + "ę" + y ; + --------------------- ę:ą ----------------------- + -- noun ending in a consonant + x + "ę" + y@("b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dz"|"dź"|"dż"|"zd"|"") => x + "ą" + y ; + --------------------- ę:ą ----------------------- + -- noun ending in a vowel + x + "ę" + y@("b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dz"|"dź"|"dż"|"zd") + + ("a"|"o"|"y"|"i") => x + "ą" + y ; + _ => s + } ; + + +-- The predefined opers like init, drop, take, don't +-- work correctly with the letters, that are typical only for +-- polish language. Therefore I must define my own function +-- (last1Minus, last7Minus, my5Last, my8Last) +-- that work with polish signs (ą, ć, ę, ł, ń, ś, ó, ź, ż, dź, dż). +-- These opers are needed f.e. for the verb conjugation. + + +-- last1Minus functions work with first (until eight) letters +-- of a word + + oper last1Minus : Str -> Str = \s -> + case s of + { w + ("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") => w; + _ => s + } ; + + + oper last2Minus : Str -> Str = \s -> + case s of + { w + ("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + ("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") => w; + _ => s + } ; + + + oper last3Minus : Str -> Str = \s -> + case s of + { w + ("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + ("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + ("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") => w; + _ => s + } ; + + + oper last4Minus : Str -> Str = \s -> + case s of + { w + ("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + ("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + ("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + ("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") => w; + _ => s + } ; + + + oper last5Minus : Str -> Str = \s -> + case s of + { w + ("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + ("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + ("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + ("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + ("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") => w; + _ => s + } ; + + +---------------------------------------------------------------------------------------- +-- my1Last functions work with last (until eight) letters +-- of words + + oper my1Last : Str -> Str = \s -> + case s of + { t + z@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") => z + } ; + + + oper my2Last: Str -> Str = \s -> + case s of + { t + y@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + z@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") => y + z + } ; + + + oper my3Last : Str -> Str = \s -> + case s of + { t + x@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + y@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + z@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") => x + y + z; + _ => s + } ; + + + oper my4Last : Str -> Str = \s -> + case s of + { t + w@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż"|"") + + x@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + y@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + z@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") => w + x + y + z + } ; + + + + oper my5Last : Str -> Str = \s -> + case s of + { t + u@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + w@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + x@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + y@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + z@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") => u + w + x + y + z + } ; + + + oper my6Last : Str -> Str = \s -> + case s of + { r + t@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + u@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + w@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + x@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + y@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + z@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") => t+ u + w + x + y + z + } ; + + + oper my7Last : Str -> Str = \s -> + case s of + { r + q@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + t@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + u@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + w@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + x@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + y@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + z@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + => q + t + u + w + x + y + z + } ; + + + + oper my8Last : Str -> Str = \s -> + case s of + { r + p@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + q@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + t@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + u@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + w@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + x@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + y@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + + z@("a"|"ą"|"b"|"c"|"ć"|"ch"|"cz"|"d"|"e"|"ę"|"f"| + "g"|"h"|"i"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"|"o"|"ó"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"|"u"| + "w"|"y"|"z"|"ź"|"ż"|"dz"|"dź"|"dż") + => p + q + t + u + w + x + y + z + } ; + + + +-- Auxiliary operation for fleeting e-plus for +-- nouns ending in a vowel like matka +-- subject ending in more than one consonant +-- s. St. Szober, page 184 +-- matka:matek, wojna:wojen, skrzydło:skrzydeł + + oper fleetingEplus : Str -> Str = \s -> + case s of { + x + y@("b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dź"|"dż") + + z@("b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dź"|"dż") + + ("a"|"o"|"y"|"") => x + y + "e" + z + } ; + + +-- Auxiliary operation for fleeting e-minus for +-- nouns ending in a consonant like krew, konew +-- wesz:wszy, krew:krwi, młotek:młotka + + oper fleetingEminus : Str -> Str = \krew -> + case krew of + { w + x@("b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dź"|"dż") + + "e" + y@("b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dź"|"dż") => w + x + y ; + x + "ie" => x + "i" ; + x + "e" => x + } ; + + + +-- Auxiliary operation for fleeting ie-plus for +-- nouns like mgła, owca +-- mgła:mgiel, owca:owiec + + oper fleetingIEplus : Str -> Str = \s -> + case s of { + x + y@("b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dź"|"dż") + + z@("b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dź"|"dż"|"") + + ("a"|"o"|"y"|"") => x + y + "ie" + z + } ; + + + +-- Auxiliary operation for fleeting ie-minus for +-- nouns ending in a consonant like wieś +-- wieś:wsi, pies:psa, pień:pnia + + oper fleetingIEminus : Str -> Str = \wies -> + case wies of + { w + x@("b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dź"|"dż"|"") + + "ie" + y@("b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dź"|"dż"|"") + + z@("b"|"c"|"ć"|"ch"|"cz"|"d"|"f"| + "g"|"h"|"j"|"k"|"l"|"ł"|"m"|"n"|"ń"| + "p"|"r"|"rz"|"s"|"ś"|"sz"|"t"| + "w"|"z"|"ź"|"ż"|"dź"|"dż"|"") => w + x + y + z ; + x + "ie" => x + } ; + + +-- An operation for fleeting letters-minus for +-- nouns ending in a consonant like chrzest, dzień +-- Not only "ie", but other letters like "zie", "est" +-- must sometimes be put away together. +-- chrzest:chrztu, dzień:dnia + + oper fleetingLettersMinus : Str -> Str = \s -> + case s of + { d + "zie" + "ń" => d + "n" ; -- dzień:dń + d + "est" => d + "t" -- chrzest:chrzt + } ; + + +} diff --git a/lib/src/polish/NounPol.gf b/lib/src/polish/NounPol.gf new file mode 100644 index 000000000..5c2f5da57 --- /dev/null +++ b/lib/src/polish/NounPol.gf @@ -0,0 +1,214 @@ +--# -path=.:../abstract:../common:../prelude + +-- Adam Slaski, 2009 + +concrete NounPol of Noun = CatPol ** open ResPol, Prelude, PronounMorphoPol in { + + flags optimize=all_subs ; + + lin +-- CN = { s : Number => Case => Str; g : Gender }; +-- Determiner : Type = { s : Case => Gender => Str; n: Number; a:Case => Case }; +-- NounPhrase : Type = { s : PronForm => Str; n : Number; g: Gender; p : Person }; + + DetCN kazdy facet = { + nom = (kazdy.s ! Nom ! facet.g) ++ (facet.s ! kazdy.n ! (accom_case! )); + voc = (kazdy.s ! VocP ! facet.g) ++ (facet.s ! kazdy.n ! (accom_case! )); + dep = \\cc => let c = extract_case! cc in + (kazdy.s ! c ! facet.g) ++ (facet.s ! kazdy.n ! (accom_case! )); + gn = (accom_gennum !); + p = P3 + } ; + +-- DetNP : Det -> NP ; -- these five +-- unfortunately as def and indefart linearize to [] DetNP leads to placeing +-- [] nominale phrases everywhere +-- if you want to parse with this grammar better comment this function + DetNP kazdy = { + nom = (kazdy.sp ! Nom ! (Masc Personal)); + voc = (kazdy.sp ! VocP ! (Masc Personal)); + dep = \\cc => let c = extract_case! cc in + (kazdy.sp ! c ! (Masc Personal)); + gn = (accom_gennum !); + p = P3 + }; + +-- surface structures of NP formed with MassNP, DefArt and IndefArt are identical + MassNP piwo = { + nom = piwo.s! Sg ! Nom; + voc = piwo.s! Sg ! VocP; + dep = \\cc => piwo.s ! Sg ! (extract_case! cc) ; + gn = cast_gennum! ; + p = P3 ; + } ; + + UsePron p = { + nom = p.nom; + voc = p.voc; + dep = p.dep; + gn = cast_gennum! x; + _ => Masc Personal + }, p.n>; + p = p.p; + }; + + AdjCN mily facet = { + s = \\n,c => (mily.s ! AF (cast_gennum!) c) ++ (facet.s ! n ! c); + g = facet.g + }; + +-- AdvCN : CN -> Adv -> CN ; -- house on the hill + AdvCN cn a = { + s = \\n,c => (cn.s ! n ! c) ++ a.s; + g = cn.g + }; + +-- AdvNP : NP -> Adv -> NP ; -- Paris today + AdvNP np a = { + nom = np.nom ++ a.s; + voc = np.voc ++ a.s; + dep = \\c => np.dep!c++ a.s; + gn = np.gn; + p = np.p + }; + +-- surface structures of NP formed with MassNP, DefArt and IndefArt are identical + DefArt = {s = \\_=>[] ; sp = (demPronTen "ten").sp ; c=Nom; g = PNoGen }; + IndefArt = {s = \\_=>[] ; sp = jaki ; c=Nom; g = PNoGen }; + + UseN sb = { + s = \\n,c => sb.s ! SF n c; + g = sb.g + } ; + + PossPron p = { + s,sp = p.sp + }; + + NumSg = { s = \\_,_ => ""; a = NoA; n = Sg; hasCard = False }; + NumPl = { s = \\_,_ => ""; a = NoA; n = Pl; hasCard = False }; + + DetQuant q num = { + s = \\c,g => q.s ! AF (cast_gennum!) c ++ num.s !c !g; + sp = \\c,g => case num.hasCard of { + True => q.s ! AF (cast_gennum!) c ++ num.s !c !g; + False => q.sp ! AF (cast_gennum!) c ++ num.s !c !g + }; + n = num.n; + a = num.a + }; + + DetQuantOrd q num ord = { + s,sp = \\c,g => q.s ! AF (cast_gennum!) c + ++ num.s !c !g + ++ ord.s ! AF (cast_gennum!) (accom_case! ); + n = num.n; + a = num.a + }; + + OrdSuperl a = { + s = mkAtable a.super + }; + + ComplN2 n2 np = { + s = \\n,c => + n2.s ! SF n c ++ n2.c.s ++ np.dep ! n2.c.c; + g = n2.g + }; + + ComplN3 n3 np = { + s = + \\sf => n3.s ! sf ++ n3.c.s ++ np.dep ! n3.c.c ; + c = n3.c2; + g = n3.g + }; + + UseN2 n2 = { + s = \\n,c => n2.s ! SF n c; + g = n2.g + }; + + Use2N3 n3 = { + s = n3.s; + g = n3.g; + c = n3.c + }; + + Use3N3 n3 = { + s = n3.s; + g = n3.g; + c = n3.c2 + }; + + RelNP np rs = { + nom = np.nom ++ rs.s ! np.gn ; + voc = np.voc ++ rs.s ! np.gn ; + dep = \\cc => np.dep !cc ++ rs.s ! np.gn ; + gn = np.gn; + p = np.p + }; + + RelCN cn rs = { + s = \\n,c => cn.s !n !c ++ rs.s ! (cast_gennum!); + g = cn.g + } ; + +-- PPartNP : NP -> V2 -> NP ; -- the man seen + PPartNP np v2 = { + nom = np.nom ++ v2.ppart ! AF np.gn Nom; + voc = np.voc ++ v2.ppart ! AF np.gn VocP; + dep = \\cc => np.dep !cc ++ v2.ppart ! AF np.gn (extract_case!cc) ; + gn = np.gn; + p = np.p + }; + + +-- NumNumeral : Numeral -> Card ; -- fifty-one + NumNumeral n = { s=n.s; a=n.a; n=n.n }; + +-- NumDigits : Digits -> Card ; -- 51 + NumDigits n = { s=\\_,_ => n.s; a=n.a; n=n.n }; + +-- NumCard : Card -> Num ; + NumCard c = c ** { hasCard = True }; + +-- OrdDigits : Digits -> Ord ; -- 51st + OrdDigits n = { s=\\_=>n.o }; + +-- OrdNumeral : Numeral -> Ord ; -- fifty-first + OrdNumeral n = { s=n.o }; + +-- AdNum : AdN -> Card -> Card ; -- almost 51 + AdNum ad c = { s = \\x,y=>ad.s ++ c.s!x!y; a=c.a; n=c.n }; + +-- PredetNP : Predet -> NP -> NP; -- only the man + PredetNP p np = case p.adj of { + False => { + voc = p.np.voc ++ np.dep!GenNoPrep; + nom = p.np.nom ++ np.dep!GenNoPrep; + dep = \\c=> p.np.dep!c ++ np.dep!GenNoPrep; + n = p.np.n; + gn = p.np.gn; p=p.np.p }; + True => { + voc = p.s!AF np.gn VocP ++ np.dep!GenNoPrep; + nom = p.s!AF np.gn Nom ++ np.dep!GenNoPrep; + dep = \\c=> p.s!AF np.gn (extract_case!c) ++ np.dep!c; + n =np.n; + gn =np.gn; p=np.p } + }; + + UsePN n = n; + +-- ApposCN : CN -> NP -> CN ; -- city Paris (, numbers x and y) + ApposCN cn np = { + s= \\n,c=> cn.s!n!c ++ np.nom; + g= cn.g + }; + +-- SentCN : CN -> SC -> CN ; -- question where she sleeps + SentCN cn sc = { + s= \\n,c=> cn.s!n!c ++ sc.s; + g= cn.g + }; +} diff --git a/lib/src/polish/NumeralPol.gf b/lib/src/polish/NumeralPol.gf new file mode 100644 index 000000000..f91a5f1a7 --- /dev/null +++ b/lib/src/polish/NumeralPol.gf @@ -0,0 +1,549 @@ +--# -path=.:../abstract:../common:../prelude + +-- Adam Slaski, 2009 + +concrete NumeralPol of Numeral = CatPol ** open ResPol,Prelude, AdjectiveMorphoPol in { + + flags coding=utf8 ; + + lincat -- a = accomodation + Digit = { unit,teen,ten,hundred: Case * Gender => Str; + ounit,oteen,oten,ohundred: AForm => Str; + a:Accom }; -- 2..9 + Sub10 = { unit,hundred: Case * Gender => Str; + ounit,ohundred: AForm => Str; + a:Accom; n:Number }; -- 1..9 + Sub100, Sub1000, Sub1000000 = + { s:Case * Gender => Str; + o:AForm => Str; + a:Accom; n:Number }; + + lin +-- num : Sub1000000 -> Numeral ; + num a = { s = \\x,y=>a.s!; o=a.o; a=a.a; n=a.n }; + +-- n2, n3, n4, n5, n6, n7, n8, n9 : Digit ; + n2 = { unit = table { + <(Nom|VocP|Acc),NeutGr > => "dwoje"; + => "dwojga"; + <(Dat|Loc),NeutGr > => "dwojgu"; + => "dwojgiem"; + <(Nom|VocP),Masc Personal > => "dwóch"; + <(Nom|VocP|Acc),Fem > => "dwie"; + (|) => "dwóch"; + <(Nom|VocP|Acc),_ > => "dwa"; + => "dwóm"; + => "dwiema"; + => "dwoma"; + => "dwóch" + }; + teen = table { + <(Nom|VocP|Acc),NeutGr > => "dwanaścioro"; + => "dwanaściorga"; + <(Dat|Loc),NeutGr > => "dwanaściorgu"; + => "dwanaściorgiem"; + (<(Nom|VocP|Acc),Masc Personal>| + ) => "dwunastu"; + <(Nom|VocP|Acc),_ > => "dwanaście" + }; + ten = table { + <(Nom|VocP|Acc),NeutGr > => "dwadzieścioro"; + => "dwadzieściorga"; + <(Dat|Loc),NeutGr > => "dwadzieściorgu"; + => "dwadzieściorgiem"; + (<(Nom|VocP|Acc),Masc Personal>| + ) => "dwudziestu"; + <(Nom|VocP|Acc),_ > => "dwadzieścia" + }; + hundred = table { + (<(Nom|VocP|Acc),Masc Personal>| + ) => "dwustu"; + <(Nom|VocP|Acc),_ > => "dwieście" + }; + ounit = mkAtable( guess_model "drugi" ); + oteen = mkAtable( guess_model "dwunasty" ); + oten = mkAtable( guess_model "dwudziesty" ); + ohundred = mkAtable( guess_model "dwusetny" ); + a=DwaA + }; + n3 = { unit = table { + <(Nom|VocP|Acc),NeutGr > => "troje"; + => "trojga"; + => "trojgu"; + => "trojgiem"; + <(Nom|VocP),Masc Personal > => "trzech"; + <(Nom|VocP|Acc),Fem > => "trzy"; + (|) => "trzech"; + <(Nom|VocP|Acc),_ > => "trzy"; + => "trzem"; + => "trzema"; + => "trzema"; + => "trzech" + }; + teen = table { + <(Nom|VocP|Acc),NeutGr > => "trzynaścioro"; + => "trzynaściorga"; + <(Dat|Loc),NeutGr > => "trzynaściorgu"; + => "trzynaściorgiem"; + (<(Nom|VocP|Acc),Masc Personal>| + ) => "trzynastu"; + <(Nom|VocP|Acc),_ > => "trzynaście" + }; + ten = table { + <(Nom|VocP|Acc),NeutGr > => "trzydzieścioro"; + => "trzydzieściorga"; + <(Dat|Loc),NeutGr > => "trzydzieściorgu"; + => "trzydzieściorgiem"; + (<(Nom|VocP|Acc),Masc Personal>| + ) => "trzydziestu"; + <(Nom|VocP|Acc),_ > => "trzydzieści" + }; + hundred = table { + (<(Nom|VocP|Acc),Masc Personal>| + ) => "trzystu"; + <(Nom|VocP|Acc),_ > => "trzysta" + }; + ounit = mkAtable( guess_model "trzeci" ); + oteen = mkAtable( guess_model "trzynasty" ); + oten = mkAtable( guess_model "trzydziesty" ); + ohundred = mkAtable( guess_model "trzechsetny" ); + a=DwaA + }; + n4 = { unit = table { + <(Nom|VocP|Acc),NeutGr > => "czworo"; + => "czworga"; + => "czworgu"; + => "czworgiem"; + <(Nom|VocP),Masc Personal > => "czterech"; + <(Nom|VocP|Acc),Fem > => "cztery"; + (|) => "czterch"; + <(Nom|VocP|Acc),_ > => "cztery"; + => "czterem"; + => "czterema"; + => "czterma"; + => "czterech" + }; + teen = table { + <(Nom|VocP|Acc),NeutGr > => "czternaścioro"; + => "czternaściorga"; + <(Dat|Loc),NeutGr > => "czternaściorgu"; + => "czternaściorgiem"; + (<(Nom|VocP|Acc),Masc Personal>| + ) => "czternastu"; + <(Nom|VocP|Acc),_ > => "czternaście" + }; + ten = table { + <(Nom|VocP|Acc),NeutGr > => "czterdzieścioro"; + => "czterdzieściorga"; + <(Dat|Loc),NeutGr > => "czterdzieściorgu"; + => "czterdzieściorgiem"; + (<(Nom|VocP|Acc),Masc Personal>| + ) => "czterdziestu"; + <(Nom|VocP|Acc),_ > => "czterdzieści" + }; + hundred = table { + (<(Nom|VocP|Acc),Masc Personal>| + ) => "czterystu"; + <(Nom|VocP|Acc),_ > => "czterysta" + }; + ounit = mkAtable( guess_model "czwarty" ); + oteen = mkAtable( guess_model "czternasty" ); + oten = mkAtable( guess_model "czterdziesty" ); + ohundred = mkAtable( guess_model "czterechsetny" ); + a=DwaA + }; + n5 = { unit = table { + <(Nom|VocP|Acc),NeutGr > => "pięcioro"; + => "pięciorga"; + => "pięciorgu"; + => "pięciorgiem"; + <(Nom|VocP),Masc Personal > => "pięciu"; + (|) => "pięciu"; + <(Nom|VocP|Acc),_ > => "pięć"; + => "pięciu"; + => "pięcioma"; + => "pięciu" + }; + teen = table { + <(Nom|VocP|Acc),NeutGr > => "piętnaścioro"; + => "piętnaściorga"; + <(Dat|Loc),NeutGr > => "piętnaściorgu"; + => "piętnaściorgiem"; + (<(Nom|VocP|Acc),Masc Personal>| + ) => "piętnastu"; + <(Nom|VocP|Acc),_ > => "piętnaście" + }; + ten = table { + <(Nom|VocP|Acc),NeutGr > => "pięćdzieścioro"; + => "pięćdzieściorga"; + <(Dat|Loc),NeutGr > => "pięćdzieściorgu"; + => "pięćdzieściorgiem"; + (<(Nom|VocP|Acc),Masc Personal>| + ) => "pięćdziesięciu"; + <(Nom|VocP|Acc),_ > => "pięćdziesiąt" + }; + hundred = table { + (<(Nom|VocP|Acc),Masc Personal>| + ) => "pięciuset"; + <(Nom|VocP|Acc),_ > => "pięćset" + }; + ounit = mkAtable( guess_model "piąty" ); + oteen = mkAtable( guess_model "piętnasty" ); + oten = mkAtable( guess_model "pięćdziesiąty" ); + ohundred = mkAtable( guess_model "pięćsetny" ); + + a=PiecA + }; +n6 = { unit = table { + <(Nom|VocP|Acc),NeutGr > => "sześcioro"; + => "sześciorga"; + => "sześciorgu"; + => "sześciorgiem"; + <(Nom|VocP),Masc Personal > => "sześciu"; + (|) => "sześciu"; + <(Nom|VocP|Acc),_ > => "sześć"; + => "sześciu"; + => "sześcioma"; + => "sześciu" + }; + teen = table { + <(Nom|VocP|Acc),NeutGr > => "szesnaścioro"; + => "szesnaściorga"; + <(Dat|Loc),NeutGr > => "szesnaściorgu"; + => "szesnaściorgiem"; + (<(Nom|VocP|Acc),Masc Personal>| + ) => "szesnastu"; + <(Nom|VocP|Acc),_ > => "szesnaście" + }; + ten = table { + <(Nom|VocP|Acc),NeutGr > => "sześćdzieścioro"; + => "sześćdzieściorga"; + <(Dat|Loc),NeutGr > => "sześćdzieściorgu"; + => "sześćdzieściorgiem"; + (<(Nom|VocP|Acc),Masc Personal>| + ) => "sześćdziesięciu"; + <(Nom|VocP|Acc),_ > => "sześćdziesiąt" + }; + hundred = table { + (<(Nom|VocP|Acc),Masc Personal>| + ) => "sześciuset"; + <(Nom|VocP|Acc),_ > => "sześćset" + }; + ounit = mkAtable( guess_model "szósty" ); + oteen = mkAtable( guess_model "szesnasty" ); + oten = mkAtable( guess_model "sześćdziesiąty" ); + ohundred = mkAtable( guess_model "sześćsetny" ); + + a=PiecA + }; +n7 = { unit = table { + <(Nom|VocP|Acc),NeutGr > => "siedmioro"; + => "siedmiorga"; + => "siedmiorgu"; + => "siedmiorgiem"; + <(Nom|VocP),Masc Personal > => "siedmiu"; + (|) => "siedmiu"; + <(Nom|VocP|Acc),_ > => "siedem"; + => "siedmiu"; + => "siedmioma"; + => "siedmiu" + }; + teen = table { + <(Nom|VocP|Acc),NeutGr > => "siedemnaścioro"; + => "siedemnaściorga"; + <(Dat|Loc),NeutGr > => "siedemnaściorgu"; + => "siedemnaściorgiem"; + (<(Nom|VocP|Acc),Masc Personal>| + ) => "siedemnastu"; + <(Nom|VocP|Acc),_ > => "siedemnaście" + }; + ten = table { + <(Nom|VocP|Acc),NeutGr > => "siedemdzieścioro"; + => "siedemdzieściorga"; + <(Dat|Loc),NeutGr > => "siedemdzieściorgu"; + => "siedemdzieściorgiem"; + (<(Nom|VocP|Acc),Masc Personal>| + ) => "siedemdziesięciu"; + <(Nom|VocP|Acc),_ > => "siedemdziesiąt" + }; + hundred = table { + (<(Nom|VocP|Acc),Masc Personal>| + ) => "siedemiuset"; + <(Nom|VocP|Acc),_ > => "siedemset" + }; + ounit = mkAtable( guess_model "siódmy" ); + oteen = mkAtable( guess_model "siedemnasty" ); + oten = mkAtable( guess_model "siedemdziesiąty" ); + ohundred = mkAtable( guess_model "siedemsetny" ); + + a=PiecA + }; +n8 = { unit = table { + <(Nom|VocP|Acc),NeutGr > => "ośmioro"; + => "ośmiorga"; + => "ośmiorgu"; + => "ośmiorgiem"; + <(Nom|VocP),Masc Personal > => "ośmiu"; + (|) => "ośmiu"; + <(Nom|VocP|Acc),_ > => "osiemm"; + => "ośmiu"; + => "ośmioma"; + => "ośmiu" + }; + teen = table { + <(Nom|VocP|Acc),NeutGr > => "osiemnaścioro"; + => "osiemnaściorga"; + <(Dat|Loc),NeutGr > => "osiemnaściorgu"; + => "osiemnaściorgiem"; + (<(Nom|VocP|Acc),Masc Personal>| + ) => "osiemnastu"; + <(Nom|VocP|Acc),_ > => "osiemnaście" + }; + ten = table { + <(Nom|VocP|Acc),NeutGr > => "osiemdzieścioro"; + => "osiemdzieściorga"; + <(Dat|Loc),NeutGr > => "osiemdzieściorgu"; + => "osiemdzieściorgiem"; + (<(Nom|VocP|Acc),Masc Personal>| + ) => "osiemdziesięciu"; + <(Nom|VocP|Acc),_ > => "osiemdziesiąt" + }; + hundred = table { + (<(Nom|VocP|Acc),Masc Personal>| + ) => "ośmiuset"; + <(Nom|VocP|Acc),_ > => "osiemset" + }; + ounit = mkAtable( guess_model "ósmy" ); + oteen = mkAtable( guess_model "osiemnasty" ); + oten = mkAtable( guess_model "osiemdziesiąty" ); + ohundred = mkAtable( guess_model "osiemsetny" ); + a=PiecA + }; +n9 = { unit = table { + <(Nom|VocP|Acc),NeutGr > => "dziewięcioro"; + => "dziewięciorga"; + => "dziewięciorgu"; + => "dziewięciorgiem"; + <(Nom|VocP),Masc Personal > => "dziewięciu"; + (|) => "dziewięciu"; + <(Nom|VocP|Acc),_ > => "dziewięć"; + => "dziewięciu"; + => "dziewięcioma"; + => "dziewięciu" + }; + teen = table { + <(Nom|VocP|Acc),NeutGr > => "dziewiętnaścioro"; + => "dziewiętnaściorga"; + <(Dat|Loc),NeutGr > => "dziewiętnaściorgu"; + => "dziewiętnaściorgiem"; + (<(Nom|VocP|Acc),Masc Personal>| + ) => "dziewiętnastu"; + <(Nom|VocP|Acc),_ > => "dziewiętnaście" + }; + ten = table { + <(Nom|VocP|Acc),NeutGr > => "dziewięćdzieścioro"; + => "dziewięćdzieściorga"; + <(Dat|Loc),NeutGr > => "dziewięćdzieściorgu"; + => "dziewięćdzieściorgiem"; + (<(Nom|VocP|Acc),Masc Personal>| + ) => "dziewięćdziesięciu"; + <(Nom|VocP|Acc),_ > => "dziewięćdziesiąt" + }; + hundred = table { + (<(Nom|VocP|Acc),Masc Personal>| + ) => "dziewięciuset"; + <(Nom|VocP|Acc),_ > => "dziewięćset" + }; + ounit = mkAtable( guess_model "dziewiąty" ); + oteen = mkAtable( guess_model "dziewiętnasty" ); + oten = mkAtable( guess_model "dziewięćdziesiąty" ); + ohundred = mkAtable( guess_model "dziewięćsetny" ); + a=PiecA + }; +-- pot01 : Sub10 ; -- 1 + pot01 = { + unit = table { + (<(Nom|VocP),Masc _>|) => "jeden"; + <(Nom|Acc|VocP),Neut|NeutGr> => "jedno"; + <(Nom|VocP),Fem> => "jedna"; + <(Gen|Dat|Loc),Fem> => "jednej"; + <(Acc|Instr),Fem> => "jedną"; + (|) => "jednego"; + => "jednemu"; + <(Instr|Loc),_> => "jednym" + }; + hundred = table { + (<(Nom|VocP|Acc),Masc Personal>| + <(Gen|Dat|Instr|Loc),_>) => "stu"; + <(Nom|VocP|Acc),_ > => "sto" + }; + ounit = mkAtable( guess_model "pierwszy" ); + ohundred = mkAtable( guess_model "setny" ); + a=NoA; + n=Sg + }; + +-- pot0 : Digit -> Sub10 ; -- d * 1 + pot0 d = { + unit = d.unit; hundred = d.hundred; + ounit = d.ounit; ohundred = d.ohundred; + a = d.a; + n = Pl + }; + +-- pot110 : Sub100 ; -- 10 + pot110 = { + s =table { + <(Nom|VocP|Acc),NeutGr > => "dziesięcioro"; + => "dziesięciorga"; + <(Dat|Loc),NeutGr > => "dziesięciorgu"; + => "dziesięciorgiem"; + (<(Nom|VocP|Acc),Masc Personal>| + ) => "dziesięciu"; + <(Nom|VocP|Acc),_ > => "dziesięć" + }; + o = mkAtable( guess_model "osiemdziesiąty" ); + a=PiecA; + n=Pl + }; + +-- pot111 : Sub100 ; -- 11 + pot111 = { + s = table { + <(Nom|VocP|Acc),NeutGr > => "jedenaścioro"; + => "jedenaściorga"; + <(Dat|Loc),NeutGr > => "jedenaściorgu"; + => "jedenaściorgiem"; + (<(Nom|VocP|Acc),Masc Personal>| + ) => "jedenastu"; + <(Nom|VocP|Acc),_ > => "jedenaście" + }; + o = mkAtable( guess_model "osiemnasty" ); + a=PiecA; + n=Pl + }; + +-- pot1to19 : Digit -> Sub100 ; -- 10 + d + pot1to19 d = { + s = d.teen; + o = d.oteen; + a = PiecA; + n = Pl + }; + +-- pot0as1 : Sub10 -> Sub100 ; -- coercion of 1..9 + pot0as1 s = { + s = s.unit; + o = s.ounit; + a = s.a; + n = s.n + }; + +-- pot1 : Digit -> Sub100 ; -- d * 10 + pot1 d = { + s = d.ten; + o = d.oten; + a = PiecA; + n = Pl + }; + +-- pot1plus : Digit -> Sub10 -> Sub100 ; -- d * 10 + n + pot1plus d s = { + s = \\x => d.ten!x ++ s.unit!x; + o = \\x => d.oten!x ++ s.ounit!x; + a = s.a; + n = Pl + }; + +-- pot1as2 : Sub100 -> Sub1000 ; -- coercion of 1..99 + pot1as2 s = { + s = s.s; + o = s.o; + a = s.a; + n = s.n + }; + +-- pot2 : Sub10 -> Sub1000 ; -- m * 100 + pot2 s = { + s = s.hundred; + o = s.ohundred; + a = StoA; + n = Pl + }; + +-- pot2plus : Sub10 -> Sub100 -> Sub1000 ; -- m * 100 + n + pot2plus s10 s100 = { + s = \\x => s10.hundred!x ++ case s100.n of { Sg => "jeden"; _=>s100.s!x } ; + o = \\x => s10.hundred! ++ s100.o!x; -- sto drugi, nie setny drugi + a = case s100.n of { Sg => StoA; _=> s100.a }; + n = Pl + }; + + +-- pot2as3 : Sub1000 -> Sub1000000 ; -- coercion of 1..999 + pot2as3 s = { + s = s.s; + o = s.o; + a = s.a; + n = Pl + }; + +-- pot3 : Sub1000 -> Sub1000000 ; -- m * 1000 + pot3 s = { + s = \\x => case s.n of { Sg => ""; Pl => s.s! } + ++ tysiac!<(accom_case! ),s.n>; + o = \\x => s.o!x ++ (mkAtable (guess_model "tysięczny"))!x; --FIXME dwu tysieczny, nie dwa tysieczny + a = TysiacA; + n = Pl + }; + + +-- pot3plus : Sub1000 -> Sub1000 -> Sub1000000 ; -- m * 1000 + n + pot3plus s s2 = { + s = \\x => case s.n of { Sg => ""; Pl => s.s! } + ++ tysiac!<(accom_case! ),s.n> + ++ case s2.n of { Sg => "jeden"; _=>s2.s!x } ; --zabiłem dwa tysiące jeden policjantów + o = \\x => case s.n of { Sg => ""; Pl => s.s! } -- tysiąc dwieście dziewięćdziesiąty pierwszy + ++ tysiac!<(accom_case! ),s.n> + ++ s2.o!x; + a = case s2.n of { Sg => TysiacA; _=> s2.a } ; + n = Pl + }; + +oper tysiac = table { + <(Nom|Acc), Sg> => "tysiąc"; + => "tysiąca"; + => "tysiącowi"; + => "tysiącem"; + <(Loc|VocP),Sg> => "tysiącu"; + <(Nom|Acc|VocP), Pl> => "tysiące"; + => "tysięcy"; + => "tysiącom"; + => "tysiącami"; + => "tysiącach" + }; + + +-- -- Numerals as sequences of digits have a separate, simpler grammar + lincat + Dig = {s:Str; o:Str; n:Number; a:Accom}; -- single digit 0..9 + + lin +-- IDig : Dig -> Digits ; -- 8 + IDig d = d; + +-- IIDig : Dig -> Digits -> Digits ; -- 876 + IIDig d dd = { s = d.s ++ dd.s; o = d.s ++ dd.o; n=Pl; a=dd.a }; + + D_0 = { s = "0"; o="0."; n=Pl; a=TysiacA }; + D_1 = { s = "1"; o="1."; n=Sg; a=NoA }; + D_2 = { s = "2"; o="2."; n=Pl; a=DwaA }; + D_3 = { s = "3"; o="3."; n=Pl; a=DwaA }; + D_4 = { s = "4"; o="4."; n=Pl; a=DwaA }; + D_5 = { s = "5"; o="5."; n=Pl; a=PiecA }; + D_6 = { s = "6"; o="6."; n=Pl; a=PiecA }; + D_7 = { s = "7"; o="7."; n=Pl; a=PiecA }; + D_8 = { s = "8"; o="8."; n=Pl; a=PiecA }; + D_9 = { s = "9"; o="9."; n=Pl; a=PiecA }; + +} diff --git a/lib/src/polish/OverloadPol.gf b/lib/src/polish/OverloadPol.gf new file mode 100644 index 000000000..c356f1cf9 --- /dev/null +++ b/lib/src/polish/OverloadPol.gf @@ -0,0 +1 @@ +resource OverloadPol = Overload with (Grammar = GrammarPol) ; diff --git a/lib/src/polish/ParadigmsPol.gf b/lib/src/polish/ParadigmsPol.gf new file mode 100644 index 000000000..65a1bf41c --- /dev/null +++ b/lib/src/polish/ParadigmsPol.gf @@ -0,0 +1,624 @@ +--# -path=.:../abstract:../prelude:../common + +--0 Polish Lexical Paradigms + +-- Ilona Nowak Wintersemester 2007/08 + +-- This is an API for the user of the resource grammar +-- for adding lexical items. It gives functions for forming +-- expressions of open categories: nouns, adjectives, verbs. + +-- Closed categories ( pronouns, conjunctions) are +-- accessed through the resource syntax API, $Structural.gf$. +-- For german and english grammar determiners are defined as +-- closed categories in the file StructuralPol.gf. +-- In Polish language they aren't determiners. + +-- The main difference between $MorphoPol.gf$ and $ParadigmsPol.gf$ is that the types +-- referred to are compiled resource grammar types. I have moreover +-- had the design principle of always having existing forms, rather +-- than stems, as string arguments of the paradigms. + +-- The structure of functions for each word class $C$ is the following: +-- first I give a handful of patterns that aim to cover all +-- regular cases. Then I give a worst-case function $mkC$, which serves as an +-- escape to construct the most irregular words of type $C$. + +-- The following modules are presupposed: + + + resource ParadigmsPol = open + (Predef=Predef), + Prelude, + MorphoPol, + CatPol + in + { + flags coding=utf8; + + + oper Gender = MorphoPol.Gender; + Case = MorphoPol.Case; + Number = MorphoPol.Number; + Animacy = MorphoPol.Animacy; + Aspect = MorphoPol.Aspect; +-- Voice = MorphoPol.Voice; +-- Tense = Tense; + Bool = Prelude.Bool; + + +-- Used abbreviations + + masculineA = Masc Animate; + masculineI = Masc Inanimate; + masculineP = Masc Personal; + feminine = Fem; + neuter = Neut; + nominative = Nom; + genitive = Gen; + dative = Dat; + accusative = Acc; + instrumental = Instr; -- new, is like instrumental in russian + locative = Loc; -- new, is like prepositional in russian + vocative = VocP; + singular = Sg; + plural = Pl; + animate = Animate; + inanimate = Inanimate; + personal = Personal; + + true = True; + false = False; + +--1 Nouns + +-- Parameters -------- + + Gender : Type; + + masculineP : Gender; -- personal + masculineA : Gender; -- animate + masculineI : Gender; -- inanimate + feminine : Gender; + neuter : Gender; + +-- In Polish there are as in German 3 Genders: masculine, feminine and neuter. +-- But !!! in masculine declension we distinguish between: +-- a) masculineP - human, but !!! they are only masculine person: +-- f.e."mężczyzna" (man),"myśliwy" (hunter), "student" (student), +-- "brat" (brother), "ksiądz" (pastor)), +-- b) animate (they are animals), +-- c) inanimate (all other nouns, "kobieta" (women), "dziewczyna" (girl) too.) +-- For declension of feminine and neuter nouns, it is not important, +-- if the noun is human, nonhuman, animate or inanimate. +-- Only for masculine declension. + + +-- Animacy is only for masculine Nouns. + Animacy: Type; + + animate: Animacy; + inanimate: Animacy; + personal : Animacy; + + + Case : Type; + + nominative : Case; + genitive : Case; + dative : Case; + accusative : Case; + instrumental : Case; + locative : Case; + vocative : Case; + +-- To abstract over case names, I defined seven cases. +-- The seventh case vocative is like in english the phrase +-- vocative f.e. "my darling". Vocative is defined in GF, +-- so I'll define it here for Polish again, +-- but later in the programs I will use the abbreviation VocP for it,. +-- otherwise the program will create a problem. +-- I had to do it, because it can't differ from +-- polish case vocative and the vocative form, that is defined in GF. + + +-- To abstract over number names, I define the following. + Number : Type; + + singular : Number; + plural : Number; + + +--1 Paradigms + +-- Best case is for indeclinable nouns. They are: "alibi", "boa", "emu", "jury", "kakao", "menu", "zebu". + + mkIndeclinableNoun: Str -> Gender -> N; --function declaration + + mkIndeclinableNoun = \str, g -> -- function definition + { + s = table { SF _ _ => str }; + g = g + } ** {lock_N = <>}; + + +-- Worst case gives many forms. + +-- Here are some common patterns. The list is far from complete. +-- Here will be handled only nouns, that are in GF-lexicon. +-- The very exact classification for polish nouns have 125 paradigms. +-- This information is from the internet site of Grzegorz Jagodziński +-- for polish grammar under http://free.of.pl/g/grzegorj/gram/pl/deklin04.htm + +------------------------------------------------- +----- Abbreviation for names of declensions ----- +------------------------------------------------- +-- VA1 - vowel alternation 1: o:ó, ó:o +-- VA2 - vowel alternation 2: a:e, e:o, ę:o, o:e +-- VA3 - vowel alternation 3: ę:ą, ą:ę +-- CA - consonant alternation +-- CL - consonant lengthening +-- CAL - consonant alternation and lengthening +-- F - feminine +-- N - neuter +-- MP - masculine personal +-- MA - masculine animate +-- MI - masculine inanimate + + +---------- Patterns for feminine nouns ---------- + + nKapiel : Str -> N; -- feminine, subject ending in "-l" + nKapiel = \s -> l_End_F_1 s ** {lock_N = <>}; + + nLodz : Str -> N; -- feminine, subject ending in "-dź" + nLodz = \x -> dzx_End_VA1_CAL_F x ** {lock_N = <>}; + + nSul : Str -> N; -- feminine, subject ending in "-l" + nSul = \x -> l_End_VA1_F x ** {lock_N = <>}; + + nKonew : Str -> N; -- feminine, subject ending in "-w" + nKonew = \s -> w_End_FleetingEminus_F s ** {lock_N = <>}; + + nWies : Str -> N; -- feminine, subject ending in "-ś" + nWies = \x -> sx_End_CAL_FleetingIEminus_F x ** {lock_N = <>}; + + nDlon : Str -> N; -- feminine, subject ending in "-ń" + nDlon = \x -> nx_End_CAL_F x ** {lock_N = <>}; + + nSiec : Str -> N; -- feminine, subject ending in "-ć" (sieć),"-ść" (miłość) + nSiec = \x -> cx_End_CAL_F_1 x ** {lock_N = <>}; + + nDrzwi : Str -> N; -- drzwi, wnętrzności, usta + nDrzwi = \x -> onlyPlNoun x ** {lock_N = <>}; + + nKosc : Str -> N; -- feminine, subject ending in "-ść"(kość), "-ć" (nić), + nKosc = \x -> cx_End_CAL_F_2 x ** {lock_N = <>}; + + nNoc : Str -> N; -- feminine, subject ending in "-c", "-cz", "-rz", "-ż" + nNoc = \s -> hardened_End_F_1 s ** {lock_N = <>}; + + nWesz : Str -> N; -- feminine, subject ending in "-sz" + nWesz = \s -> sz_End_FleetingEminus_F s ** {lock_N = <>}; + + nKrolowa : Str -> N; -- feminine, subject ending in "-wa", but also for "księżna" + nKrolowa = \s -> wa_na_End_F s ** {lock_N = <>}; + + nReka : Str -> N; -- feminine "ręka", irregularly noun + nReka = \x -> k_End_Unregulary_VA3_CA_F x ** {lock_N = <>}; + + nApteka : Str -> N; -- feminine, subject ending in "-k", -"g", consonant alternation k:c, g:dz + nApteka = \s -> g_k_End_CA_F s ** {lock_N = <>}; + + nDroga : Str -> N; -- feminine, subject ending in "g", consonant alternation d:dz, vowel alternation o:ó + nDroga = \s -> g_End_VA1_CA_F s ** {lock_N = <>}; + + nMatka : Str -> N; -- feminine, subject ending in -k,consonant alternation k:c, fleeting e + nMatka = \s -> k_End_CA_FleetingEplus_F s ** {lock_N = <>}; + + nZiemia : Str -> N; -- feminine, subject ending in "-ia" + nZiemia = \s -> ia_End_F_1 s ** {lock_N = <>}; + + nFala : Str -> N; -- feminine, subject ending in "-l" + nFala = \s -> l_End_F_2 s ** {lock_N = <>}; + + nLilia : Str -> N; -- feminine, subject ending in "-ia" + nLilia = \s -> ia_End_F_2 s ** {lock_N = <>}; + + nKobieta : Str -> N; -- feminine, subject ending in "-t" + nKobieta = \s -> hard_End_CAL_F s ** {lock_N = <>}; + + nLiczba : Str -> N; -- feminine, subject ending in "-b", "-p", "-n" + nLiczba = \s -> hard_End_CL_F s ** {lock_N = <>}; + + nSila : Str -> N; -- feminine, subject ending in "-ł", "-r" + nSila = \s -> hard_End_CA_F s ** {lock_N = <>}; + + nDoba : Str -> N; -- feminine, subject ending in "-b", "-p" + nDoba = \s -> hard_End_VA1_CL_F s ** {lock_N = <>}; + + nWoda : Str -> N; -- feminine, subject ending in "-d" + nWoda = \s -> hard_End_VA1_CAL_F s ** {lock_N = <>}; + + nSzkola : Str -> N; -- feminine, subject ending in "-oła", "-ra" + nSzkola = \s -> hard_End_VA1_CA_F s ** {lock_N = <>}; + + nWojna : Str -> N; -- feminine, subject ending in two consonants: jn, łz, łn, ćm,żw + nWojna = \s -> hard_End_CL_FleetingEplus_F s ** {lock_N = <>}; + + nWiosna : Str -> N; -- feminine, subject ending in two consonants: sn + nWiosna = \s -> sn_End_CAL_FleetingIEplus_F s ** {lock_N = <>}; + + nMgla : Str -> N; -- feminine, subject ending in "-gł" + nMgla = \x -> hard_l_End_CA_FleetingIEplus_F x ** {lock_N = <>}; + + nGwiazda : Str -> N; -- feminine, subject ending in "-zd" + nGwiazda = \s -> zd_st_End_VA2_CAL_F s ** {lock_N = <>}; + + nUlica : Str -> N; -- feminine, subject ending mainly in "-c", but also in "-ż", "-rz", "-dz" + nUlica = \s -> hardened_End_F_2 s ** {lock_N = <>}; + + nOwca : Str -> N; -- feminine, subject ending in "-c" + nOwca = \x -> c_End_FleetingIEplus_F x ** {lock_N = <>}; + + +-------- Patterns for neuter nouns ---------- + + + nDanie : Str -> N; -- neuter, subject ending in "-ni" + nDanie = \s -> ci_ni_week_End_CA_N s ** {lock_N = <>}; + + nSerce : Str -> N; -- neuter, subject ending in a hardened consonant "-c", "-rz" + nSerce = \s -> hardened_End_N s ** {lock_N = <>}; + + nNasienie : Str -> N; -- neuter, subject ending in "-ni" (only for "nasienie") + nNasienie = \x -> ni_End_VA2_N x ** {lock_N = <>}; + + nMorze : Str -> N; -- neuter, subject ending in "-rz", "-ż" + nMorze = \x -> rz_zx_End_VA1_N x ** {lock_N = <>}; + + nImie : Str -> N; -- neuter, subject ending in "-ę" + nImie = \x -> ex_End_VA2_N x ** {lock_N = <>}; + + nCiele : Str -> N; -- neuter, subject ending in "-ę" + nCiele = \s -> ex_End_VA3_N s ** {lock_N = <>}; + + nUdo : Str -> N; -- neuter, subject ending in hard consonant + "o" + nUdo = \s -> hard_End_CAL_N s ** {lock_N = <>}; + + nPiwo : Str -> N; -- neuter, subject ending in a hard consonant + "o" + nPiwo = \s -> hard_End_CL_N s ** {lock_N = <>}; + + nZero : Str -> N; -- neuter, subject ending in "-r" + nZero = \s -> r_End_CA_N s ** {lock_N = <>}; + + nNiebo : Str -> N; -- neuter, declension for "niebo" + nNiebo = \x -> niebo_Unregulary_N x ** {lock_N = <>}; + + nTlo : Str -> N; -- neuter, subject ending in "-ło" + nTlo = \s -> lx_End_CA_FleetingEplus_N s ** {lock_N = <>}; + + nZebro : Str -> N; -- neuter, subject ending in "-r" + nZebro = \s -> hard_End_CA_FleetingEplus_N s ** {lock_N = <>}; + + nOkno : Str -> N; -- neuter, subject ending in "-n" + nOkno = \s -> n_End_CL_FleetingIEplus_N s ** {lock_N = <>}; + + nGniazdo : Str -> N; -- neuter, subject ending in "-zd", "-st" + nGniazdo = \s -> hard_End_VA_CAL_N s ** {lock_N = <>}; + + nWojsko : Str -> N; -- neuter, subject ending in "-k" + nWojsko = \s -> k_End_CL_N s ** {lock_N = <>}; + + nJajo : Str -> N; -- neuter, subject ending in "-j" + nJajo = \s -> j_End_N s ** {lock_N = <>}; + + nJablko : Str -> N; -- neuter, subject ending in "-k" + nJablko = \s -> k_End_CL_FleetingEplus_N s ** {lock_N = <>}; + + nStudio : Str -> N; -- neuter, subject ending in "-n" + nStudio = \s -> o_End_N s ** {lock_N = <>}; + + nDziecko : Str -> N; -- neuter, subject ending in "-n" + nDziecko = \s -> k_End_CAL_N s ** {lock_N = <>}; + + nUcho : Str -> N; -- neuter, subject ending in "-ch" + nUcho = \x -> ch_End_Unregulary_CA_N x ** {lock_N = <>}; + + nOko : Str -> N; -- neuter, subject ending in "-k" + nOko = \x -> k_End_Unregulary_CAL_N x ** {lock_N = <>}; + + +---- Patterns for personal masculine nouns ------ + + nFacet : Str -> N; -- masculine personal, subject ending in a hard consonant "-t", -"n", nom pl "-i" + nFacet = \s -> hard_End_CAL_MP_1 s ** {lock_N = <>}; + + nArab : Str -> N; -- masculine personal, subject ending in a hard consonant "-t", -"n", nom pl "-y" + nArab = \s -> hard_End_CAL_MP_2 s ** {lock_N = <>}; + + nPrzyjaciel : Str -> N; -- masculine personal, subject ending in a hard consonant "-l" + nPrzyjaciel = \s -> przyjaciel_VA1_VA2_CA_MP s ** {lock_N = <>}; + + nKowal : Str -> N; -- masculine personal, subject ending in a hard consonant "-l" + nKowal = \s -> l_End_MP s ** {lock_N = <>}; + + nLekarz : Str -> N; -- masculine personal ending in -rz, -ż, -cz, -sz (piekarz, lekarz, papież, tłumacz, piwosz) + nLekarz = \s -> hardened_End_MP s ** {lock_N = <>}; + + nKrol : Str -> N; -- masculine personal, subject ending in "-ul" + nKrol = \s -> ul_End_MP s ** {lock_N = <>}; + + nMaz : Str -> N; -- masculine personal + nMaz = \s -> maz_MP s ** {lock_N = <>}; + + nWrog : Str -> N; -- masculine personal, subject ending in "-g"; only for "wróg" + nWrog = \s -> wrog_VA1_CL_MP s ** {lock_N = <>}; + +-- nCzlowiek : Str -> N; -- masculine personal +-- nCzlowiek = \s -> ul_End_MP s ** {lock_N = <>}; + + nKsiadz : Str -> N; -- masculine personal + nKsiadz = \s -> ksiadz_VA3_CA_MP s ** {lock_N = <>}; + + nOjciec : Str -> N; -- masculine personal for "ojciec" + nOjciec = \s -> ciec_End_CA_FleetingIEminus_MP s ** {lock_N = <>}; + + nBrat : Str -> N; -- masculine personal + nBrat = \s -> hard_End_CAL_MP s ** {lock_N = <>}; + + nBog : Str -> N; -- masculine personal + nBog = \s -> bog_VA1_CAL_MP s ** {lock_N = <>}; + + nChlopiec : Str -> N; -- masculine personal + nChlopiec = \s -> iec_End_CA_FleetingIEminus_MP s ** {lock_N = <>}; + + nMezczyzna : Str -> N; -- masculine personal + nMezczyzna = \s -> zna_End_CAL_MP s ** {lock_N = <>}; + + +------------------- Patterns for animate masculine nouns ------- + + + nKon : Str -> N; -- masculine animate, for "koń" + nKon = \s -> kon_CAL_MA s ** {lock_N = <>}; + + nWaz : Str -> N; -- masculine animate, for "wąż" + nWaz = \s -> waz_VA3_MA s ** {lock_N = <>}; + + nPtak : Str -> N; -- masculine animate, subject ending in "-k" + nPtak = \s -> k_End_CL_MA s ** {lock_N = <>}; + + nKot : Str -> N; -- masculine animate, for "kot" + nKot = \s -> kot_CAL_MA s ** {lock_N = <>}; + + nPies : Str -> N; -- masculine animate, for "pies" + nPies = \s -> pies_CL_FleetingIEminus_MA s ** {lock_N = <>}; + + + +------------------ Patterns for inanimate masculine nouns ----- + + nBat : Str -> N; -- masculine inanimate, subject ending in a vowel + hard consonant + nBat = \s -> vowel_hard_CAL_MI s ** {lock_N = <>}; + + nChleb : Str -> N; -- masculine inanimate, subject ending in a vowel + hard consonant + nChleb = \s -> vowel_hard_CL_MI s ** {lock_N = <>}; + + nSer : Str -> N; -- masculine inanimate, subject ending in "-r" + nSer = \s -> r_End_CA_MI s ** {lock_N = <>}; + + nZab : Str -> N; -- masculine inanimate, subject ending in "-ąb" + nZab = \s -> ab_End_VA3_CL_MI s ** {lock_N = <>}; + + nKosciol : Str -> N; -- masculine inanimate, for "kosciół" + nKosciol = \s -> kosciol_VA1_VA2_CA_MI s ** {lock_N = <>}; + + nCien : Str -> N; -- masculine inanimate, subject ending in a week consonant + nCien = \s -> week_End_CAL_MI s ** {lock_N = <>}; + + nPien : Str -> N; -- masculine inanimate, subject ending in a week consonant + nPien = \s -> week_End_CAL_FleetingIEminus_MI s ** {lock_N = <>}; + + nLisc : Str -> N; -- masculine inanimate, subject ending in a vowel + hard consonant + nLisc = \s -> lisc_CAL_MI s ** {lock_N = <>}; + + nKoc : Str -> N; -- masculine inanimate, subject ending in a hardened consonant + nKoc = \s -> hardened_End_MI_1 s ** {lock_N = <>}; + + nWiersz : Str -> N; -- masculine inanimate, subject ending in a hardened consonant + nWiersz = \s -> hardened_End_MI_2 s ** {lock_N = <>}; + + nDzien : Str -> N; -- masculine inanimate, for "dzień" + nDzien = \s -> dzien_MI s ** {lock_N = <>}; + + nKajak : Str -> N; -- masculine inanimate, subject ending in -g or -k + nKajak = \s -> g_k_End_CL_MI_1 s ** {lock_N = <>}; + + nMlotek : Str -> N; -- masculine inanimate, subject ending in -ek + nMlotek = \s -> k_End_CL_FleetingEminus_MI s ** {lock_N = <>}; + + nMiech : Str -> N; -- masculine inanimate, subject ending in -ch + nMiech = \s -> ch_End_MI s ** {lock_N = <>}; + + nSad : Str -> N; -- masculine inanimate, subject ending in a hard consonant + nSad = \s -> hard_End_CAL_MI s ** {lock_N = <>}; + + nDym : Str -> N; -- masculine inanimate, subject ending in a hard consonant + nDym = \s -> hard_End_CL_MI s ** {lock_N = <>}; + + nWal : Str -> N; -- masculine inanimate, subject ending in a vowel + hard consonant + nWal = \s -> hard_End_CA_MI s ** {lock_N = <>}; + + nDol : Str -> N; -- masculine inanimate, subject ending in a vowel + hard consonant + nDol = \s -> hard_End_VA1_CA_MI s ** {lock_N = <>}; + + nOgrod : Str -> N; -- masculine inanimate, subject ending in a vowel + hard consonant + nOgrod = \s -> hard_End_VA1_CAL_MI s ** {lock_N = <>}; + + nKwiat : Str -> N; -- masculine inanimate, subject ending in a vowel + hard consonant + nKwiat = \s -> hard_End_VA2_CAL_MI s ** {lock_N = <>}; + + nLas : Str -> N; -- masculine inanimate, subject ending in a vowel + hard consonant + nLas = \s -> hard_End_VA2_CL_MI s ** {lock_N = <>}; + + nWiatr : Str -> N; -- masculine inanimate, subject ending in a vowel + hard consonant + nWiatr = \s -> wiatr_VA2_CA_MI s ** {lock_N = <>}; + + nPopiol : Str -> N; -- masculine inanimate, subject ending in a vowel + hard consonant + nPopiol = \s -> popiol_VA2_CA_MI s ** {lock_N = <>}; + + nPokoj : Str -> N; -- masculine inanimate, subject ending in -ój + nPokoj = \s -> onlySgNoun s ** {lock_N = <>}; + + nGaj : Str -> N; -- masculine inanimate, subject ending in a vowel + hard consonant j + nGaj = \s -> vowel_j_or_handened_End_MI s ** {lock_N = <>}; + + nBrzeg : Str -> N; -- masculine inanimate, subject ending in -g or -k + nBrzeg = \s -> g_k_End_CL_MI_2 s ** {lock_N = <>}; + + nRok : Str -> Str -> N; -- masculine inanimate for "rok", form in pl irregular + nRok = \s, t -> rok_UnregularyPl_CL_MI s t ** {lock_N = <>}; + + nProg : Str -> N; -- masculine inanimate, subject ending in -óg + nProg = \s -> ug_End_VA1_CL_MI s ** {lock_N = <>}; + + nStatek : Str -> N; -- masculine inanimate, subject ending in -ek + nStatek = \s -> k_End_CL_FleetingEmins_MI s ** {lock_N = <>}; + + nDom : Str -> N; -- masculine inanimate, subject ending in -ch and for dom + nDom = \s -> ch_End_dom_MI s ** {lock_N = <>}; + + +-- Nominative, Genetive, Dative, Accusative, Instrumental, Locative and Vocative; +-- corresponding seven plural forms and the gender. + + mkN : (nomSg, genSg, datSg, accSg, instrSg, locSg, vocSg, + nomPl, genPl, datPl, accPl, instrPl, locPl, vocPl: Str) -> Gender -> N; + + + mkN = \nomSg, genSg, datSg, accSg, instrSg, locSg, vocSg, + nomPl, genPl, datPl, accPl, instrPl, locPl, vocPl, g -> + { + s = table { + SF Sg Nom => nomSg; + SF Sg Gen => genSg; + SF Sg Dat => datSg; + SF Sg Acc => accSg; + SF Sg Instr => instrSg; + SF Sg Loc => locSg; + SF Sg VocP => vocSg; + SF Pl Nom => nomPl; + SF Pl Gen => genPl; + SF Pl Dat => datPl; + SF Pl Acc => accPl; + SF Pl Instr => instrPl; + SF Pl Loc => locPl; + SF Pl VocP => vocPl + }; + g = g; + } ** {lock_N = <> } ; + + + + +-- Nouns used as functions need a preposition. The most common is with Genitive. + + mkN2 : N -> N2 ; + mkN2 n = mkFun n nullPrep ; + + mkFun : N -> Prep -> N2; + mkFun f p = { s = f.s; g = f.g; c = { c = p.c; s=p.s}; lock_N2=<> } ; + +-- The commonest cases are functions with Genitive. + nullPrep : Prep = {s = []; c= GenNoPrep; lock_Prep=<>}; + + mkN3 : N -> Prep -> Prep -> N3; + mkN3 f p r = { s = f.s; g = f.g; c = {s=p.s; c=p.c} ; c2 = {s=r.s; c=r.c}; lock_N3=<>}; + +--6 Preposition + +-- A preposition is formed from a string and a case. + + mkPrep : Str -> Case -> Prep; + mkPrep s c = mkCompl s c ** {lock_Prep = <>}; + + +-- Often just a case with the empty string is enough. +-- the directly following noun without a preposition + + genPrep : Prep; + genPrep = mkPrep [] genitive; + + datPrep : Prep; + datPrep = mkPrep [] dative; + + accPrep : Prep; + accPrep = mkPrep [] accusative; + + instrPrep : Prep; + instrPrep = mkPrep [] instrumental; + + +-- A great many of common prepositions are always with the genitive. + + bez_Prep : Prep; --without + bez_Prep = mkPrep "bez" genitive; + + dla_Prep : Prep; --for + dla_Prep = mkPrep "dla" genitive; + + do_Prep : Prep; --to + do_Prep = mkPrep "do" genitive; + + dookola_Prep : Prep; --(a)round + dookola_Prep = mkPrep "dookoła" genitive; + + kolo_Prep : Prep; --near + kolo_Prep = mkPrep "koło" genitive; + + obok_Prep : Prep; --beside, next to + obok_Prep = mkPrep "obok" genitive; + + od_Prep : Prep; --from + od_Prep = mkPrep "od" genitive; + + oprocz_Prep : Prep; --out of + oprocz_Prep = mkPrep "oprócz" genitive; + + podczas_Prep : Prep; --during + podczas_Prep = mkPrep "podczas" genitive; + + mimo_Prep : Prep; -- despite + mimo_Prep = mkPrep "mimo" genitive; + + spod_Prep : Prep; --under + spod_Prep = mkPrep "spod" genitive; + + u_Prep : Prep; --by, with (I was by Peter last sunday.) + u_Prep = mkPrep "u" genitive; + + wzdluz_Prep : Prep; --along + wzdluz_Prep = mkPrep "wzdłuż" genitive; + + z_Prep : Prep; --from (I come from Italy.), of/ from (The ring is made of silver.) + z_Prep = mkPrep "z" genitive; + + zamiast_Prep : Prep; --instead of + zamiast_Prep = mkPrep "zamiast" genitive; + + znad_Prep : Prep; --over, above + znad_Prep = mkPrep "znad" genitive; + + zza_Prep : Prep; --behind + zza_Prep = mkPrep "zza" genitive; + + +-- Prepositions always with the dative. + dzieki_Prep : Prep; -- thanks for + dzieki_Prep = mkPrep "dzięki" dative; + + przeciw_Prep : Prep; -- against + przeciw_Prep = mkPrep "przeciw" dative; + +}; diff --git a/lib/src/polish/PhrasePol.gf b/lib/src/polish/PhrasePol.gf new file mode 100644 index 000000000..8b3c299a9 --- /dev/null +++ b/lib/src/polish/PhrasePol.gf @@ -0,0 +1,32 @@ +--# -path=.:../abstract:../common:../prelude + +-- Adam Slaski, 2009 + +concrete PhrasePol of Phrase = CatPol ** open Prelude, ResPol, VerbMorphoPol in { + + lin + PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ; + + UttS s = s ; + UttQS qs = {s = qs.s} ; + UttImpSg pol imp = {s = imp.s !pol.p ! Sg} ; + UttImpPl pol imp = {s = imp.s !pol.p ! Pl} ; + UttImpPol pol imp = {s = imp.s !pol.p ! Sg} ; + + UttIP ip = {s = ip.nom}; + UttIAdv iadv = iadv ; + UttNP np = {s = np.nom}; + UttVP vp = { -- I assume positive polarization to avoid variants + s = vp.prefix !Pos !MascAniSg ++ + (infinitive_form vp.verb vp.imienne Pos) ++ + vp.sufix !Pos !MascAniSg ++ vp.postfix !Pos !MascAniSg + }; + UttAdv adv = adv ; + + NoPConj = {s = []} ; + PConjConj conj = {s = conj.s2} ; --- + + NoVoc = {s = []} ; + VocNP np = {s = "," ++ np.voc} ; + +} diff --git a/lib/src/polish/PronounMorphoPol.gf b/lib/src/polish/PronounMorphoPol.gf new file mode 100644 index 000000000..d51c33777 --- /dev/null +++ b/lib/src/polish/PronounMorphoPol.gf @@ -0,0 +1,673 @@ +--# -path=.:../../prelude:../common +--# -coding=utf8 + +--1 A polish Resource Morphology +-- +-- Ilona Nowak, Wintersemester 2007/08 +-- +-- Adam Slaski, 2009 +-- + +resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in { + + flags coding=utf8; + +--4 Pronouns + +--4.1 General + +--4.2 Personal pronouns and their possessive forms + +-- for "I", "my", "mine" + oper pronJa: Pron = + { nom = "ja"; + voc = "ja"; + dep = table { + (GenNoPrep|GenPrep) => "mnie"; + DatNoPrep => "mi"; + DatPrep => "mnie"; + (AccNoPrep|AccPrep) => "mnie"; + (InstrNoPrep|InstrPrep) => "mną"; + LocPrep => "mnie" + }; + sp = table { + AF (MascPersSg|MascAniSg|MascInaniSg) Nom => "mój"; + AF (MascPersSg|MascAniSg|MascInaniSg) Gen => "mojego"; + AF (MascPersSg|MascAniSg|MascInaniSg) Dat => "mojemu"; + AF MascInaniSg Acc => "mój"; -- widzę mój stół + AF (MascPersSg|MascAniSg|MascInaniSg) Acc => "mojego"; -- widzę mojego psa / przyjaciela + AF (MascPersSg|MascAniSg|MascInaniSg) Instr => "moim"; + AF (MascPersSg|MascAniSg|MascInaniSg) Loc => "moim"; + AF (MascPersSg|MascAniSg|MascInaniSg) VocP => "mój"; + + AF FemSg Nom => "moja" ; + AF FemSg Gen => "mojej"; + AF FemSg Dat => "mojej"; + AF FemSg Acc => "moją"; + AF FemSg Instr => "moją"; + AF FemSg Loc => "mojej"; + AF FemSg VocP => "moja"; + + AF NeutSg Nom => "moje" ; + AF NeutSg Gen => "mojego"; + AF NeutSg Dat => "mojemu"; + AF NeutSg Acc => "moje"; + AF NeutSg Instr => "moim"; + AF NeutSg Loc => "moim"; + AF NeutSg VocP => "moje"; + + AF MascPersPl Nom => "moi"; + AF (MascPersPl|OthersPl) Nom => "moje"; + AF (MascPersPl|OthersPl) Gen => "moich"; + AF (MascPersPl|OthersPl) Dat => "moim"; + AF MascPersPl Acc => "moich"; + AF (MascPersPl|OthersPl) Acc => "moje"; + AF (MascPersPl|OthersPl) Instr => "moimi"; + AF (MascPersPl|OthersPl) Loc => "moich"; + AF MascPersPl VocP => "moi"; + AF (MascPersPl|OthersPl) VocP=> "moje" + }; + n = Sg; + p = P1 ; + g = PNoGen + }; + + +-- for "you", "yours" + oper pronTy: Pron = + { sp = table { + AF (MascPersSg|MascAniSg|MascInaniSg) Nom => "twój"; + AF (MascPersSg|MascAniSg|MascInaniSg) Gen => "twojego"; + AF (MascPersSg|MascAniSg|MascInaniSg) Dat => "twojemu"; -- zróbmy to po twojemu + AF MascInaniSg Acc => "twój"; + AF (MascPersSg|MascAniSg|MascInaniSg) Acc => "twojego"; + AF (MascPersSg|MascAniSg|MascInaniSg) Instr => "twoim"; + AF (MascPersSg|MascAniSg|MascInaniSg) Loc => "twoim"; + AF (MascPersSg|MascAniSg|MascInaniSg) VocP => "twój"; + + AF FemSg Nom => "twoja" ; + AF FemSg Gen => "twojej"; + AF FemSg Dat => "twojej"; + AF FemSg Acc => "twoją"; + AF FemSg Instr => "twoją"; + AF FemSg Loc => "twojej"; + AF FemSg VocP => "twoja"; + + AF NeutSg Nom => "twoje" ; + AF NeutSg Gen => "twojego"; + AF NeutSg Dat => "twojemu"; + AF NeutSg Acc => "twoje"; + AF NeutSg Instr => "twoim"; + AF NeutSg Loc => "twoim"; + AF NeutSg VocP => "twoje"; + + AF MascPersPl Nom => "twoi"; + AF (MascPersPl|OthersPl) Nom => "twoje"; + AF (MascPersPl|OthersPl) Gen => "twoich"; + AF (MascPersPl|OthersPl) Dat => "twoim"; + AF MascPersPl Acc => "twoich"; + AF (MascPersPl|OthersPl) Acc => "twoje"; + AF (MascPersPl|OthersPl) Instr => "twoimi"; + AF (MascPersPl|OthersPl) Loc => "twoich"; + AF MascPersPl VocP => "twoi"; + AF (MascPersPl|OthersPl) VocP => "twoje" + }; + nom = "ty" ; + voc = "ty" ; + dep = table { -- it is simplyfied to avoid variants + GenNoPrep => "cię"; + GenPrep => "ciebie"; + DatNoPrep => "tobie"; + DatPrep => "ci"; + AccNoPrep => "cię"; + AccPrep => "ciebie"; + (InstrNoPrep|InstrPrep) => "tobą"; + LocPrep => "tobie" + }; + n = Sg; + p = P2 ; + g = PNoGen + }; + + +-- for "he", "his" + oper pronOn: Pron = + { nom = "on" ; + voc = "on" ; + dep = table { + GenNoPrep => "jego"; --"go"}; + GenPrep => "niego"; + DatNoPrep => "jemu"; --"mu"}; + DatPrep => "niemu"; + AccNoPrep => "jego"; --"go" }; + AccPrep => "niego"; + InstrNoPrep => "nim"; + InstrPrep => "nim"; + LocPrep => "nim" + }; + sp = \\_ => "jego"; + n = Sg; + p = P3 ; + g = PGen (Masc Personal) + }; + + +-- for "she", "her", "hers" + oper pronOna: Pron = + { nom = "ona" ; + voc = "ona" ; + dep = table { + GenNoPrep => "jej"; + GenPrep => "niej"; + DatNoPrep => "jej"; + DatPrep => "nią"; + AccNoPrep => "ją"; + AccPrep => "nią"; + InstrNoPrep => "nią"; + InstrPrep => "nią"; + LocPrep => "niej" + }; + sp = \\_ => "jej"; + n = Sg; + p = P3 ; + g = PGen Fem; + }; + + +-- for "it", "its" + oper pronOno: Pron = + { nom = "ono" ; + voc = "ono" ; + dep= table { + GenNoPrep => "jego"; --"go"}; + GenPrep => "niego"; + DatNoPrep => "jemu"; --"mu"}; + DatPrep => "niemu"; + AccNoPrep => "je"; + AccPrep => "nie"; + InstrNoPrep => "nim"; + InstrPrep => "nim"; + LocPrep => "nim" + }; + sp = \\_ => "jej"; + n = Sg; + p = P3 ; + g = PGen Neut + }; + + +-- for "we", "our", "us", "ours" + oper pronMy: Pron = + { nom = "my"; + voc = "my"; + dep = table { + (GenNoPrep|GenPrep) => "nas"; + (DatNoPrep|DatPrep) => "nam"; + (AccNoPrep|AccPrep) => "nas"; + (InstrNoPrep|InstrPrep) => "nami"; + LocPrep => "nas" + }; + sp = table { + AF (MascPersSg|MascAniSg|MascInaniSg) Nom => "nasz"; + AF (MascPersSg|MascAniSg|MascInaniSg) Gen => "naszego"; + AF (MascPersSg|MascAniSg|MascInaniSg) Dat => "naszemu"; -- zróbmy to po naszemu + AF MascInaniSg Acc => "nasz"; + AF (MascPersSg|MascAniSg|MascInaniSg) Acc => "naszego"; + AF (MascPersSg|MascAniSg|MascInaniSg) Instr => "naszym"; + AF (MascPersSg|MascAniSg|MascInaniSg) Loc => "naszym"; + AF (MascPersSg|MascAniSg|MascInaniSg) VocP => "nasz"; + + AF FemSg Nom => "nasza" ; + AF FemSg Gen => "naszej"; + AF FemSg Dat => "naszej"; + AF FemSg Acc => "naszą"; + AF FemSg Instr => "naszą"; + AF FemSg Loc => "naszej"; + AF FemSg VocP => "nasza"; + + AF NeutSg Nom => "nasze" ; + AF NeutSg Gen => "naszego"; + AF NeutSg Dat => "naszemu"; + AF NeutSg Acc => "nasze"; + AF NeutSg Instr => "naszym"; + AF NeutSg Loc => "naszym"; + AF NeutSg VocP => "nasze"; + + AF MascPersPl Nom => "nasi"; + AF (MascPersPl|OthersPl) Nom => "nasze"; + AF (MascPersPl|OthersPl) Gen => "naszych"; + AF (MascPersPl|OthersPl) Dat => "naszym"; + AF MascPersPl Acc => "naszych"; + AF (MascPersPl|OthersPl) Acc => "nasze"; + AF (MascPersPl|OthersPl) Instr => "naszymi"; + AF (MascPersPl|OthersPl) Loc => "naszych"; + AF MascPersPl VocP => "nasi"; + AF (MascPersPl|OthersPl) VocP => "nasze" + }; + n = Pl; + p = P1 ; + g = PNoGen + }; + + +-- for "you", "yours", "your" + oper pronWy: Pron = + { nom = "wy" ; + voc = "wy" ; + dep = table { + (GenNoPrep|GenPrep) => "was"; + (DatNoPrep|DatPrep) => "wam"; + (AccNoPrep|AccPrep) => "was"; + (InstrNoPrep|InstrPrep) => "wami"; + LocPrep => "was" + }; + sp = table { + AF (MascPersSg|MascAniSg|MascInaniSg) Nom => "wasz"; + AF (MascPersSg|MascAniSg|MascInaniSg) Gen => "waszego"; + AF (MascPersSg|MascAniSg|MascInaniSg) Dat => "waszemu"; -- zróbmy to po waszemu + AF MascInaniSg Acc => "wasz"; + AF (MascPersSg|MascAniSg|MascInaniSg) Acc => "waszego"; + AF (MascPersSg|MascAniSg|MascInaniSg) Instr => "waszym"; + AF (MascPersSg|MascAniSg|MascInaniSg) Loc => "waszym"; + AF (MascPersSg|MascAniSg|MascInaniSg) VocP => "wasz"; + + AF FemSg Nom => "wasza" ; + AF FemSg Gen => "waszej"; + AF FemSg Dat => "waszej"; + AF FemSg Acc => "waszą"; + AF FemSg Instr => "waszą"; + AF FemSg Loc => "waszej"; + AF FemSg VocP => "wasza"; + + AF NeutSg Nom => "wasze" ; + AF NeutSg Gen => "waszego"; + AF NeutSg Dat => "waszemu"; + AF NeutSg Acc => "wasze"; + AF NeutSg Instr => "waszym"; + AF NeutSg Loc => "waszym"; + AF NeutSg VocP => "wasze"; + + AF MascPersPl Nom => "wasi"; + AF (MascPersPl|OthersPl) Nom => "wasze"; + AF (MascPersPl|OthersPl) Gen => "waszych"; + AF (MascPersPl|OthersPl) Dat => "waszym"; + AF MascPersPl Acc => "waszych"; + AF (MascPersPl|OthersPl) Acc => "wasze"; + AF (MascPersPl|OthersPl) Instr => "waszymi"; + AF (MascPersPl|OthersPl) Loc => "waszych"; + AF MascPersPl VocP => "wasi"; + AF (MascPersPl|OthersPl) VocP => "wasze" + }; + n = Pl; + p = P2 ; + g = PNoGen + }; + + +-- for "they", "their", "theirs" (Sg he)= Masculinum + oper pronOni: Pron = + { nom = "oni" ; + voc = "oni" ; + dep = table { + GenNoPrep => "ich"; + GenPrep => "nich"; + DatNoPrep => "im"; + DatPrep => "nim"; + AccNoPrep => "ich"; + AccPrep => "nich"; + (InstrNoPrep|InstrPrep) => "nimi"; + LocPrep => "nich" + }; + sp = \\_ => "ich"; + n = Pl; + p = P3 ; + g = PGen (Masc Personal) + }; + + +-- for "they", "their", "theirs" (Sg she, it)= Fem), Neut) + oper pronOneFem: Pron = + { nom = "one" ; + voc = "one" ; + dep = table { + GenNoPrep => "ich"; + GenPrep => "nich"; + DatNoPrep => "im"; + DatPrep => "nim"; + AccNoPrep => "je"; + AccPrep => "nie"; + (InstrNoPrep|InstrPrep) => "nimi"; + LocPrep => "nich" + }; + sp = \\_ => "ich"; + n = Pl; + p = P3 ; + g = PGen Fem + }; + + oper pronOneNeut: Pron = + { nom = "one" ; + voc = "one" ; + dep = table { + GenNoPrep => "ich"; + GenPrep => "nich"; + DatNoPrep => "im"; + DatPrep => "nim"; + AccNoPrep => "je"; + AccPrep => "nie"; + (InstrNoPrep|InstrPrep) => "nimi"; + LocPrep => "nich" + }; + sp = \\_ => "ich"; + n = Pl; + p = P3 ; + g = PGen Neut + }; +--4.3 Interrogative pronouns +{- +-- for "who", "whose" + oper pronKto : Pron = + { s = table { + PF Nom _ NonPoss => "kto" ; + (GenNoPrep|GenPrep) NonPoss => "kogo"; + (DatNoPrep|DatPrep) NonPoss => "komu"; + (AccNoPrep|AccPrep) NonPoss => "kogo"; + (InstrNoPrep|InstrPrep) NonPoss => "kim"; + LocPrep NonPoss => "kim"; + PF VocP _ NonPoss => nonExist; + PF _ _ (Poss _ _) => nonExist -- exists in my opinion [asl] : czyje + }; + n = Sg; + p = P3 ; + g = PGen (Masc Personal); + pron = False + }; + + +-- for "what" + oper pronCo : Pron = + { s = table { + PF Nom _ NonPoss => "co"; + (GenNoPrep|GenPrep) NonPoss => "czego"; + (DatNoPrep|DatPrep) NonPoss => "czemu"; + (AccNoPrep|AccPrep) NonPoss => "co"; + (InstrNoPrep|InstrPrep) NonPoss => "czym"; + LocPrep NonPoss => "czym"; + PF VocP _ NonPoss => nonExist; + PF _ _ (Poss _ _) => nonExist + }; + n = Sg; + p = P3 ; + g = PGen (Masc Personal); + pron = False + }; + + + +--4.4 Indefinite pronouns + +-- for "somebody", "someone", "someone's" +-- in negative sentence, question for "anybody", "anyone" + +-- ktoś + +-- for "someone", "somebody", "someone's", "somebody's" +-- in question for "anyone", "anybody", "anyone's", "anybody's" + oper pronKtokolwiek : Pron = + { s = table { + PF Nom _ NonPoss => "ktokolwiek"; + (GenNoPrep|GenPrep) NonPoss => "kogokolwiek"; + (DatNoPrep|DatPrep) NonPoss => "komukolwiek"; + (AccNoPrep|AccPrep) NonPoss => "kogokolwiek"; + (InstrNoPrep|InstrPrep) NonPoss => "kimkolwiek"; + LocPrep NonPoss => "kimkolwiek"; + PF VocP _ NonPoss => nonExist; + PF _ _ (Poss _ _) => nonExist + }; + n = Sg; + p = P3 ; + g = PGen (Masc Personal); + pron = False + }; + + + +-- for "something", "its" +-- in negativ sentence, question or if-sentence for "anything" + +-- coś + +-- for "something", "its" +-- in question for "anything" + +-- doesn't seam to true, doesn't seam to be necessary + +-- oper pronCokolwiek : Pron = +-- { s = table { +-- PF Nom _ NonPoss => "cokolwiek"; +-- (GenNoPrep|GenPrep) NonPoss => "czegokolwiek"; +-- (DatNoPrep|DatPrep) NonPoss => "czemukolwiek"; +-- (AccNoPrep|AccPrep) NonPoss => "cokolwiek"; +-- (InstrNoPrep|InstrPrep) NonPoss => "czymkolwiek"; +-- LocPrep NonPoss => "czymkolwiek"; +-- PF VocP _ NonPoss => nonExist; +-- PF _ _ (Poss _ _) => nonExist +-- }; +-- n = Sg; +-- p = P3 ; +-- g = PGen (Neut)); +-- pron = False +-- }; + + + + +--4.5 Negation pronouns + + + +-- for "nobody". Sg and Pl forms given. It is used like +-- an adjective before a noun. So the end product of this +-- oper is an adjectiv and no pronoun. +-- oper pronZaden : Str -> Adjective = \zaden -> +-- let x = fleetingEminus zaden +-- in +-- table { +-- AF (MascPersSg|MascAniSg|MascInaniSg) Nom => zaden; +-- AF (MascPersSg|MascAniSg|MascInaniSg) Gen => x +"ego"; +-- AF (MascPersSg|MascAniSg|MascInaniSg) Dat => x +"emu"; +-- AF MascInaniSg Acc => zaden; +-- AF (MascPersSg|MascAniSg|MascInaniSg) Acc => x +"ego"; +-- AF (MascPersSg|MascAniSg|MascInaniSg) VocP => zaden; +-- AF (MascPersSg|MascAniSg|MascInaniSg) _ => x + "ym"; +-- --------------------------- +-- AF FemSg Nom => x +"a"; +-- AF FemSg Acc => x +"ą"; +-- AF FemSg Instr => x + "ą"; +-- AF FemSg VocP => x + "a"; +-- AF FemSg _ => x + "ej"; +-- --------------------------- +-- AF NeutSg Gen => x +"ego"; +-- AF NeutSg Dat => x +"emu"; +-- AF NeutSg Instr => x + "ym"; +-- AF NeutSg Loc => x + "ym"; +-- AF NeutSg _ => x + "e"; +-- ----------------------------- +-- AF MascPersPl Nom => x; +-- AF MascPersPl Dat => x + "ym"; +-- AF MascPersPl Instr => x + "ymi"; +-- AF MascPersPl VocP => x; +-- AF MascPersPl _ => x + "ych"; +-- --------------------------- +-- AF (MascPersPl|OthersPl) Nom => x + "e"; +-- AF (MascPersPl|OthersPl) Dat => x +"ym"; +-- AF (MascPersPl|OthersPl) Acc => x + "e"; +-- AF (MascPersPl|OthersPl) Instr => x + "mi"; +-- AF (MascPersPl|OthersPl) VocP => x + "e"; +-- AF (MascPersPl|OthersPl) _ => x + "ych" +-- }; +-- +-- +-} +--4.6 Demonstrativ pronouns + +-- for "ten" ("this") and "tamten" ("that") + oper demPronTen: Str -> { s,sp : AForm => Str } = \s -> + let + x = Predef.tk 3 s + in + { s,sp = table { + AF (MascPersSg|MascAniSg|MascInaniSg) Nom => x + "ten"; + AF (MascPersSg|MascAniSg|MascInaniSg) Gen => x + "tego"; + AF (MascPersSg|MascAniSg|MascInaniSg) Dat => x + "temu"; + AF MascInaniSg Acc => x + "ten"; + AF (MascPersSg|MascAniSg|MascInaniSg) Acc => x + "tego"; + AF (MascPersSg|MascAniSg|MascInaniSg) VocP => "[" ++ x +"ten" ++ [": the vocative form does not exist]"]; + AF (MascPersSg|MascAniSg|MascInaniSg) _ => x + "tym"; + --------------------------- + AF FemSg Nom => x + "ta"; + AF FemSg Acc => x + "tę"; + AF FemSg Instr => x + "tą"; + AF FemSg VocP => "["+x + "ten"++[": the vocative form does not exist]"]; + AF FemSg _ => x + "tej"; + --------------------------- + AF NeutSg Nom => x + "to"; + AF NeutSg Gen => x + "tego"; + AF NeutSg Dat => x + "temu"; + AF NeutSg Acc => x + "to"; + AF NeutSg VocP => "["+x + "ten"++[": the vocative form does not exist]"]; + AF NeutSg _ => x + "tym"; + ---------------------------- + AF MascPersPl Nom => x + "ci"; + AF MascPersPl Dat => x + "tym"; + AF MascPersPl Instr => x + "tymi"; + AF MascPersPl VocP => "["+x + "ten"++[": the vocative form does not exist]"]; + AF MascPersPl _ => x + "tych"; + --------------------------- + AF (MascPersPl|OthersPl) Nom => x + "te"; + AF (MascPersPl|OthersPl) Dat => x + "tym"; + AF (MascPersPl|OthersPl) Acc => x + "te"; + AF (MascPersPl|OthersPl) Instr => x + "tymi"; + AF (MascPersPl|OthersPl) VocP => "["+x + "ten"++[": the vocative form does not exist]"]; + AF (MascPersPl|OthersPl) _ => x + "tych" + } } ; + + oper wszystek : AForm => Str = + table { + AF (MascPersSg|MascAniSg|MascInaniSg) Nom => "wszystek"; + AF (MascPersSg|MascAniSg|MascInaniSg) Gen => "wszystkiego"; + AF (MascPersSg|MascAniSg|MascInaniSg) Dat => "wszystkiemu"; + AF MascInaniSg Acc => "wszystek"; -- wszystky stół widzę + AF (MascPersSg|MascAniSg) Acc => "wszystkiego"; -- wszystkego psa / przyjaciela widzę + AF (MascPersSg|MascAniSg|MascInaniSg) Instr => "wszystkim"; + AF (MascPersSg|MascAniSg|MascInaniSg) Loc => "wszystkim"; + AF (MascPersSg|MascAniSg|MascInaniSg) VocP => "wszystek"; + + AF FemSg Nom => "wszystka"; + AF FemSg Gen => "wszystkiej"; + AF FemSg Dat => "wszystkiej"; + AF FemSg Acc => "wszystką"; + AF FemSg Instr => "wszystką"; + AF FemSg Loc => "wszystkiej"; + AF FemSg VocP => "wszystka"; + + AF NeutSg Nom => "wszystkie" ; + AF NeutSg Gen => "wszystkiego"; + AF NeutSg Dat => "wszystkiemu"; + AF NeutSg Acc => "wszystkie"; + AF NeutSg Instr => "wszystkim"; + AF NeutSg Loc => "wszystkim"; + AF NeutSg VocP => "wszystkie"; + + AF MascPersPl Nom => "wszyscy"; + AF OthersPl Nom => "wszystkie"; + AF (MascPersPl|OthersPl) Gen => "wszystkich"; + AF (MascPersPl|OthersPl) Dat => "wszystkim"; + AF MascPersPl Acc => "wszystkich"; + AF (MascPersPl|OthersPl) Acc => "wszystkie"; + AF (MascPersPl|OthersPl) Instr => "wszystkimi"; + AF (MascPersPl|OthersPl) Loc => "wszystkich"; + AF MascPersPl VocP => "wszyscy"; + AF OthersPl VocP => "wszystkie" + }; + + +{- +-- +-- -- oper for "a" +-- oper jedenDet: Str -> Adjective = \s -> +-- table { +-- AF (MascPersSg|MascAniSg|MascInaniSg) Nom => "jeden"; +-- AF (MascPersSg|MascAniSg|MascInaniSg) Gen => "jednego"; +-- AF (MascPersSg|MascAniSg|MascInaniSg) Dat => "jednemu"; +-- AF MascInaniSg Acc => "jeden"; +-- AF (MascPersSg|MascAniSg|MascInaniSg) Acc => "jednego"; +-- AF (MascPersSg|MascAniSg|MascInaniSg) VocP => nonExist; +-- AF (MascPersSg|MascAniSg|MascInaniSg) _ => "jednym"; +-- --------------------------- +-- AF FemSg Nom => "jedna"; +-- AF FemSg Acc => "jedną"; +-- AF FemSg Instr => "jedną"; +-- AF FemSg VocP => nonExist; +-- AF FemSg _ => "jednej"; +-- --------------------------- +-- AF NeutSg Nom => "jedno"; +-- AF NeutSg Gen => "jedno"; +-- AF NeutSg Dat => "jednemu"; +-- AF NeutSg Acc => "jedno"; +-- AF NeutSg VocP => nonExist; +-- AF NeutSg _ => "jednym"; +-- ---------------------------- +-- AF MascPersPl Nom => "jedni"; +-- AF MascPersPl Dat => "jednym"; +-- AF MascPersPl Instr => "jednymi"; +-- AF MascPersPl VocP => nonExist; +-- AF MascPersPl _ => "jednych"; +-- --------------------------- +-- AF (MascPersPl|OthersPl) Nom => "jedne"; +-- AF (MascPersPl|OthersPl) Dat => "jednym"; +-- AF (MascPersPl|OthersPl) Acc => "jedne"; +-- AF (MascPersPl|OthersPl) Instr => "jednymi"; +-- AF (MascPersPl|OthersPl) VocP => nonExist; +-- AF (MascPersPl|OthersPl) _ => "jednych" +-- }; +-- +-- +-- +-- --4.7 Generalized pronouns ????????????????? +-- +-- --???????????????????????????? english +-- -- pronoun "all" +-- + +--4.8 Pronouns used in funtion of DET, PREDET + +-- Here, I have to define "wszystek" again, but only for the plural. +-- I need it in declension of pronKazdy, because "każdy" has only +-- sg forms. In pl they are used forms of "wszyscy". + +-- oper pronWszystekDet : Str -> Adjective = \wszyscy -> +-- table { +-- AF MascPersPl Nom => "wszyscy"; +-- AF (MascPersPl|OthersPl) _) Nom => "wszystkie"; +-- AF (MascPersPl|OthersPl) _) Gen => "wszystkich"; +-- AF (MascPersPl|OthersPl) _) Dat => "wszystkim"; +-- AF MascPersPl Acc => "wszystkich"; +-- AF (MascPersPl|OthersPl) _) Acc => "wszystkie"; +-- AF (MascPersPl|OthersPl) _) Instr => "wszystkimi"; +-- AF (MascPersPl|OthersPl) _) Loc => "wszystkich"; +-- _ => nonExist +-- }; + + +-- I need this oper for building of pronouns like "każdy". +-- This pronoun has not any plural forms. For plural it is used +-- the pronoun "wszyscy" ( Pl form of "wszystek") + +-- oper pronKazdy : (x : Str ) -> {s : Number => Adjective} = \x -> +-- {s = table { +-- Sg => table {af => ((AdjectivDeclension "każdy") ! af)}; +-- Pl => table {af => ((pronWszystekDet "wszyscy") ! af)} +-- }}; +-} +} diff --git a/lib/src/polish/QuestionPol.gf b/lib/src/polish/QuestionPol.gf new file mode 100644 index 000000000..ccc9a223e --- /dev/null +++ b/lib/src/polish/QuestionPol.gf @@ -0,0 +1,78 @@ +--# -path=.:../abstract:../common:../prelude + +-- Adam Slaski, 2009 + +concrete QuestionPol of Question = CatPol ** open ResPol, Prelude, VerbMorphoPol in { + + flags optimize=all_subs ; + +lin + +-- QuestCl : Cl -> QCl ; -- does John walk + QuestCl cl = { s = \\p,a,t=> "czy" ++ cl.s !p !a !t }; +-- QuestVP : IP -> VP -> QCl ; -- who walks + QuestVP ip vp = { + s = \\pol,anter,tense => ip.nom ++ vp.prefix !pol !ip.gn ++ + ((indicative_form vp.verb vp.imienne pol) !) ++ + vp.sufix !pol !ip.gn ++ vp.postfix !pol !ip.gn; + }; + +-- QuestSlash : IP -> ClSlash -> QCl ; -- whom does John love + QuestSlash ip cls = { + s = \\pol,anter,tense => cls.c.s ++ ip.dep ! cls.c.c ++ cls.s !pol !anter !tense + }; + +-- QuestIAdv : IAdv -> Cl -> QCl ; -- why does John walk + QuestIAdv ia cl = { s = \\p,a,t=> ia.s ++ cl.s !p !a !t }; + +-- QuestIComp : IComp -> NP -> QCl ; -- where is John + QuestIComp ic np = { + s = \\p,a,t => + (imienne_form {si = \\_=>[]; sp = \\_=>[]; asp = Dual; refl = ""; ppart=\\_=>""} p !) ++ np.nom + }; + +-- IdetCN : IDet -> CN -> IP ; -- which five songs + IdetCN idet cn = { + nom = idet.s !Nom !cn.g ++ cn.s !idet.n !(accom_case! ); + voc = idet.s !VocP !cn.g ++ cn.s !idet.n !(accom_case! ); + dep = \\cc => let c = extract_case! cc in + idet.s !c !cn.g ++ cn.s !idet.n ! (accom_case! ); + gn = (accom_gennum !); + p = P3 + }; +-- IdetIP : IDet -> IP ; -- which five + IdetIP idet = { + nom = idet.s !Nom !(Masc Personal); + voc = idet.s !VocP !(Masc Personal); + dep = \\cc => let c = extract_case! cc in + idet.s !c !(Masc Personal); + gn = cast_gennum! ; + p = P3 + }; + +-- AdvIP : IP -> Adv -> IP ; -- who in Paris + AdvIP ip adv = { + nom = ip.nom ++ adv.s; + voc = ip.voc ++ adv.s; + dep = \\cc => ip.dep!cc ++ adv.s; + gn = ip.gn; + p = ip.p + }; + +-- IdetQuant : IQuant -> Num -> IDet ; -- which (five) + IdetQuant iq n = { + s = \\c,g => iq.s! AF (cast_gennum! ) c; + n = n.n; + a = NoA + }; + +-- PrepIP : Prep -> IP -> IAdv ; -- with whom + PrepIP prep ip = { s = prep.s ++ ip.dep !prep.c}; + +-- CompIAdv : IAdv -> IComp ; -- where (is it) + CompIAdv ia = ia; + +-- CompIP : IP -> IComp ; -- who (is it) + CompIP ip = { s = ip.dep ! InstrNoPrep }; + +} diff --git a/lib/src/polish/RelativePol.gf b/lib/src/polish/RelativePol.gf new file mode 100644 index 000000000..ed5a5b5bb --- /dev/null +++ b/lib/src/polish/RelativePol.gf @@ -0,0 +1,60 @@ +--# -path=.:../abstract:../common:../prelude + +-- Adam Slaski, 2009 + +concrete RelativePol of Relative = CatPol ** open ResPol, VerbMorphoPol in { + + flags optimize=all_subs ; coding=utf8 ; + + lin + +-- ASL +-- In my opinion this is terribly medley of two phenomena. One of them is connected with funs RelCl and RelS. +-- The other with rest of the funs. Why don't separate them? + + +-- RelCl : Cl -> RCl ; -- such that John loves her + RelCl cl = { + s = \\_,pol, ant, ten => ["tak, że"] ++ cl.s ! pol ! ant ! ten + }; + +-- RelVP : RP -> VP -> RCl ; -- who loves John +-- enormous memory usage !!! + RelVP rp vp = { + s = \\gn => case rp.mgn of { + NoGenNum=> + \\pol, anter, tense => + "," ++ rp.s !AF gn Nom ++ vp.prefix !pol !gn ++ + ((indicative_form vp.verb vp.imienne pol) !) ++ + vp.sufix !pol !gn ++ vp.postfix !pol !gn; + JustGenNum x => + \\pol, anter, tense => + "," ++ rp.s !AF gn Nom ++ vp.prefix !pol !x ++ + ((indicative_form vp.verb vp.imienne pol) !) ++ + vp.sufix !pol !x ++ vp.postfix !pol !x + } + }; + +-- RelSlash : RP -> ClSlash -> RCl ; -- whom John loves + RelSlash rp clslash = { + s = \\gn, pol, anter, tense => + "," ++ clslash.c.s ++ rp.s !AF gn (extract_case!(npcase!)) ++ clslash.s !pol !anter !tense; + }; + +-- IdRP : RP ; -- which + IdRP = { s = ktory; mgn = NoGenNum }; + +-- FunRP : Prep -> NP -> RP -> RP ; -- the mother of whom +-- i have bad feelings about that. terrible overgeneratnig +-- policjant, (za którym ksiądz) kocha ... - wrong tree +-- should be policjant, ((za którym) (ksiądz) kocha) + FunRP p n rp = { s = table { + AF gn Nom => p.s ++ rp.s!AF gn (extract_case!p.c) ++ n.nom; + AF gn VocP => p.s ++ rp.s!AF gn (extract_case!p.c) ++ n.voc; + AF gn c => p.s ++ rp.s!AF gn (extract_case!p.c) ++ n.dep! + (case c of { Gen => GenNoPrep; Dat => DatNoPrep; Instr => InstrNoPrep; Acc => AccNoPrep; _=>LocPrep }) + }; + mgn = JustGenNum n.gn + }; + +} diff --git a/lib/src/polish/ResPol.gf b/lib/src/polish/ResPol.gf new file mode 100644 index 000000000..ddfcd4ad2 --- /dev/null +++ b/lib/src/polish/ResPol.gf @@ -0,0 +1,371 @@ +--# -path=.:../abstract:../common:../../prelude +--# -coding=utf8 + +-- Ilona Nowak Wintersemester 2007/08 + +-- Adam Slaski, 2009 + +-- 1 Polish auxiliary operations. + +-- This module contains operations that are needed to make the +-- resource syntax work. + + resource ResPol = ParamX ** open Prelude in { + + flags coding=utf8 ; optimize=all_subs ; + +---------------------- Parameter types definition -------------------------- +-- Their parameter values are atomic. +-- Some parameters, such as $Number$ or $Person$, are inherited from $ParamX$. +-- So it must not to be defined here again. +-- Masculine Gender gets the 'Animacy' as an argument, +-- because in polish language animacy is important only +-- in declension of masculine nouns. +-- So masculine gender isn't atomic, but feminine and neute are. +-- Read about it in ParadigmsPol.gf, where the genders are defined. + + +--1 Nouns + +----------------------- Parameter for nouns ---------------------------------- + + param + Gender = Masc Animacy | Fem | NeutGr | Neut ; + Animacy = Animate | Inanimate | Personal ; + Case = Nom | Gen | Dat | Acc | Instr | Loc | VocP ; + +-- Nouns are declined according to number and case. +-- For the sake of shorter description, these parameters are +-- combined in the type SubstForm. + + param SubstForm = SF Number Case ; + + + oper CommNoun = {s : SubstForm => Str; g : Gender}; + + +--2 Verbs + +----------------------- Parameter for verbs ---------------------------------- + +-- General information + +-- Polish verb has two indicative tenses called pseudoparticiple (with meaning of the past) +-- and finitive. Meaning ofthe second one depends on aspect: if verb is perfective then finitive +-- form has meaning of the future, otherwise of the present. Future tense of imperfective +-- verb is constructed with proper form of 'być' ('to be') and variantively +-- the infinitive or the past form. + +-- So on morphological level verbs inflection looks as follow: + + param VFormM = + VInfM + |VImperSg2M + |VImperPl1M + |VImperPl2M + |VFinM Number Person + |VPraetM GenNum Person + |VCondM GenNum Person; + + +-- Presence of voices in Polish is a matter of controversion. +-- In this work I treat voice as syntax (not morphological) phenomenon. +-- Passive voice will be constructed from passive participle. +-- Reflexive voice will be constructed from active forms. + +-- Aspect tells, if the action is already done or it is still taking place +-- at the time of speaking. + + param + Aspect = Dual | Imperfective | Perfective ; + + oper Verb : Type = { + si : VFormM => Str; + sp : VFormM => Str; + refl : Str; + asp : Aspect; + ppart : AForm=>Str + }; + +-- and on syntax level: +{- param + TenseP = Present | PastP | Future ; + PolarityP = PosP | DirNeg | InDirNeg; -- for the indirect object of negation + + param VForm = + VInf Gender Number --byc zjedzonym / zjedzoną (?) + |VInd Gender Number Person TenseP Anteriority + |VImp Gender Number Person; --niech zostane zjedzony / zjedzona-} + + oper VerbPhrase : Type = { + prefix, sufix, postfix : Polarity => GenNum => Str; + verb : Verb; + imienne : Bool;-- formed with 'to be' (she was nice, he is a man, etc.) + exp : Bool -- expanded + }; + +{- oper AccToGen : Complement -> Case = \c -> + case c.s of { + "" => case c.c of {Acc => Gen; _ => c.c }; + _ => c.c + };-} + +-- Anteriority is defined in ../common/ParamX.gf. +-- So it isn't needed to be defined here again. + +-- Anteriority = Simul | Anter ; -- predefined + +--3 Adjectives + +----------------------- Parameter for adjectives ---------------------------------- + +-- Description and explanation in AdjectiveMorphoPol.gf + + oper adj11forms : Type = { s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11 : Str }; + + oper Adj : Type = { + pos : adj11forms; + comp : adj11forms; + super : adj11forms; + advpos : Str; + advcomp : Str; + advsuper : Str; + }; + + oper mkAtable : adj11forms -> AForm => Str = \f -> + table { + AF (MascPersSg|MascAniSg | MascInaniSg) Nom => f.s1; + AF (MascPersSg|MascAniSg | MascInaniSg) Gen => f.s2; + AF (MascPersSg|MascAniSg | MascInaniSg) Dat => f.s3; + AF MascInaniSg Acc => f.s1; + AF (MascPersSg|MascAniSg) Acc => f.s2; + AF (MascPersSg|MascAniSg | MascInaniSg) Instr => f.s4; + AF (MascPersSg|MascAniSg | MascInaniSg) Loc => f.s4; + AF (MascPersSg|MascAniSg | MascInaniSg) VocP => f.s1; + + AF FemSg Nom => f.s6 ; + AF FemSg Gen => f.s7; + AF FemSg Dat => f.s7; + AF FemSg Acc => f.s8; + AF FemSg Instr => f.s8; + AF FemSg Loc => f.s7; + AF FemSg VocP => f.s6; + + AF NeutSg Nom => f.s5 ; + AF NeutSg Gen => f.s2; + AF NeutSg Dat => f.s3; + AF NeutSg Acc => f.s5; + AF NeutSg Instr => f.s4; + AF NeutSg Loc => f.s4; + AF NeutSg VocP => f.s5; + + AF MascPersPl Nom => f.s9; + AF OthersPl Nom => f.s5; + AF _ Gen => f.s10; + AF _ Dat => f.s4; + AF MascPersPl Acc => f.s10; + AF OthersPl Acc => f.s5; + AF _ Instr => f.s11; + AF _ Loc => f.s10; + AF MascPersPl VocP => f.s9; + AF OthersPl VocP => f.s5 + }; + + param AForm = AF GenNum Case; + + oper AdjPhrase = { s : AForm => Str; adv:Str }; + +--4 Pronoun + +----------------------- Parameter for pronouns ------------------------- + +-- Gender is not morphologically determined for first +-- and second person pronouns in Sg. and Pl. +-- (for Sg: "ja", "ty", Pl: "my", "wy"). +-- Therefore some pronouns don't have gender or it is not +-- possible to decline them. (-> PNoGen) + + param PronGen = PGen Gender | PNoGen ; + +-- The AfterPrep parameter is introduced in order to describe --FIXME +-- the variations of the third person personal pronoun forms +-- depending on whether they come after a preposition or not. + +-- param AfterPrep = Pre | Post ; --removed + +-- The sp field stands for the possesive variant of the pronoun. + + oper Pron = { nom: Str; voc:Str; dep: ComplCase => Str ; sp: AForm => Str ; n : Number ; p : Person ; + g: PronGen } ; + +--6 Complement definition + + param ComplCase = GenPrep | GenNoPrep | DatPrep | DatNoPrep | + AccPrep | AccNoPrep | InstrPrep | InstrNoPrep | LocPrep ; + + oper + Complement : Type = {s : Str; c : ComplCase} ; + + mkCompl : Str -> Case -> Complement; + mkCompl s c = { + s=s; + c = case s of { + "" => case c of { Gen => GenNoPrep; Dat => DatNoPrep; Instr => InstrNoPrep; _ => AccNoPrep }; + _ => case c of { Gen => GenPrep; Dat => DatPrep; Acc => AccPrep; Instr => InstrPrep; _ => LocPrep } + } + }; + + extract_case = table {GenPrep => Gen; GenNoPrep => Gen; DatPrep => Dat; + DatNoPrep => Dat; AccPrep => Acc; AccNoPrep => Acc; InstrPrep => Instr; + InstrNoPrep => Instr; LocPrep => Loc}; + +--7 Various types +-- possible problem: dzieci ,ktorych piecioro bawilo sie... / okna, ktorych piec stalo opartych o sciane... + param GenNum = MascPersSg | MascAniSg | MascInaniSg | FemSg | NeutSg | MascPersPl | OthersPl; + + param MaybeGenNum = NoGenNum | JustGenNum GenNum; + + oper + NounPhrase : Type = { + nom: Str; voc: Str; dep: ComplCase => Str; -- dep = dependent cases + gn: GenNum; p : Person }; + + cast_gennum = table { + => MascPersSg; + => MascAniSg; + => MascInaniSg; + => FemSg; + => NeutSg; + => NeutSg; + => MascPersPl; + _ => OthersPl + }; + + extract_num = table { (MascPersSg|MascAniSg|MascInaniSg|FemSg|NeutSg) => Sg; _ => Pl } ; + +-- dopelniacz negacji + npcase : Polarity * ComplCase => ComplCase = + table { + => GenNoPrep; + <_, c> => c + }; + +-- Determiners + + param Accom = NoA | DwaA | PiecA | StoA | TysiacA; -- Accomodation of cases + + + oper + IDeterminer : Type = { s: Case => Gender => Str; n: Number; a: Accom}; + Determiner : Type = { s,sp: Case => Gender => Str; n: Number; a: Accom}; + + oper + accom_case = table { + => Gen; + => Gen; + => Gen; + => Gen; + => Gen; + => Gen; + => Gen; + => Gen; + x => x.p2 + }; + + accom_gennum : Accom * Gender * Number => GenNum = + table { + => NeutSg; + => NeutSg; + => NeutSg; + => NeutSg; + <_, g, n> => cast_gennum! + }; + + + ktory : AForm => Str = table { + AF (MascPersSg|MascAniSg|MascInaniSg) Nom => "który"; + AF (MascPersSg|MascAniSg|MascInaniSg) Gen => "którego"; + AF (MascPersSg|MascAniSg|MascInaniSg) Dat => "któremu"; + AF MascInaniSg Acc => "który"; -- który stół widzę + AF (MascPersSg|MascAniSg) Acc => "którego"; -- którego psa / przyjaciela widzę + AF (MascPersSg|MascAniSg|MascInaniSg) Instr => "którym"; + AF (MascPersSg|MascAniSg|MascInaniSg) Loc => "którym"; + AF (MascPersSg|MascAniSg|MascInaniSg) VocP => "który"; + + AF FemSg Nom => "która" ; + AF FemSg Gen => "której"; + AF FemSg Dat => "której"; + AF FemSg Acc => "którą"; + AF FemSg Instr => "którą"; + AF FemSg Loc => "której"; + AF FemSg VocP => "która"; + + AF NeutSg Nom => "które" ; + AF NeutSg Gen => "którego"; + AF NeutSg Dat => "któremu"; + AF NeutSg Acc => "które"; + AF NeutSg Instr => "którym"; + AF NeutSg Loc => "którym"; + AF NeutSg VocP => "które"; + + AF MascPersPl Nom => "którzy"; + AF (MascPersPl|OthersPl) Nom => "które"; + AF (MascPersPl|OthersPl) Gen => "których"; + AF (MascPersPl|OthersPl) Dat => "którym"; + AF MascPersPl Acc => "których"; + AF (MascPersPl|OthersPl) Acc => "które"; + AF (MascPersPl|OthersPl) Instr => "którymi"; + AF (MascPersPl|OthersPl) Loc => "których"; + AF MascPersPl VocP => "którzy"; + AF (MascPersPl|OthersPl) VocP=> "które" + }; + + jaki : AForm => Str = table { + AF (MascPersSg|MascAniSg|MascInaniSg) Nom => "jaki"; + AF (MascPersSg|MascAniSg|MascInaniSg) Gen => "jakiego"; + AF (MascPersSg|MascAniSg|MascInaniSg) Dat => "jakiemu"; + AF MascInaniSg Acc => "jaki"; -- jakiy stół widzę + AF (MascPersSg|MascAniSg) Acc => "jakiego"; -- jakiego psa / przyjaciela widzę + AF (MascPersSg|MascAniSg|MascInaniSg) Instr => "jakim"; + AF (MascPersSg|MascAniSg|MascInaniSg) Loc => "jakim"; + AF (MascPersSg|MascAniSg|MascInaniSg) VocP => "jaki"; + + AF FemSg Nom => "jaka" ; + AF FemSg Gen => "jakiej"; + AF FemSg Dat => "jakiej"; + AF FemSg Acc => "jaką"; + AF FemSg Instr => "jaką"; + AF FemSg Loc => "jakej"; + AF FemSg VocP => "jaka"; + + AF NeutSg Nom => "jakie" ; + AF NeutSg Gen => "jakiego"; + AF NeutSg Dat => "jakiemu"; + AF NeutSg Acc => "jakie"; + AF NeutSg Instr => "jakim"; + AF NeutSg Loc => "jakim"; + AF NeutSg VocP => "jakie"; + + AF MascPersPl Nom => "jacy"; + AF (MascPersPl|OthersPl) Nom => "jakie"; + AF (MascPersPl|OthersPl) Gen => "jakich"; + AF (MascPersPl|OthersPl) Dat => "jakim"; + AF MascPersPl Acc => "jakich"; + AF (MascPersPl|OthersPl) Acc => "jakie"; + AF (MascPersPl|OthersPl) Instr => "jakimi"; + AF (MascPersPl|OthersPl) Loc => "jakich"; + AF MascPersPl VocP => "jacy"; + AF (MascPersPl|OthersPl) VocP=> "jakie" + }; + + siebie : Case => Str = table { + Nom => "się"; + Gen => "siebie"; + Dat => "sobie"; + Acc => "siebie"; + Instr => "sobą"; + Loc => "sobie"; + VocP => ["[siebie: the vocative form does not exist]"] + }; + +} ; \ No newline at end of file diff --git a/lib/src/polish/SentencePol.gf b/lib/src/polish/SentencePol.gf new file mode 100644 index 000000000..2636585ad --- /dev/null +++ b/lib/src/polish/SentencePol.gf @@ -0,0 +1,104 @@ +--# -path=.:../abstract:../common:../prelude + +-- Adam Slaski, 2009 + +concrete SentencePol of Sentence = CatPol ** open Prelude, ResPol, VerbMorphoPol in { + + flags optimize=all_subs ; coding=utf8 ; + +lin +-- PredVP : NP -> VP -> Cl ; -- John walks + PredVP np vp = { + s = \\pol,anter,tense => + np.nom ++ vp.prefix !pol !np.gn ++ + ((indicative_form vp.verb vp.imienne pol) !) ++ + vp.sufix !pol !np.gn ++ vp.postfix !pol !np.gn; + }; + +-- UseCl : Temp -> Pol -> Cl -> S ; + UseCl temp pol cl = { + s = temp.s ++ pol.s ++ cl.s !pol.p !temp.a !temp.t + }; + +-- UseRCl : Temp -> Pol -> RCl -> RS ; + UseRCl temp pol rcl = { + s = \\gn => temp.s ++ pol.s ++ rcl.s !gn !pol.p !temp.a !temp.t + }; + +-- UseQCl : Temp -> Pol -> QCl -> QS ; + UseQCl temp pol qcl = { + s = temp.s ++ pol.s ++ qcl.s !pol.p !temp.a !temp.t + }; + +-- UseSlash : Temp -> Pol -> ClSlash -> SSlash ; + UseSlash temp pol cls = { + s = temp.s ++ pol.s ++ cls.s !pol.p !temp.a !temp.t; + c = cls.c + }; + +-- SlashVP : NP -> VPSlash -> ClSlash ; -- (whom) he sees + SlashVP np vps = { + s = \\pol,anter,tense => case vps.exp of { + True => + np.nom ++ vps.prefix !pol !np.gn ++ + ((indicative_form vps.verb vps.imienne pol) !) ++ + vps.sufix !pol !np.gn ++ vps.postfix !pol !np.gn; + False => + vps.prefix !pol !np.gn ++ + ((indicative_form vps.verb vps.imienne pol) !) ++ + vps.sufix !pol !np.gn ++ vps.postfix !pol !np.gn ++ np.nom + }; + c = vps.c + }; + +-- AdvSlash : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today + AdvSlash cls adv = { + s = \\pol,anter,tense => adv.s ++ cls.s !pol !anter !tense; + c = cls.c + }; + +-- SlashVS : NP -> VS -> SSlash -> ClSlash ; -- (whom) she says that he loves + SlashVS np vs ssl = { + s = \\pol,anter,tense => np.nom ++ + ((indicative_form vs False pol) !) ++ + [", że"] ++ ssl.s; + c = ssl.c + }; + +-- ImpVP : VP -> Imp ; -- love yourselves + ImpVP vp = { + s = \\pol,num => vp.prefix !pol !MascAniSg ++ + (imperative_form vp.verb vp.imienne pol (cast_gennum!) P2) ++ + vp.sufix !pol !MascAniSg ++ vp.postfix !pol !MascAniSg + }; + +-- AdvS : Adv -> S -> S ; -- today, I will go home + AdvS adv s = { s = adv.s ++ s.s }; + +-- SlashPrep : Cl -> Prep -> ClSlash ; -- (with whom) he walks + SlashPrep c p = { s=c.s; c=p }; + +-- EmbedS : S -> SC ; -- that she goes + EmbedS s = s; + +-- EmbedQS : QS -> SC ; -- who goes + EmbedQS s = s; + +-- EmbedVP : VP -> SC ; -- to go + EmbedVP vp = { + s = vp.prefix !Pos !MascPersSg ++ + (infinitive_form vp.verb vp.imienne Pos) ++ + vp.sufix !Pos !MascPersSg ++ vp.postfix !Pos !MascPersSg + }; + +-- RelS : S -> RS -> S ; -- she sleeps, which is good + RelS s rs = ss (s.s ++ rs.s!NeutSg); + +-- PredSCVP : SC -> VP -> Cl ; -- that she goes is good + PredSCVP sc vp = { + s = \\pol,anter,tense => + sc.s ++ vp.prefix !pol !NeutSg ++ + ((indicative_form vp.verb vp.imienne pol) !) ++ + vp.sufix !pol !NeutSg ++ vp.postfix !pol !NeutSg; + }; +} diff --git a/lib/src/polish/StructuralPol.gf b/lib/src/polish/StructuralPol.gf new file mode 100644 index 000000000..5031690af --- /dev/null +++ b/lib/src/polish/StructuralPol.gf @@ -0,0 +1,121 @@ +--# -path=.:../abstract:../common:../prelude + +-- Ilona Nowak Wintersemester 2007/08 + +-- Adam Slaski, 2009 + +-- In Polish language they aren't determiners like in english or german. + +concrete StructuralPol of Structural = CatPol ** + open ResPol, MorphoPol, ParadigmsPol, Prelude in { + + + flags optimize=all; coding=utf8; + +lin + + above_Prep = mkPrep "nad" Instr; + after_Prep = mkPrep "po" Loc; + + all_Predet = { s=wszystek; np=wszystko; adj=True }; + almost_AdA, almost_AdN = ss "prawie"; + although_Subj = ss "pomimo"; + always_AdV = ss "zawsze"; + and_Conj = {s1=""; s2 = "i"; sent1=""; sent2=["i"]}; + at_least_AdN = ss "co najmniej"; + at_most_AdN = ss "co najwyżej"; + because_Subj = ss "ponieważ"; + before_Prep = mkPrep "przed" Instr; + behind_Prep = mkPrep "za" Instr; + between_Prep = mkPrep "między" Instr; + both7and_DConj = {s1="zarówno"; s2=["jak i"]; sent1="zarówno"; sent2=[", jak i"]}; + but_PConj = ss "ale"; + by8agent_Prep = mkPrep "przez" Acc; + by8means_Prep = mkPrep "przez" Acc; + can8know_VV = mkItVerb (mkMonoVerb "umieć" conj101 Imperfective); + can_VV = mkItVerb (mkMonoVerb "móc" conj27 Imperfective); + during_Prep = mkPrep "podczas" Gen; -- def. in ParadigmsPol + either7or_DConj = {s1="albo"; s2="albo"; sent1="albo"; sent2=[", albo"]}; + every_Det = kazdyDet; + everybody_NP = wszyscy ** {lock_NP=<>}; + everything_NP = wszystko ** {lock_NP=<>}; + everywhere_Adv = ss "wszędzie"; + except_Prep = mkPrep "z wyjątkiem" Acc; + few_Det = pareDet; + for_Prep = mkPrep "dla" Gen; + from_Prep = mkPrep "z" Gen; -- def. in ParadigmsPol + have_V2 = dirV2 (mkMonoVerb "mieć" conj100 Imperfective); + he_Pron = pronOn; + here_Adv = ss "tutaj"; + here7to_Adv = ss "tutaj"; + here7from_Adv = ss "stąd"; + how_IAdv = ss "jak"; + how8many_IDet = ileDet; + i_Pron = pronJa; + if_Subj = ss "jeśli"; + if_then_Conj = {s1="jeżeli"; s2=[", to"]; sent1="jeżeli"; sent2=[", to"]}; + in8front_Prep = mkPrep "przed" Instr; + in_Prep = mkPrep "w" Loc; + it_Pron = pronOno; + language_title_Utt = ss "polski"; + less_CAdv = {s,sn = "mniej" ; p,pn = "niż" } ; + many_Det = wieleDet; + more_CAdv = {s = "bardziej" ; pn,p = "niż"; sn="więcej"} ; + most_Predet = { s=wszystek; np={nom="większość"; voc="większości"; + dep=table{AccPrep|AccNoPrep=>"większość"; InstrPrep|InstrNoPrep=>"większością"; _=>"większości"}; + p=P3; gn=FemSg}; adj=False }; + much_Det = duzoDet; + must_VV = mkItVerb (mkMonoVerb "musieć" conj93 Imperfective); + no_Quant = zadenQuant; + no_Utt = ss "nie"; + nobody_NP = niktNP; + not_Predet = { s=zadenQuant.s; np=wszystko; adj=True }; + nothing_NP = nicNP; + on_Prep = mkPrep "nа" Loc; + only_Predet = { s=\\_=>"tylko"; np=wszystko; adj=True }; + or_Conj = {s1=""; s2="lub"; sent1=""; sent2=["lub"]}; + otherwise_PConj = ss "inaczej"; + part_Prep = mkPrep "z" Gen; + please_Voc = ss "proszę"; + possess_Prep = mkPrep "" Gen; --overgenerating with pronouns + quite_Adv = ss "całkiem"; + she_Pron = pronOna; + so_AdA = ss "tak"; + somebody_NP = ktos ** {lock_NP = <>}; + someSg_Det = pewienDet; + somePl_Det = pewniDet; + something_NP = cos ** {lock_NP = <>}; + somewhere_Adv = ss "gdzieś"; + that_Quant = demPronTen "tamten"; + there_Adv = ss "tam"; + there7to_Adv = ss "tam"; + there7from_Adv = ss "stamtąd"; + therefore_PConj = ss "dlatego"; + they_Pron = pronOni;-- pronOneFem; pronOneNeut}; + this_Quant = demPronTen "ten"; + through_Prep = mkPrep "przez" Acc; + to_Prep = mkPrep "do" Gen; -- def. in ParadigmsPol.gf + too_AdA = ss "za"; + under_Prep = mkPrep "pod" Instr; -- with Acc too + very_AdA = ss "bardzo"; + want_VV = mkV "chcieć" conj45 "zechcieć" conj45; + we_Pron = pronMy; + whatPl_IP = co; + whatSg_IP = co; + when_IAdv = ss "kiedy"; + when_Subj = ss "jeśli"; + where_IAdv = ss "gdzie"; + which_IQuant = { s = ktory }; + whoPl_IP = kto; + whoSg_IP = kto; + why_IAdv = ss "dlaczego"; + with_Prep = mkPrep "z" Instr; + without_Prep = mkPrep "bez" Gen; -- def. in ParadigmsPol.gf + youPl_Pron = pronWy; + yes_Utt = ss "tak"; + youSg_Pron = pronTy; + youPol_Pron = pronTy; + + as_CAdv = { s,sn="tak"; p,pn="jak"} ; + +}; diff --git a/lib/src/polish/TextPol.gf b/lib/src/polish/TextPol.gf new file mode 100644 index 000000000..87a2e3ebc --- /dev/null +++ b/lib/src/polish/TextPol.gf @@ -0,0 +1,9 @@ +concrete TextPol of Text = { + + lin + TEmpty = {s = []} ; + TFullStop x xs = {s = x.s ++ "." ++ xs.s} ; + TQuestMark x xs = {s = x.s ++ "?" ++ xs.s} ; + TExclMark x xs = {s = x.s ++ "!" ++ xs.s} ; + +} diff --git a/lib/src/polish/VerbMorphoPol.gf b/lib/src/polish/VerbMorphoPol.gf new file mode 100644 index 000000000..f5226150e --- /dev/null +++ b/lib/src/polish/VerbMorphoPol.gf @@ -0,0 +1,515 @@ +--# -path=.:../prelude:../common:../abstract +--# -coding=utf8 + +-- A Polish verb Resource Morphology +-- +-- Adam Slaski, 2009 +-- +resource VerbMorphoPol = ResPol ** open Prelude, CatPol, (Predef=Predef), (Adj=AdjectiveMorphoPol) in { + + flags coding=utf8; + +-- 2 Conjugation classes + +-- According to "Czasownik polski. Odmiana. Slownik." by Zygmunt Saloni 2001 +-- there are 106 schemes of verb inflection in Polish. I implement only +-- these, which are necessery. Numeration as in mentioned book. + +-- opers for the building of the whole paradigm of a verb +-- in all tenses + + oper ConjCl : Type = Str -> { s:VFormM => Str; p:AForm=>Str }; + + oper conj1 : ConjCl = + \byc -> + mkRegItConjCl byc "" "bądź" "bądźmy" "bądźcie" "jestem" "jesteś" "jest" "jesteśmy" "jesteście" "są" "był" "była" "było" "byli" "były"; + + oper conj3 : ConjCl = + \zastac -> let zasta = Predef.tk 1 zastac + in mkRegConjCl zastac zasta "ń" "ńmy" "ńcie" "nę" "niesz" "nie" "niemy" "niecie" "ną" "ł" "ła" "ło" "li" "ły" "n" "n"; + + oper conj4 : ConjCl = + \chlonac -> let chlo = Predef.tk 3 chlonac + in mkRegConjCl chlonac chlo "ń" "ńmy" "ńcie" "nę" "niesz" "nie" "niemy" "niecie" "ną" "nął" "nęła" "nęło" "nęli" "nęły" "nięt" "nięc"; + + oper conj5 : ConjCl = + \ciagnac -> let ciagn = Predef.tk 2 ciagnac + in mkRegConjCl ciagnac ciagn "ij" "ijmy" "ijcie" "ę" "iesz" "ie" "iemy" "iecie" "ą" "ął" "ęła" "ęło" "ęli" "ęły" "ięt" "ięc"; + + oper conj6 : ConjCl = + \cisnac -> let ci = Predef.tk 4 cisnac + in mkRegConjCl cisnac ci "śnij" "śnijmy" "śnijcie" "snę" "śniesz" "śnie" "śniemy" "śniecie" "sną" "snął" "snęła" "snęło" "snęli" "snęły" "śnięt" "śnięc"; + + oper conj7 : ConjCl = + \brzeknac -> let brzek = Predef.tk 3 brzeknac + in mkRegConjCl brzeknac brzek "nij" "nijmy" "nijcie" "nę" "niesz" "nie" "niemy" "niecie" "ną" "nął" "nęła" "nęło" "nęli" "nęły" "nięt" "nięc"; + + oper conj15 : ConjCl = + \biec -> let bie = Predef.tk 1 biec + in mkRegConjCl biec bie "gnij" "gnijmy" "gnijcie" "gnę" "gniesz" "gnie" "gniemy" "gniecie" "gną" "gł" "gła" "gło" "gli" "gły" "gnięt" "gnięc"; + + oper conj17 : ConjCl = + \krasc -> let kra = Predef.tk 2 krasc + in mkRegConjCl krasc kra "dnij" "dnijmy" "dnijcie" "dnę" "dniesz" "dnie" "dniemy" "dniecie" "dną" "dł" "dła" "dło" "dli" "dły" "dnięt" "dnięc"; + + oper conj23 : ConjCl = + \ciac -> + mkRegConjCl ciac "" "tnij" "tnijmy" "tnijcie" "tnę" "tniesz" "tnie" "tniemy" "tniecie" "tną" "ciął" "cięła" "cięło" "cięli" "cięły" "cięt" "cięc"; + + oper conj25 : ConjCl = + \klasc -> let kla = Predef.tk 2 klasc + in mkRegConjCl klasc kla "dź" "dźmy" "dźcie" "dę" "dziesz" "dzie" "dziemy" "dziecie" "dą" "dł" "dła" "dło" "dli" "dły" "dzion" "dzen"; + + oper conj26a : ConjCl = + \gryzc -> let gry = Predef.tk 2 gryzc + in mkRegConjCl gryzc gry "ź" "źmy" "źcie" "zę" "ziesz" "zie" "ziemy" "ziecie" "zą" "zł" "zła" "zło" "źli" "zły" "zion" "zien"; + + oper conj27 : ConjCl = + \wzmoc -> let wzm = Predef.tk 2 wzmoc + in mkRegConjCl wzmoc wzm "óż" "óżmy" "óżcie" "ogę" "ożesz" "oże" "ożemy" "ożecie" "ogą" "ógł" "ogła" "ogło" "ogli" "ogły" "ożon" "ożen"; + + oper conj40 : ConjCl = + \znalezc -> let zna = Predef.tk 4 znalezc + in mkRegConjCl znalezc zna "jdź" "jdźmy" "jdźcie" "jdę" "jdziesz" "jdzie" "jdziemy" "jdziecie" "jdą" "lazł" "lazła" "lazło" "leźli" "lazły" "lezion" "lezien"; + + oper conj41 : ConjCl = + \przyjsc -> let przy = Predef.tk 3 przyjsc + in mkRegItConjCl przyjsc przy "jdź" "jdźmy" "jdźcie" "jdę" "jdziesz" "jdzie" "jdziemy" "jdziecie" "jdą" "szedł" "szła" "szło" "szli" "szły"; + + oper conj41a : ConjCl = + \isc -> + mkRegItConjCl isc "" "idź" "idźmy" "idźcie" "idę" "idziesz" "idzie" "idziemy" "idziecie" "idą" "szedł" "szła" "szło" "szli" "szły"; + + oper conj42 : ConjCl = + \pojsc -> + mkRegItConjCl pojsc "p" "ójdź" "ójdźmy" "ójdźcie" "ójdę" "ójdziesz" "ójdzie" "ójdziemy" "ójdziecie" "ójdą" "oszedł" "oszła" "oszło" "oszli" "oszły"; + + oper conj43 : ConjCl = + \trzec -> let t = Predef.tk 4 trzec + in mkRegConjCl trzec t "rzyj" "rzyjmy" "rzyjcie" "rę" "rzesz" "rze" "rzemy" "rzecie" "rą" "arł" "arła" "arło" "arli" "arły" "art" "arc"; + + oper conj45 : ConjCl = + \zechciec -> let zechc = Predef.tk 3 zechciec + in mkRegConjCl zechciec zechc "iej" "iejmy" "iejcie" "ę" "esz" "e" "emy" "ecie" "ą" "iał" "iała" "iało" "ieli" "iały" "ian" "en"; + + oper conj51 : ConjCl = + \bic -> let bi = Predef.tk 1 bic + in mkRegConjCl bic bi "j" "jmy" "jcie" "ję" "jesz" "je" "jemy" "jecie" "ją" "ł" "ła" "ło" "li" "ły" "t" "c"; + + oper conj52 : ConjCl = + \siac -> let si = Predef.tk 2 siac + in mkRegConjCl siac si "ej" "ejmy" "ejcie" "eję" "ejesz" "eje" "ejemy" "ejecie" "eją" "ał" "ała" "ało" "ali" "ały" "an" "an"; + + oper conj53 : ConjCl = + \ratowac -> let rat = Predef.tk 4 ratowac + in mkRegConjCl ratowac rat "uj" "ujmy" "ujcie" "uję" "ujesz" "uje" "ujemy" "ujecie" "ują" "ował" "owała" "owało" "owali" "owały" "owan" "owan"; + + oper conj54 : ConjCl = + \skazywac -> let skaz = Predef.tk 4 skazywac + in mkRegConjCl skazywac skaz "uj" "ujmy" "ujcie" "uję" "ujesz" "uje" "ujemy" "ujecie" "ują" "ywał" "ywała" "ywało" "ywali" "ywały" "ywan" "ywan"; + + oper conj57 : ConjCl = + \dawac -> let da = Predef.tk 3 dawac + in mkRegConjCl dawac da "waj" "wajmy" "wajcie" "ję" "jesz" "je" "jemy" "jecie" "ją" "wał" "wała" "wało" "wali" "wały" "wan" "wan"; + + oper conj59 : ConjCl = + \wiazac -> let wia = Predef.tk 3 wiazac + in mkRegConjCl wiazac wia "ż" "żmy" "żcie" "żę" "żesz" "że" "żemy" "żecie" "żą" "zał" "zała" "zało" "zali" "zały" "zan" "zan"; + + oper conj60 : ConjCl = + \pisac -> let pis = Predef.tk 2 pisac + in mkRegConjCl pisac pis "z" "zmy" "zcie" "zę" "zesz" "ze" "zemy" "zecie" "zą" "ał" "ała" "ało" "ali" "ały" "an" "an"; + + oper conj61 : ConjCl = + \plukac -> let plu = Predef.tk 3 plukac + in mkRegConjCl plukac plu "cz" "czmy" "czcie" "czę" "czesz" "cze" "czemy" "czecie" "czą" "kał" "kała" "kało" "kali" "kały" "kan" "kan"; + + oper conj65 : ConjCl = + \rwac -> let rw = Predef.tk 2 rwac + in mkRegConjCl rwac rw "ij" "ijmy" "ijcie" "ę" "iesz" "ie" "iemy" "iecie" "ą" "ał" "ała" "ało" "ali" "ały" "an" "an"; + + oper conj67 : ConjCl = + \wyslac -> let wy = Predef.tk 4 wyslac + in mkRegConjCl wyslac wy "ślij" "ślijmy" "ślijcie" "ślę" "ślesz" "śle" "ślemy" "ślecie" "ślą" "słał" "słała" "słało" "słali" "słały" "słan" "słan"; + + oper conj70 : ConjCl = + \kopac -> let kop = Predef.tk 2 kopac + in mkRegConjCl kopac kop "" "my" "cie" "ię" "iesz" "ie" "iemy" "iecie" "ią" "ał" "ała" "ało" "ali" "ały" "an" "an"; + + oper conj72 : ConjCl = + \kupic -> let kup = Predef.tk 2 kupic + in mkRegConjCl kupic kup "" "my" "cie" "ię" "isz" "i" "imy" "icie" "ią" "ił" "iła" "iło" "ili" "iły" "ion" "ien"; + + oper conj72em : ConjCl = + \lubic -> let lub = Predef.tk 2 lubic + in mkRegConjCl lubic lub "" "my" "cie" "ię" "isz" "i" "imy" "icie" "ią" "ił" "iła" "iło" "ili" "iły" "ian" "ian"; + + oper conj75 : ConjCl = + \dzielic -> let dziel = Predef.tk 2 dzielic + in mkRegConjCl dzielic dziel "" "my" "cie" "ę" "isz" "i" "imy" "icie" "ą" "ił" "iła" "iło" "ili" "iły" "on" "en"; + + oper conj77 : ConjCl = + \robic -> let r = Predef.tk 4 robic + in mkRegConjCl robic r "ób" "óbmy" "óbcie" "obię" "obisz" "obi" "obimy" "obicie" "obią" "obił" "obiła" "obiło" "obili" "obiły" "obion" "obien"; + + oper conj77a : ConjCl = + \stanowic -> let stan = Predef.tk 4 stanowic + in mkRegConjCl stanowic stan "ów" "ówmy" "ówcie" "owię" "owisz" "owi" "owimy" "owicie" "owią" "owił" "owiła" "owiło" "owili" "owiły" "owion" "owien"; + + oper conj80 : ConjCl = + \budzic -> let bud = Predef.tk 3 budzic + in mkRegConjCl budzic bud "ź" "źmy" "źcie" "zę" "zisz" "zi" "zimy" "zicie" "zą" "ził" "ziła" "ziło" "zili" "ziły" "zon" "zen"; + + oper conj81 : ConjCl = + \tracic -> let tra = Predef.tk 3 tracic + in mkRegConjCl tracic tra "ć" "ćmy" "ćcie" "cę" "cisz" "ci" "cimy" "cicie" "cą" "cił" "ciła" "ciło" "cili" "ciły" "con" "cen"; + + oper conj83 : ConjCl = + \prosic -> let pro = Predef.tk 3 prosic + in mkRegConjCl prosic pro "ś" "śmy" "ście" "szę" "sisz" "si" "simy" "sicie" "szą" "sił" "siła" "siło" "sili" "siły" "szon" "szen"; + + oper conj84 : ConjCl = + \opuscic -> let opu = Predef.tk 4 opuscic + in mkRegConjCl opuscic opu "ść" "śćmy" "śćcie" "szczę" "ścisz" "ści" "ścimy" "ścicie" "szczą" "ścił" "ściła" "ściło" "ścili" "ściły" "szczon" "szczen"; + + oper conj87 : ConjCl = + \meczyc -> let mecz = Predef.tk 2 meczyc + in mkRegConjCl meczyc mecz "" "my" "cie" "ę" "ysz" "y" "ymy" "ycie" "ą" "ył" "yła" "yło" "yli" "yły" "on" "en"; + + oper conj88 : ConjCl = + \tworzyc -> let tw = Predef.tk 5 tworzyc + in mkRegConjCl tworzyc tw "órz" "órzmy" "órzcie" "orzę" "orzysz" "orzy" "orzymy" "orzycie" "orzą" "orzył" "orzyła" "orzyło" "orzyli" "orzyły" "orzon" "orzen"; + + oper conj88a : ConjCl = --wlozyc + \tworzyc -> let tw = Predef.tk 5 tworzyc + in mkRegConjCl tworzyc tw "óż" "óżmy" "óżcie" "ożę" "ożysz" "oży" "ożymy" "ożycie" "ożą" "ożył" "ożyła" "ożyło" "ożyli" "ożyły" "ożon" "ożen"; + + oper conj90 : ConjCl = + \myslec -> let mys = Predef.tk 3 myslec + in mkRegConjCl myslec mys "l" "lmy" "lcie" "lę" "lisz" "li" "limy" "licie" "lą" "lał" "lała" "lało" "leli" "lały" "lan" "lan"; + + oper conj91 : ConjCl = + \pomniec -> let pomn = Predef.tk 3 pomniec + in mkRegConjCl pomniec pomn "ij" "ijmy" "ijcie" "ę" "isz" "i" "imy" "icie" "ą" "iał" "iała" "iało" "ieli" "iały" "ian" "ian"; + + oper conj92 : ConjCl = + \widziec -> let wid = Predef.tk 4 widziec + in mkRegConjCl widziec wid "ź" "źmy" "źcie" "zę" "zisz" "zi" "zimy" "zicie" "zą" "ział" "ziała" "ziało" "zieli" "ziały" "zian" "zian"; + + oper conj93 : ConjCl = + \wisiec -> let wi = Predef.tk 4 wisiec + in mkRegConjCl wisiec wi "ś" "śmy" "ście" "szę" "sisz" "si" "simy" "sicie" "szą" "siał" "siała" "siało" "sieli" "siały" "sian" "szen"; + + oper conj94 : ConjCl = + \slyszec -> let slysz = Predef.tk 2 slyszec + in mkRegConjCl slyszec slysz "" "my" "cie" "ę" "ysz" "y" "ymy" "ycie" "ą" "ał" "ała" "ało" "eli" "ały" "an" "an"; + + oper conj94a : ConjCl = + \obejrzec -> let obejrz = Predef.tk 2 obejrzec + in mkRegConjCl obejrzec obejrz "yj" "yjmy" "yjcie" "ę" "ysz" "y" "ymy" "ycie" "ą" "ał" "ała" "ało" "eli" "ały" "an" "an"; + + oper conj95 : ConjCl = + \wystac -> let wyst = Predef.tk 2 wystac + in mkRegConjCl wystac wyst "ój" "ójmy" "ójcie" "oję" "oisz" "oi" "oimy" "oicie" "oją" "ał" "ała" "ało" "ali" "ały" "an" "an"; + + oper conj96 : ConjCl = + \spac -> + mkRegConjCl spac "" "śpij" "śpijmy" "śpijcie" "śpię" "śpisz" "śpi" "śpimy" "śpicie" "śpią" "spał" "spała" "spało" "spali" "spały" "span" "span"; + + oper conj98 : ConjCl = + \pytac -> let pyta = Predef.tk 1 pytac + in mkRegConjCl pytac pyta "j" "jmy" "jcie" "m" "sz" "" "my" "cie" "ją" "ł" "ła" "ło" "li" "ły" "n" "n"; + + oper conj99 : ConjCl = + \dac -> let da = Predef.tk 1 dac + in mkRegConjCl dac da "j" "jmy" "jcie" "m" "sz" "" "my" "cie" "ją" "ł" "ła" "ło" "li" "ły" "n" "n"; + + oper conj100 : ConjCl = + \miec -> let m = Predef.tk 3 miec + in mkRegConjCl miec m "iej" "iejmy" "iejcie" "am" "asz" "a" "amy" "acie" "ają" "iał" "iała" "iało" "ieli" "iały" "ian" "ian"; + + oper conj101 : ConjCl = + \rozumiec -> let rozumi = Predef.tk 2 rozumiec + in mkRegConjCl rozumiec rozumi "ej" "ejmy" "ejcie" "em" "esz" "e" "emy" "ecie" "eją" "ał" "ała" "ało" "eli" "ały" "an" "an"; + + oper conj102 : ConjCl = + \jesc -> let j = Predef.tk 3 jesc + in mkRegConjCl jesc j "edz" "edzmy" "edzcie" "em" "esz" "e" "emy" "ecie" "dzą" "adł" "adła" "adło" "edli" "adły" "edzon" "edzen"; + + oper conj103 : ConjCl = + \wiedziec -> let wie = Predef.tk 5 wiedziec + in mkRegConjCl wiedziec wie "dz" "dzmy" "dzcie" "m" "sz" "" "my" "cie" "dzą" "dział" "działa" "działo" "dzieli" "działy" "dzian" "dzian"; + + oper conjbac : ConjCl = \_-> + mkRegConjCl "bać" "b" "ój" "ójmy" "ójcie" "oję" "oisz" "oi" "oimy" "oicie" "oją" "ał" "ała" "ało" "ali" "ały" "an" "an"; + + oper mkRegItConjCl : Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> + Str -> Str -> ConjCl; + oper mkRegItConjCl pytac pyta j jmy jcie m sz sg3 my cie ja l la lo li ly = { + s = mkVerbTable pytac pyta j jmy jcie m sz sg3 my cie ja l la lo li ly; + p = \\_=> "["++pytac ++ [": the participle form does not exist]"] + }; + + oper mkRegConjCl : Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> + Str -> Str -> Str -> Str -> ConjCl; + oper mkRegConjCl pytac pyta j jmy jcie m sz sg3 my cie ja l la lo li ly n npl = { + s = mkVerbTable pytac pyta j jmy jcie m sz sg3 my cie ja l la lo li ly; + p = mkAtable (Adj.model4 (pyta+n+"y") (pyta+npl+"i")) + }; + + oper mkVerbTable : Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> + Str -> Str -> Str -> VFormM =>Str; + oper mkVerbTable pytac pyta j jmy jcie m sz sg3 my cie ja l la lo li ly = + table { + VInfM => pytac; + VImperSg2M => pyta + j; + VImperPl1M => pyta + jmy; + VImperPl2M => pyta + jcie; + VFinM Sg P1 => pyta + m; + VFinM Sg P2 => pyta + sz; + VFinM Sg P3 => pyta + sg3; + VFinM Pl P1 => pyta + my; + VFinM Pl P2 => pyta + cie; + VFinM Pl P3 => pyta + ja; + VPraetM (MascPersSg|MascAniSg|MascInaniSg) P1 => pyta + l + "em"; + VPraetM (MascPersSg|MascAniSg|MascInaniSg) P2 => pyta + l + "eś"; + VPraetM (MascPersSg|MascAniSg|MascInaniSg) P3 => pyta + l; + VPraetM MascPersPl P1 => pyta + li + "śmy"; + VPraetM MascPersPl P2 => pyta + li + "ście"; + VPraetM MascPersPl P3 => pyta + li; + VPraetM FemSg P1 => pyta + la + "m"; + VPraetM FemSg P2 => pyta + la + "ś"; + VPraetM FemSg P3 => pyta + la; + VPraetM NeutSg P1 => pyta + lo + "m"; + VPraetM NeutSg P2 => pyta + lo + "ś"; + VPraetM NeutSg P3 => pyta + lo; + VPraetM OthersPl P1 => pyta + ly + "śmy"; + VPraetM OthersPl P2 => pyta + ly + "ście"; + VPraetM OthersPl P3 => pyta + ly; + VCondM (MascPersSg|MascAniSg|MascInaniSg) P1 => pyta + l + "by" + "m"; + VCondM (MascPersSg|MascAniSg|MascInaniSg) P2 => pyta + l + "by" + "ś"; + VCondM (MascPersSg|MascAniSg|MascInaniSg) P3 => pyta + l + "by"; + VCondM MascPersPl P1 => pyta + li + "by" + "śmy"; + VCondM MascPersPl P2 => pyta + li + "by" + "ście"; + VCondM MascPersPl P3 => pyta + li + "by" ; + VCondM FemSg P1 => pyta + la + "by" + "m"; + VCondM FemSg P2 => pyta + la + "by" + "ś"; + VCondM FemSg P3 => pyta + la + "by" ; + VCondM NeutSg P1 => pyta + lo + "by" + "m"; + VCondM NeutSg P2 => pyta + lo + "by" + "ś"; + VCondM NeutSg P3 => pyta + lo + "by" ; + VCondM OthersPl P1 => pyta + ly + "by" + "śmy"; + VCondM OthersPl P2 => pyta + ly + "by" + "ście"; + VCondM OthersPl P3 => pyta + ly + "by" + }; + +-- 3 Verb types definition + + mkV : Str -> ConjCl -> Str -> ConjCl -> Verb; + mkV = mkVerb; + + mkV1 : Str -> ConjCl -> Str -> ConjCl -> Verb; + mkV1 s c s2 c2 = mkItVerb (mkVerb s c s2 c2); + + +-- reflexive verbs + + oper mkReflVerb : Verb -> Verb = + \v -> + {si = v.si; + sp = v.sp; + refl = "się"; + asp = v.asp; + ppart = v.ppart + }; + +-- intransitive verbs + + oper mkItVerb : Verb -> Verb = + \v -> + {si = v.si; + sp = v.sp; + refl = v.refl; + asp = v.asp; + ppart = \\_=> "["++v.si!VInfM ++ [": the participle form does not exist]"] + }; + +-- monoaspective verbs + + oper mkMonoVerb : Str -> ConjCl -> Aspect -> Verb = + \s, c, a -> let tmp = (c s) in + {si = tmp.s; + sp = tmp.s; + refl = ""; + asp = a; + ppart= tmp.p + }; + +-- normal verbs + + oper mkVerb : Str -> ConjCl -> Str -> ConjCl -> Verb = + \s, c, s2, c2 -> let tmp = (c2 s2) in + {si = (c s).s; + sp = tmp.s; + refl = ""; + asp = Dual; + ppart = tmp.p + }; + +-- Comlicated verbs +-- Comlicated verbs like 'mieć nadzieję' ('to hope'). Sometimes happens that English verb +-- can't be translated directly into one Polish word, so I introduced this (little bit +-- unnatural) construction. + + oper mkComplicatedVerb : Verb -> Str -> Verb = + \v,s -> + {si = \\form => v.si !form ++ s; + sp = \\form => v.sp !form ++ s; + refl = v.refl; asp = v.asp; + ppart = v.ppart + }; + + +-- Two-place verbs +-- Two-place verbs, and the special case with a direct object. Note that +-- a particle can be included in a $V$. + + mkV2 : Verb -> Str -> Case -> V2; + mkV2 v p cas = v ** { c = mkCompl p cas; lock_V2 = <>}; + + mkV3 : Verb -> Str -> Str -> Case -> Case -> V3; + mkV3 v s1 s2 c1 c2 = v ** { c = mkCompl s1 c1; c2 = mkCompl s2 c2; lock_V3 = <>}; + + dirV2 : Verb -> V2; -- a typical case ie. "kochać", "pisać" + dirV2 v = mkV2 v [] Acc; + + dirV3 : Verb -> V3; -- a typical case ie. "zabrać", "dać" + dirV3 v = mkV3 v "" "" Acc Dat; + +-- conditional endings - not present +{- oper condEnd : Number -> Person -> Str = \n,p -> + case of { + => "bym"; + => "byś"; + => "by"; + => "byśmy"; + => "byście"; + => "by" + };-} + + + indicative_form : Verb -> Bool -> Polarity -> Tense * Anteriority * GenNum * Person => Str; + indicative_form verb imienne pol = + case imienne of {True => imienne_form verb pol; False => + let nie = case pol of { Pos => "" ; Neg => "nie" }; in + let sie = verb.refl; in + let perf = verb.sp; in + let imperf = verb.si; in + table { + => nie ++ imperf ! (VFinM (extract_num!gn) p) ++ sie ; + => nie ++ perf ! (VPraetM gn p) ++ sie ; + => nie ++ perf ! (VPraetM gn p) ++ sie ; + => nie ++ bedzie ! <(extract_num!gn), p> ++ sie ++ imperf ! (VPraetM gn P3); + => nie ++ perf ! (VFinM (extract_num!gn) p) ++ sie; + => nie ++ imperf ! (VCondM gn p) ++ sie; + => nie ++ perf ! (VCondM gn p) ++ sie + } + }; + + imienne_form : Verb -> Polarity -> Tense * Anteriority * GenNum * Person => Str; + imienne_form verb pol = + let byc = (case verb.asp of { Perfective => conj3 "zostać"; _ => conj1 "być" }).s; in + let zostac = (case verb.asp of { Imperfective => conj1 "być"; _ => conj3 "zostać" }).s; in + let nie = case pol of { Pos => "" ; Neg => "nie" }; in + table { + => nie ++ byc ! (VFinM (extract_num!gn) p) ++ verb.ppart ! AF gn Nom; + => nie ++ zostac ! (VPraetM gn p) ++ verb.ppart ! AF gn Nom; + => nie ++ byc ! (VPraetM gn p) ++ verb.ppart ! AF gn Nom; + => nie ++ zostac ! (VPraetM gn p) ++ verb.ppart ! AF gn Nom; + => nie ++ case verb.asp of { + Perfective => zostac ! (VFinM (extract_num!gn) p); + _ => bedzie ! + } ++ verb.ppart ! AF gn Nom; + => nie ++ zostac ! (VFinM (extract_num!gn) p) ++ verb.ppart ! AF gn Nom; + => nie ++ byc ! (VCondM gn p) ++ verb.ppart ! AF gn Nom; + => nie ++ zostac ! (VCondM gn p) ++ verb.ppart ! AF gn Nom + }; + + bedzie : Number * Person => Str = table { + => "będę"; + => "będziesz"; + => "będzie"; + => "będziemy"; + => "będziecie"; + => "będą" + }; + + imperative_form : Verb -> Bool -> Polarity -> GenNum -> Person -> Str; + imperative_form verb imienne pol gn p = + case imienne of { + True => + let badz = (case verb.asp of { Perfective => zostan_op; _ => badz_op })!<(extract_num!gn), p> in + let zostan = (case verb.asp of { Imperfective => badz_op; _ => zostan_op })!<(extract_num!gn), p> in + case pol of { + Pos => badz ++ verb.ppart! AF gn Nom; + Neg => "nie" ++ zostan ++ verb.ppart! AF gn Nom + }; + False => + let sie = verb.refl; in + case pol of { + Pos => case <(extract_num!gn), p> of { + => "niech" ++ sie ++ verb.sp ! VFinM Sg P1; + => verb.sp ! VImperSg2M ++ sie; + => "niech" ++ sie ++ verb.sp ! VFinM Sg P3; + => verb.sp ! VImperPl1M ++ sie; + => verb.sp ! VImperPl2M ++ sie; + => "niech" ++ sie ++ verb.sp ! VFinM Pl P3 + } ; + Neg => case <(extract_num!gn), p> of { + => "niech" ++ sie ++ "nie" ++ verb.si ! VFinM Sg P1; + => "nie" ++ verb.si ! VImperSg2M ++ sie; + => "niech" ++ sie ++ "nie" ++ verb.si ! VFinM Sg P3; + => "nie" ++ verb.si ! VImperPl1M ++ sie; + => "nie" ++ verb.si ! VImperPl2M ++ sie; + => "niech" ++ sie ++ "nie" ++ verb.si ! VFinM Pl P3 + } + } + }; + + infinitive_form : Verb -> Bool -> Polarity -> Str; + infinitive_form verb imienne pol = + case imienne of { + True => + let byc = case verb.asp of { Perfective => "zostać"; _ => "być" }; in + case pol of { + Pos => byc ++ verb.ppart! AF MascPersSg Nom; + Neg => "nie" ++ byc ++ verb.ppart! AF MascPersSg Nom + }; + False => + let sie = verb.refl; in + case pol of { + Pos => verb.sp ! VInfM ++ sie; + Neg => "nie" ++ verb.si ! VInfM ++ sie + } + }; + + + badz_op : Number * Person => Str = table { + => ["niech będę"]; + => ["bądź"]; + => ["niech będzie"]; + => ["bądźmy"]; + => ["bądźcie"]; + => ["niech będą"] + }; + + zostan_op : Number * Person => Str = table { + => ["niech zostanę"]; + => ["zostań"]; + => ["niech zostanie"]; + => ["zostańmy"]; + => ["zostańcie"]; + => ["niech zostaną"] + }; + +} diff --git a/lib/src/polish/VerbPol.gf b/lib/src/polish/VerbPol.gf new file mode 100644 index 000000000..0acd600d7 --- /dev/null +++ b/lib/src/polish/VerbPol.gf @@ -0,0 +1,160 @@ +--# -path=.:../abstract:../common:../prelude + +-- Adam Slaski, 2009 + +concrete VerbPol of Verb = CatPol ** open ResPol, Prelude in { + + flags optimize=all_subs ; coding=utf8 ; + +lin + UseV v = defVP v; + + PassV2 v = setImienne (defVP (castv2 v)) True; + + SlashV2a v = (defVP (castv2 v)) ** {c=v.c}; + + Slash2V3 v3 np = (setSufix (defVP (castv3 v3)) + (\\p,gn => + v3.c.s ++ np.dep ! (npcase !) )) + ** {c=v3.c2}; + + Slash3V3 v3 np = (setSufix (defVP (castv3 v3)) + (\\p,gn => + v3.c2.s ++ np.dep ! (npcase !) )) + ** {c=v3.c}; + +-- ComplSlash : VPSlash -> NP -> VP ; -- love it + ComplSlash vps np = setSufix vps (\\p,gn => + vps.sufix!p!gn ++ vps.c.s ++ np.dep !(npcase !)); + +-- AdvVP : VP -> Adv -> VP ; -- sleep here + AdvVP vp adv = setPrefix vp (\\p,gn => vp.prefix!p!gn ++ adv.s); + +-- AdVVP : AdV -> VP -> VP ; -- always sleep + AdVVP adV vp = setPrefix vp (\\p,gn => vp.prefix!p!gn ++ adV.s); + +-- ReflVP : VPSlash -> VP ; -- love himself + ReflVP vps = setSufix vps (\\p,gn => vps.sufix!p!gn ++ vps.c.s ++ siebie ! (extract_case! vps.c.c)); + +-- CompAP : AP -> Comp ; -- (be) small + CompAP ap = { s = \\gn => ap.s ! AF gn Nom }; + +-- CompNP : NP -> Comp ; -- (be) a man + CompNP np = { s = \\gn => np.dep !InstrNoPrep }; + +-- CompAdv : Adv -> Comp ; -- (be) here + CompAdv adv = { s = \\_ => adv.s }; + +-- UseComp : Comp -> VP ; -- be warm + UseComp c = setImienne (setSufix (defVP {si = \\_=>[]; sp = \\_=>[]; asp = Imperfective; refl = ""; ppart=\\_=>""}) + (\\_,gn => c.s!gn)) + True; + +-- ComplVV : VV -> VP -> VP ; -- want to run + ComplVV vv vp = setSufix (defVP vv) + (\\p,gn => vp.prefix !p!gn ++ vp.verb.si !VInfM ++ vp.sufix !p!gn); + +-- ComplVQ : VQ -> QS -> VP ; -- wonder who runs + ComplVQ vq qs = setSufix (defVP vq) (\\p,gn => "," ++ qs.s); + +-- ComplVS : VS -> S -> VP ; -- say that she runs + ComplVS vs s = setSufix (defVP vs) (\\p,gn => [", że"] ++ s.s); + +-- ComplVA : VA -> AP -> VP ; -- become red + ComplVA va a = setSufix (defVP (castva va)) (\\_,gn => va.c.s ++ + case va.c.adv of { False => a.s!(AF gn va.c.c); True => a.adv } ); + +-- SlashV2V : V2V -> VP -> VPSlash ; -- beg (her) to go + SlashV2V v vp = (setPostfix (defVP (castv2 v)) + (\\p,gn => vp.prefix !p!gn ++ vp.verb.si !VInfM ++ vp.sufix !p!gn)) + ** {c = v.c}; + +-- SlashV2S : V2S -> S -> VPSlash ; -- answer (to him) that it is good + SlashV2S v s = (setPostfix (defVP (castv2 v)) + (\\_,_ => [", że"] ++ s.s)) + ** {c = v.c}; +-- SlashV2Q : V2Q -> QS -> VPSlash ; -- ask (him) who came + SlashV2Q v qs = (setPostfix (defVP (castv2 v)) + (\\_,_ => "," ++ qs.s)) + ** {c = v.c}; + +-- SlashVV : VV -> VPSlash -> VPSlash ; -- want to buy + SlashVV v vps = (setPostfix (setSufix (defVP v) + (\\p,gn => vps.prefix !p!gn ++ vps.verb.si !VInfM ++ vps.sufix !p!gn)) --???? why !pg + vps.postfix) + ** {c = vps.c}; + +-- SlashV2VNP : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy + SlashV2VNP v np vps = (setPostfix (setSufix (defVP (castv2 v)) + (\\p,gn => + np.dep !(npcase !) ++ vps.prefix !p!gn ++ + vps.verb.si !VInfM ++ vps.sufix !p!gn)) + vps.postfix) + ** {c = vps.c}; + +-- SlashV2A : V2A -> AP -> VPSlash ; -- paint (it) red + SlashV2A va a = (setPostfix (defVP (castv2a va)) + (\\_,gn => va.c.s ++ case va.c.adv of { False => a.s!(AF gn va.c.c); True => a.adv })) + ** {c = va.c2}; + + +oper + castv2 : (Verb ** { c:Complement }) -> Verb = \v2 -> {si=v2.si;sp=v2.sp;asp=v2.asp;refl=v2.refl; ppart=v2.ppart}; + + castv3 : (Verb ** { c,c2:Complement }) -> Verb = \v2 -> {si=v2.si;sp=v2.sp;asp=v2.asp;refl=v2.refl; ppart=v2.ppart}; + + castva : (Verb ** { c:{c:Case; s:Str}}) -> Verb = \v2 -> {si=v2.si;sp=v2.sp;asp=v2.asp;refl=v2.refl; ppart=v2.ppart}; + + castv2a : (Verb ** { c:{c:Case; s:Str}; c2:Complement}) -> Verb = \v2 -> {si=v2.si;sp=v2.sp;asp=v2.asp;refl=v2.refl; ppart=v2.ppart}; + + defVP : Verb -> VerbPhrase = \v -> { + prefix = \\p,gn => ""; + sufix = \\p,gn => ""; + postfix = \\p,gn => ""; + verb = v; + imienne = False; + exp = False + }; + + setPrefix : VerbPhrase -> (Polarity => GenNum => Str) -> VerbPhrase + = \vp,s -> { + prefix = s; + sufix = vp.sufix; + postfix = vp.postfix; + verb = vp.verb; + imienne = vp.imienne; + exp = True + }; + + setSufix : VerbPhrase -> (Polarity => GenNum => Str) -> VerbPhrase + = \vp,s -> { + prefix = vp.prefix; + sufix = s; + postfix = vp.postfix; + verb = vp.verb; + imienne = vp.imienne; + exp = True + }; + + setPostfix : VerbPhrase -> (Polarity => GenNum => Str) -> VerbPhrase + = \vp,s -> { + prefix = vp.prefix; + sufix = vp.sufix; + postfix = s; + verb = vp.verb; + imienne = vp.imienne; + exp = True + }; + + setImienne : VerbPhrase -> Bool -> VerbPhrase + = \vp,b -> { + prefix = vp.prefix; + sufix = vp.sufix; + postfix = vp.postfix; + verb = vp.verb; + imienne = b; + exp = True + }; + +} ; +