forked from GitHub/gf-core
Polish resource grammar
This commit is contained in:
198
lib/src/polish/AdjectiveMorphoPol.gf
Normal file
198
lib/src/polish/AdjectiveMorphoPol.gf
Normal file
@@ -0,0 +1,198 @@
|
||||
--# -path=.:../prelude:../common
|
||||
--# -coding=utf8
|
||||
|
||||
-- A Polish adjective Resource Morphology
|
||||
|
||||
-- Adam Slaski, 2009 <adam.slaski@gmail.com>
|
||||
|
||||
|
||||
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
|
||||
};
|
||||
}
|
||||
45
lib/src/polish/AdjectivePol.gf
Normal file
45
lib/src/polish/AdjectivePol.gf
Normal file
@@ -0,0 +1,45 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
-- Adam Slaski, 2009 <adam.slaski@gmail.com>
|
||||
|
||||
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 };
|
||||
|
||||
};
|
||||
|
||||
30
lib/src/polish/AdverbPol.gf
Normal file
30
lib/src/polish/AdverbPol.gf
Normal file
@@ -0,0 +1,30 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
-- Adam Slaski, 2009 <adam.slaski@gmail.com>
|
||||
|
||||
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 ;
|
||||
}
|
||||
128
lib/src/polish/CatPol.gf
Normal file
128
lib/src/polish/CatPol.gf
Normal file
@@ -0,0 +1,128 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
-- Adam Slaski, 2009 <adam.slaski@gmail.com>
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
34
lib/src/polish/CommonPol.gf
Normal file
34
lib/src/polish/CommonPol.gf
Normal file
@@ -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
|
||||
|
||||
}
|
||||
88
lib/src/polish/ConjunctionPol.gf
Normal file
88
lib/src/polish/ConjunctionPol.gf
Normal file
@@ -0,0 +1,88 @@
|
||||
--# -path=.:../abstract:../common:../../prelude
|
||||
|
||||
-- Adam Slaski, 2009 <adam.slaski@gmail.com>
|
||||
|
||||
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 <list.np1.gn,list.np2.gn> of {
|
||||
<(MascPersSg|MascPersPl), (MascPersSg|MascPersPl)> => MascPersPl;
|
||||
<_,_> => OthersPl
|
||||
};
|
||||
p = case <list.np1.p,list.np2.p> of {
|
||||
<P1, _> => P1;
|
||||
<_, P1> => P1;
|
||||
<P2, _> => 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 <np.gn,npl.np1.gn> of {
|
||||
<(MascPersSg|MascPersPl), (MascPersSg|MascPersPl)> => MascPersPl;
|
||||
<_,_> => OthersPl
|
||||
};
|
||||
p = case <np.p,npl.np1.p> of {
|
||||
<P1, _> => P1;
|
||||
<_, P1> => P1;
|
||||
<P2, _> => 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} ;
|
||||
|
||||
}
|
||||
3
lib/src/polish/ExtraPol.gf
Normal file
3
lib/src/polish/ExtraPol.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--concrete ExtraPol of ExtraPolAbs = CatPol ** {
|
||||
--
|
||||
-- }
|
||||
19
lib/src/polish/GrammarPol.gf
Normal file
19
lib/src/polish/GrammarPol.gf
Normal file
@@ -0,0 +1,19 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
-- Adam Slaski, 2009 <adam.slaski@gmail.com>
|
||||
|
||||
concrete GrammarPol of Grammar =
|
||||
NounPol,
|
||||
VerbPol,
|
||||
AdjectivePol,
|
||||
AdverbPol,
|
||||
NumeralPol,
|
||||
SentencePol,
|
||||
QuestionPol,
|
||||
RelativePol,
|
||||
ConjunctionPol,
|
||||
PhrasePol,
|
||||
TextPol,
|
||||
StructuralPol,
|
||||
IdiomPol
|
||||
** { flags startcat = Phr ; unlexer = text ; lexer = text ;} ;
|
||||
52
lib/src/polish/IdiomPol.gf
Normal file
52
lib/src/polish/IdiomPol.gf
Normal file
@@ -0,0 +1,52 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
-- Adam Slaski, 2009 <adam.slaski@gmail.com>
|
||||
|
||||
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) !<tense, anter, NeutSg, P3>) ++
|
||||
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) !<tense, anter, MascPersSg, P3>) ++
|
||||
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;
|
||||
} ;
|
||||
8
lib/src/polish/LangPol.gf
Normal file
8
lib/src/polish/LangPol.gf
Normal file
@@ -0,0 +1,8 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
-- Adam Slaski, 2009 <adam.slaski@gmail.com>
|
||||
|
||||
concrete LangPol of Lang =
|
||||
GrammarPol,
|
||||
LexiconPol
|
||||
** { flags startcat = Phr ; unlexer = text ; lexer = text; } ;
|
||||
386
lib/src/polish/LexiconPol.gf
Normal file
386
lib/src/polish/LexiconPol.gf
Normal file
@@ -0,0 +1,386 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
-- Ilona Nowak, Wintersemester 2007/08
|
||||
|
||||
-- Adam Slaski, 2009 <adam.slaski@gmail.com>
|
||||
|
||||
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};
|
||||
} ;
|
||||
278
lib/src/polish/MorphoPol.gf
Normal file
278
lib/src/polish/MorphoPol.gf
Normal file
@@ -0,0 +1,278 @@
|
||||
--# -path=.:../prelude:../common:../abstract
|
||||
--# -coding=utf8
|
||||
|
||||
--1 A polish Resource Morphology
|
||||
--
|
||||
-- Ilona Nowak, Wintersemester 2007/08
|
||||
--
|
||||
-- Adam Slaski, 2009 <adam.slaski@gmail.com>
|
||||
--
|
||||
-- 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
|
||||
};
|
||||
|
||||
}
|
||||
3539
lib/src/polish/NounMorphoPol.gf
Normal file
3539
lib/src/polish/NounMorphoPol.gf
Normal file
File diff suppressed because it is too large
Load Diff
214
lib/src/polish/NounPol.gf
Normal file
214
lib/src/polish/NounPol.gf
Normal file
@@ -0,0 +1,214 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
-- Adam Slaski, 2009 <adam.slaski@gmail.com>
|
||||
|
||||
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! <kazdy.a,Nom, facet.g>));
|
||||
voc = (kazdy.s ! VocP ! facet.g) ++ (facet.s ! kazdy.n ! (accom_case! <kazdy.a,VocP,facet.g>));
|
||||
dep = \\cc => let c = extract_case! cc in
|
||||
(kazdy.s ! c ! facet.g) ++ (facet.s ! kazdy.n ! (accom_case! <kazdy.a,c,facet.g>));
|
||||
gn = (accom_gennum !<kazdy.a, facet.g, kazdy.n>);
|
||||
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 !<kazdy.a, (Masc Personal), kazdy.n>);
|
||||
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! <piwo.g, Sg>;
|
||||
p = P3 ;
|
||||
} ;
|
||||
|
||||
UsePron p = {
|
||||
nom = p.nom;
|
||||
voc = p.voc;
|
||||
dep = p.dep;
|
||||
gn = cast_gennum! <case p.g of {
|
||||
PGen x => x;
|
||||
_ => Masc Personal
|
||||
}, p.n>;
|
||||
p = p.p;
|
||||
};
|
||||
|
||||
AdjCN mily facet = {
|
||||
s = \\n,c => (mily.s ! AF (cast_gennum!<facet.g,n>) 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!<g,num.n>) c ++ num.s !c !g;
|
||||
sp = \\c,g => case num.hasCard of {
|
||||
True => q.s ! AF (cast_gennum!<g,num.n>) c ++ num.s !c !g;
|
||||
False => q.sp ! AF (cast_gennum!<g,num.n>) c ++ num.s !c !g
|
||||
};
|
||||
n = num.n;
|
||||
a = num.a
|
||||
};
|
||||
|
||||
DetQuantOrd q num ord = {
|
||||
s,sp = \\c,g => q.s ! AF (cast_gennum!<g,num.n>) c
|
||||
++ num.s !c !g
|
||||
++ ord.s ! AF (cast_gennum!<g,num.n>) (accom_case! <num.a,c,g>);
|
||||
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!<cn.g,n>);
|
||||
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
|
||||
};
|
||||
}
|
||||
549
lib/src/polish/NumeralPol.gf
Normal file
549
lib/src/polish/NumeralPol.gf
Normal file
@@ -0,0 +1,549 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
-- Adam Slaski, 2009 <adam.slaski@gmail.com>
|
||||
|
||||
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!<x,y>; 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";
|
||||
<Gen,NeutGr > => "dwojga";
|
||||
<(Dat|Loc),NeutGr > => "dwojgu";
|
||||
<Instr,NeutGr > => "dwojgiem";
|
||||
<(Nom|VocP),Masc Personal > => "dwóch";
|
||||
<(Nom|VocP|Acc),Fem > => "dwie";
|
||||
(<Gen,_>|<Acc,Masc Personal>) => "dwóch";
|
||||
<(Nom|VocP|Acc),_ > => "dwa";
|
||||
<Dat,_ > => "dwóm";
|
||||
<Instr,Fem > => "dwiema";
|
||||
<Instr,_ > => "dwoma";
|
||||
<Loc,_ > => "dwóch"
|
||||
};
|
||||
teen = table {
|
||||
<(Nom|VocP|Acc),NeutGr > => "dwanaścioro";
|
||||
<Gen,NeutGr > => "dwanaściorga";
|
||||
<(Dat|Loc),NeutGr > => "dwanaściorgu";
|
||||
<Instr,NeutGr > => "dwanaściorgiem";
|
||||
(<(Nom|VocP|Acc),Masc Personal>|
|
||||
<Gen|Dat|Instr|Loc,_>) => "dwunastu";
|
||||
<(Nom|VocP|Acc),_ > => "dwanaście"
|
||||
};
|
||||
ten = table {
|
||||
<(Nom|VocP|Acc),NeutGr > => "dwadzieścioro";
|
||||
<Gen,NeutGr > => "dwadzieściorga";
|
||||
<(Dat|Loc),NeutGr > => "dwadzieściorgu";
|
||||
<Instr,NeutGr > => "dwadzieściorgiem";
|
||||
(<(Nom|VocP|Acc),Masc Personal>|
|
||||
<Gen|Dat|Instr|Loc,_>) => "dwudziestu";
|
||||
<(Nom|VocP|Acc),_ > => "dwadzieścia"
|
||||
};
|
||||
hundred = table {
|
||||
(<(Nom|VocP|Acc),Masc Personal>|
|
||||
<Gen|Dat|Instr|Loc,_>) => "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";
|
||||
<Gen,NeutGr > => "trojga";
|
||||
<Dat,NeutGr > => "trojgu";
|
||||
<Instr,NeutGr > => "trojgiem";
|
||||
<(Nom|VocP),Masc Personal > => "trzech";
|
||||
<(Nom|VocP|Acc),Fem > => "trzy";
|
||||
(<Gen,_>|<Acc,Masc Personal>) => "trzech";
|
||||
<(Nom|VocP|Acc),_ > => "trzy";
|
||||
<Dat,_ > => "trzem";
|
||||
<Instr,Fem > => "trzema";
|
||||
<Instr,_ > => "trzema";
|
||||
<Loc,_ > => "trzech"
|
||||
};
|
||||
teen = table {
|
||||
<(Nom|VocP|Acc),NeutGr > => "trzynaścioro";
|
||||
<Gen,NeutGr > => "trzynaściorga";
|
||||
<(Dat|Loc),NeutGr > => "trzynaściorgu";
|
||||
<Instr,NeutGr > => "trzynaściorgiem";
|
||||
(<(Nom|VocP|Acc),Masc Personal>|
|
||||
<Gen|Dat|Instr|Loc,_>) => "trzynastu";
|
||||
<(Nom|VocP|Acc),_ > => "trzynaście"
|
||||
};
|
||||
ten = table {
|
||||
<(Nom|VocP|Acc),NeutGr > => "trzydzieścioro";
|
||||
<Gen,NeutGr > => "trzydzieściorga";
|
||||
<(Dat|Loc),NeutGr > => "trzydzieściorgu";
|
||||
<Instr,NeutGr > => "trzydzieściorgiem";
|
||||
(<(Nom|VocP|Acc),Masc Personal>|
|
||||
<Gen|Dat|Instr|Loc,_>) => "trzydziestu";
|
||||
<(Nom|VocP|Acc),_ > => "trzydzieści"
|
||||
};
|
||||
hundred = table {
|
||||
(<(Nom|VocP|Acc),Masc Personal>|
|
||||
<Gen|Dat|Instr|Loc,_>) => "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";
|
||||
<Gen,NeutGr > => "czworga";
|
||||
<Dat,NeutGr > => "czworgu";
|
||||
<Instr,NeutGr > => "czworgiem";
|
||||
<(Nom|VocP),Masc Personal > => "czterech";
|
||||
<(Nom|VocP|Acc),Fem > => "cztery";
|
||||
(<Gen,_>|<Acc,Masc Personal>) => "czterch";
|
||||
<(Nom|VocP|Acc),_ > => "cztery";
|
||||
<Dat,_ > => "czterem";
|
||||
<Instr,Fem > => "czterema";
|
||||
<Instr,_ > => "czterma";
|
||||
<Loc,_ > => "czterech"
|
||||
};
|
||||
teen = table {
|
||||
<(Nom|VocP|Acc),NeutGr > => "czternaścioro";
|
||||
<Gen,NeutGr > => "czternaściorga";
|
||||
<(Dat|Loc),NeutGr > => "czternaściorgu";
|
||||
<Instr,NeutGr > => "czternaściorgiem";
|
||||
(<(Nom|VocP|Acc),Masc Personal>|
|
||||
<Gen|Dat|Instr|Loc,_>) => "czternastu";
|
||||
<(Nom|VocP|Acc),_ > => "czternaście"
|
||||
};
|
||||
ten = table {
|
||||
<(Nom|VocP|Acc),NeutGr > => "czterdzieścioro";
|
||||
<Gen,NeutGr > => "czterdzieściorga";
|
||||
<(Dat|Loc),NeutGr > => "czterdzieściorgu";
|
||||
<Instr,NeutGr > => "czterdzieściorgiem";
|
||||
(<(Nom|VocP|Acc),Masc Personal>|
|
||||
<Gen|Dat|Instr|Loc,_>) => "czterdziestu";
|
||||
<(Nom|VocP|Acc),_ > => "czterdzieści"
|
||||
};
|
||||
hundred = table {
|
||||
(<(Nom|VocP|Acc),Masc Personal>|
|
||||
<Gen|Dat|Instr|Loc,_>) => "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";
|
||||
<Gen,NeutGr > => "pięciorga";
|
||||
<Dat,NeutGr > => "pięciorgu";
|
||||
<Instr,NeutGr > => "pięciorgiem";
|
||||
<(Nom|VocP),Masc Personal > => "pięciu";
|
||||
(<Gen,_>|<Acc,Masc Personal>) => "pięciu";
|
||||
<(Nom|VocP|Acc),_ > => "pięć";
|
||||
<Dat,_ > => "pięciu";
|
||||
<Instr,_ > => "pięcioma";
|
||||
<Loc,_ > => "pięciu"
|
||||
};
|
||||
teen = table {
|
||||
<(Nom|VocP|Acc),NeutGr > => "piętnaścioro";
|
||||
<Gen,NeutGr > => "piętnaściorga";
|
||||
<(Dat|Loc),NeutGr > => "piętnaściorgu";
|
||||
<Instr,NeutGr > => "piętnaściorgiem";
|
||||
(<(Nom|VocP|Acc),Masc Personal>|
|
||||
<Gen|Dat|Instr|Loc,_>) => "piętnastu";
|
||||
<(Nom|VocP|Acc),_ > => "piętnaście"
|
||||
};
|
||||
ten = table {
|
||||
<(Nom|VocP|Acc),NeutGr > => "pięćdzieścioro";
|
||||
<Gen,NeutGr > => "pięćdzieściorga";
|
||||
<(Dat|Loc),NeutGr > => "pięćdzieściorgu";
|
||||
<Instr,NeutGr > => "pięćdzieściorgiem";
|
||||
(<(Nom|VocP|Acc),Masc Personal>|
|
||||
<Gen|Dat|Instr|Loc,_>) => "pięćdziesięciu";
|
||||
<(Nom|VocP|Acc),_ > => "pięćdziesiąt"
|
||||
};
|
||||
hundred = table {
|
||||
(<(Nom|VocP|Acc),Masc Personal>|
|
||||
<Gen|Dat|Instr|Loc,_>) => "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";
|
||||
<Gen,NeutGr > => "sześciorga";
|
||||
<Dat,NeutGr > => "sześciorgu";
|
||||
<Instr,NeutGr > => "sześciorgiem";
|
||||
<(Nom|VocP),Masc Personal > => "sześciu";
|
||||
(<Gen,_>|<Acc,Masc Personal>) => "sześciu";
|
||||
<(Nom|VocP|Acc),_ > => "sześć";
|
||||
<Dat,_ > => "sześciu";
|
||||
<Instr,_ > => "sześcioma";
|
||||
<Loc,_ > => "sześciu"
|
||||
};
|
||||
teen = table {
|
||||
<(Nom|VocP|Acc),NeutGr > => "szesnaścioro";
|
||||
<Gen,NeutGr > => "szesnaściorga";
|
||||
<(Dat|Loc),NeutGr > => "szesnaściorgu";
|
||||
<Instr,NeutGr > => "szesnaściorgiem";
|
||||
(<(Nom|VocP|Acc),Masc Personal>|
|
||||
<Gen|Dat|Instr|Loc,_>) => "szesnastu";
|
||||
<(Nom|VocP|Acc),_ > => "szesnaście"
|
||||
};
|
||||
ten = table {
|
||||
<(Nom|VocP|Acc),NeutGr > => "sześćdzieścioro";
|
||||
<Gen,NeutGr > => "sześćdzieściorga";
|
||||
<(Dat|Loc),NeutGr > => "sześćdzieściorgu";
|
||||
<Instr,NeutGr > => "sześćdzieściorgiem";
|
||||
(<(Nom|VocP|Acc),Masc Personal>|
|
||||
<Gen|Dat|Instr|Loc,_>) => "sześćdziesięciu";
|
||||
<(Nom|VocP|Acc),_ > => "sześćdziesiąt"
|
||||
};
|
||||
hundred = table {
|
||||
(<(Nom|VocP|Acc),Masc Personal>|
|
||||
<Gen|Dat|Instr|Loc,_>) => "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";
|
||||
<Gen,NeutGr > => "siedmiorga";
|
||||
<Dat,NeutGr > => "siedmiorgu";
|
||||
<Instr,NeutGr > => "siedmiorgiem";
|
||||
<(Nom|VocP),Masc Personal > => "siedmiu";
|
||||
(<Gen,_>|<Acc,Masc Personal>) => "siedmiu";
|
||||
<(Nom|VocP|Acc),_ > => "siedem";
|
||||
<Dat,_ > => "siedmiu";
|
||||
<Instr,_ > => "siedmioma";
|
||||
<Loc,_ > => "siedmiu"
|
||||
};
|
||||
teen = table {
|
||||
<(Nom|VocP|Acc),NeutGr > => "siedemnaścioro";
|
||||
<Gen,NeutGr > => "siedemnaściorga";
|
||||
<(Dat|Loc),NeutGr > => "siedemnaściorgu";
|
||||
<Instr,NeutGr > => "siedemnaściorgiem";
|
||||
(<(Nom|VocP|Acc),Masc Personal>|
|
||||
<Gen|Dat|Instr|Loc,_>) => "siedemnastu";
|
||||
<(Nom|VocP|Acc),_ > => "siedemnaście"
|
||||
};
|
||||
ten = table {
|
||||
<(Nom|VocP|Acc),NeutGr > => "siedemdzieścioro";
|
||||
<Gen,NeutGr > => "siedemdzieściorga";
|
||||
<(Dat|Loc),NeutGr > => "siedemdzieściorgu";
|
||||
<Instr,NeutGr > => "siedemdzieściorgiem";
|
||||
(<(Nom|VocP|Acc),Masc Personal>|
|
||||
<Gen|Dat|Instr|Loc,_>) => "siedemdziesięciu";
|
||||
<(Nom|VocP|Acc),_ > => "siedemdziesiąt"
|
||||
};
|
||||
hundred = table {
|
||||
(<(Nom|VocP|Acc),Masc Personal>|
|
||||
<Gen|Dat|Instr|Loc,_>) => "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";
|
||||
<Gen,NeutGr > => "ośmiorga";
|
||||
<Dat,NeutGr > => "ośmiorgu";
|
||||
<Instr,NeutGr > => "ośmiorgiem";
|
||||
<(Nom|VocP),Masc Personal > => "ośmiu";
|
||||
(<Gen,_>|<Acc,Masc Personal>) => "ośmiu";
|
||||
<(Nom|VocP|Acc),_ > => "osiemm";
|
||||
<Dat,_ > => "ośmiu";
|
||||
<Instr,_ > => "ośmioma";
|
||||
<Loc,_ > => "ośmiu"
|
||||
};
|
||||
teen = table {
|
||||
<(Nom|VocP|Acc),NeutGr > => "osiemnaścioro";
|
||||
<Gen,NeutGr > => "osiemnaściorga";
|
||||
<(Dat|Loc),NeutGr > => "osiemnaściorgu";
|
||||
<Instr,NeutGr > => "osiemnaściorgiem";
|
||||
(<(Nom|VocP|Acc),Masc Personal>|
|
||||
<Gen|Dat|Instr|Loc,_>) => "osiemnastu";
|
||||
<(Nom|VocP|Acc),_ > => "osiemnaście"
|
||||
};
|
||||
ten = table {
|
||||
<(Nom|VocP|Acc),NeutGr > => "osiemdzieścioro";
|
||||
<Gen,NeutGr > => "osiemdzieściorga";
|
||||
<(Dat|Loc),NeutGr > => "osiemdzieściorgu";
|
||||
<Instr,NeutGr > => "osiemdzieściorgiem";
|
||||
(<(Nom|VocP|Acc),Masc Personal>|
|
||||
<Gen|Dat|Instr|Loc,_>) => "osiemdziesięciu";
|
||||
<(Nom|VocP|Acc),_ > => "osiemdziesiąt"
|
||||
};
|
||||
hundred = table {
|
||||
(<(Nom|VocP|Acc),Masc Personal>|
|
||||
<Gen|Dat|Instr|Loc,_>) => "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";
|
||||
<Gen,NeutGr > => "dziewięciorga";
|
||||
<Dat,NeutGr > => "dziewięciorgu";
|
||||
<Instr,NeutGr > => "dziewięciorgiem";
|
||||
<(Nom|VocP),Masc Personal > => "dziewięciu";
|
||||
(<Gen,_>|<Acc,Masc Personal>) => "dziewięciu";
|
||||
<(Nom|VocP|Acc),_ > => "dziewięć";
|
||||
<Dat,_ > => "dziewięciu";
|
||||
<Instr,_ > => "dziewięcioma";
|
||||
<Loc,_ > => "dziewięciu"
|
||||
};
|
||||
teen = table {
|
||||
<(Nom|VocP|Acc),NeutGr > => "dziewiętnaścioro";
|
||||
<Gen,NeutGr > => "dziewiętnaściorga";
|
||||
<(Dat|Loc),NeutGr > => "dziewiętnaściorgu";
|
||||
<Instr,NeutGr > => "dziewiętnaściorgiem";
|
||||
(<(Nom|VocP|Acc),Masc Personal>|
|
||||
<Gen|Dat|Instr|Loc,_>) => "dziewiętnastu";
|
||||
<(Nom|VocP|Acc),_ > => "dziewiętnaście"
|
||||
};
|
||||
ten = table {
|
||||
<(Nom|VocP|Acc),NeutGr > => "dziewięćdzieścioro";
|
||||
<Gen,NeutGr > => "dziewięćdzieściorga";
|
||||
<(Dat|Loc),NeutGr > => "dziewięćdzieściorgu";
|
||||
<Instr,NeutGr > => "dziewięćdzieściorgiem";
|
||||
(<(Nom|VocP|Acc),Masc Personal>|
|
||||
<Gen|Dat|Instr|Loc,_>) => "dziewięćdziesięciu";
|
||||
<(Nom|VocP|Acc),_ > => "dziewięćdziesiąt"
|
||||
};
|
||||
hundred = table {
|
||||
(<(Nom|VocP|Acc),Masc Personal>|
|
||||
<Gen|Dat|Instr|Loc,_>) => "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 _>|<Acc,Masc Inanimate>) => "jeden";
|
||||
<(Nom|Acc|VocP),Neut|NeutGr> => "jedno";
|
||||
<(Nom|VocP),Fem> => "jedna";
|
||||
<(Gen|Dat|Loc),Fem> => "jednej";
|
||||
<(Acc|Instr),Fem> => "jedną";
|
||||
(<Gen,_>|<Acc,Masc (Personal|Animate)>) => "jednego";
|
||||
<Dat,_> => "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";
|
||||
<Gen,NeutGr > => "dziesięciorga";
|
||||
<(Dat|Loc),NeutGr > => "dziesięciorgu";
|
||||
<Instr,NeutGr > => "dziesięciorgiem";
|
||||
(<(Nom|VocP|Acc),Masc Personal>|
|
||||
<Gen|Dat|Instr|Loc,_>) => "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";
|
||||
<Gen,NeutGr > => "jedenaściorga";
|
||||
<(Dat|Loc),NeutGr > => "jedenaściorgu";
|
||||
<Instr,NeutGr > => "jedenaściorgiem";
|
||||
(<(Nom|VocP|Acc),Masc Personal>|
|
||||
<Gen|Dat|Instr|Loc,_>) => "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!<Nom, Masc Inanimate> ++ 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!<x.p1,Masc Inanimate> }
|
||||
++ tysiac!<(accom_case! <s.a,x.p1, Masc Inanimate>),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!<x.p1,Masc Inanimate> }
|
||||
++ tysiac!<(accom_case! <s.a,x.p1, Masc Inanimate>),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!<Nom,Masc Inanimate> } -- tysiąc dwieście dziewięćdziesiąty pierwszy
|
||||
++ tysiac!<(accom_case! <s.a,Nom, Masc Inanimate>),s.n>
|
||||
++ s2.o!x;
|
||||
a = case s2.n of { Sg => TysiacA; _=> s2.a } ;
|
||||
n = Pl
|
||||
};
|
||||
|
||||
oper tysiac = table {
|
||||
<(Nom|Acc), Sg> => "tysiąc";
|
||||
<Gen, Sg> => "tysiąca";
|
||||
<Dat, Sg> => "tysiącowi";
|
||||
<Instr, Sg> => "tysiącem";
|
||||
<(Loc|VocP),Sg> => "tysiącu";
|
||||
<(Nom|Acc|VocP), Pl> => "tysiące";
|
||||
<Gen, Pl> => "tysięcy";
|
||||
<Dat, Pl> => "tysiącom";
|
||||
<Instr, Pl> => "tysiącami";
|
||||
<Loc, Pl> => "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 };
|
||||
|
||||
}
|
||||
1
lib/src/polish/OverloadPol.gf
Normal file
1
lib/src/polish/OverloadPol.gf
Normal file
@@ -0,0 +1 @@
|
||||
resource OverloadPol = Overload with (Grammar = GrammarPol) ;
|
||||
624
lib/src/polish/ParadigmsPol.gf
Normal file
624
lib/src/polish/ParadigmsPol.gf
Normal file
@@ -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;
|
||||
|
||||
};
|
||||
32
lib/src/polish/PhrasePol.gf
Normal file
32
lib/src/polish/PhrasePol.gf
Normal file
@@ -0,0 +1,32 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
-- Adam Slaski, 2009 <adam.slaski@gmail.com>
|
||||
|
||||
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} ;
|
||||
|
||||
}
|
||||
673
lib/src/polish/PronounMorphoPol.gf
Normal file
673
lib/src/polish/PronounMorphoPol.gf
Normal file
@@ -0,0 +1,673 @@
|
||||
--# -path=.:../../prelude:../common
|
||||
--# -coding=utf8
|
||||
|
||||
--1 A polish Resource Morphology
|
||||
--
|
||||
-- Ilona Nowak, Wintersemester 2007/08
|
||||
--
|
||||
-- Adam Slaski, 2009 <adam.slaski@gmail.com>
|
||||
--
|
||||
|
||||
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)}
|
||||
-- }};
|
||||
-}
|
||||
}
|
||||
78
lib/src/polish/QuestionPol.gf
Normal file
78
lib/src/polish/QuestionPol.gf
Normal file
@@ -0,0 +1,78 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
-- Adam Slaski, 2009 <adam.slaski@gmail.com>
|
||||
|
||||
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) !<tense, anter, ip.gn, ip.p>) ++
|
||||
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 !<t,a,np.gn,np.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! <idet.a,Nom, cn.g>);
|
||||
voc = idet.s !VocP !cn.g ++ cn.s !idet.n !(accom_case! <idet.a,Nom, cn.g>);
|
||||
dep = \\cc => let c = extract_case! cc in
|
||||
idet.s !c !cn.g ++ cn.s !idet.n ! (accom_case! <idet.a, c, cn.g>);
|
||||
gn = (accom_gennum !<idet.a, cn.g, idet.n>);
|
||||
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! <Masc Personal, idet.n>;
|
||||
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! <g,n.n>) 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 };
|
||||
|
||||
}
|
||||
60
lib/src/polish/RelativePol.gf
Normal file
60
lib/src/polish/RelativePol.gf
Normal file
@@ -0,0 +1,60 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
-- Adam Slaski, 2009 <adam.slaski@gmail.com>
|
||||
|
||||
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) !<tense, anter, gn, P3>) ++
|
||||
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) !<tense, anter, x, P3>) ++
|
||||
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!<pol,clslash.c.c>)) ++ 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
|
||||
};
|
||||
|
||||
}
|
||||
371
lib/src/polish/ResPol.gf
Normal file
371
lib/src/polish/ResPol.gf
Normal file
@@ -0,0 +1,371 @@
|
||||
--# -path=.:../abstract:../common:../../prelude
|
||||
--# -coding=utf8
|
||||
|
||||
-- Ilona Nowak Wintersemester 2007/08
|
||||
|
||||
-- Adam Slaski, 2009 <adam.slaski@gmail.com>
|
||||
|
||||
-- 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 {
|
||||
<Masc Personal,Sg> => MascPersSg;
|
||||
<Masc Animate,Sg> => MascAniSg;
|
||||
<Masc _,Sg> => MascInaniSg;
|
||||
<Fem, Sg> => FemSg;
|
||||
<Neut, Sg> => NeutSg;
|
||||
<NeutGr, Sg> => NeutSg;
|
||||
<Masc Personal, Pl> => MascPersPl;
|
||||
_ => OthersPl
|
||||
};
|
||||
|
||||
extract_num = table { (MascPersSg|MascAniSg|MascInaniSg|FemSg|NeutSg) => Sg; _ => Pl } ;
|
||||
|
||||
-- dopelniacz negacji
|
||||
npcase : Polarity * ComplCase => ComplCase =
|
||||
table {
|
||||
<Neg, AccNoPrep> => 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 {
|
||||
<DwaA, Nom, Masc Personal> => Gen;
|
||||
<DwaA, _, NeutGr> => Gen;
|
||||
<PiecA, Nom, Masc Personal> => Gen;
|
||||
<PiecA, _, NeutGr> => Gen;
|
||||
<PiecA, Nom|Acc, Masc (Animate|Inanimate)|Neut|Fem> => Gen;
|
||||
<StoA, Nom, Masc Personal> => Gen;
|
||||
<StoA, Nom|Acc, Masc (Animate|Inanimate)|Neut|Fem> => Gen;
|
||||
<TysiacA, _, _> => Gen;
|
||||
x => x.p2
|
||||
};
|
||||
|
||||
accom_gennum : Accom * Gender * Number => GenNum =
|
||||
table {
|
||||
<DwaA, Masc Personal | NeutGr, _> => NeutSg;
|
||||
<PiecA, _, _> => NeutSg;
|
||||
<StoA, _, _> => NeutSg;
|
||||
<TysiacA, _, _> => NeutSg;
|
||||
<_, g, n> => cast_gennum!<g,n>
|
||||
};
|
||||
|
||||
|
||||
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]"]
|
||||
};
|
||||
|
||||
} ;
|
||||
104
lib/src/polish/SentencePol.gf
Normal file
104
lib/src/polish/SentencePol.gf
Normal file
@@ -0,0 +1,104 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
-- Adam Slaski, 2009 <adam.slaski@gmail.com>
|
||||
|
||||
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) !<tense, anter, np.gn, np.p>) ++
|
||||
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) !<tense, anter, np.gn, np.p>) ++
|
||||
vps.sufix !pol !np.gn ++ vps.postfix !pol !np.gn;
|
||||
False =>
|
||||
vps.prefix !pol !np.gn ++
|
||||
((indicative_form vps.verb vps.imienne pol) !<tense, anter, np.gn, np.p>) ++
|
||||
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) !<tense, anter, np.gn, np.p>) ++
|
||||
[", ż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!<Masc Personal, num>) 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) !<tense, anter, NeutSg, P3>) ++
|
||||
vp.sufix !pol !NeutSg ++ vp.postfix !pol !NeutSg;
|
||||
};
|
||||
}
|
||||
121
lib/src/polish/StructuralPol.gf
Normal file
121
lib/src/polish/StructuralPol.gf
Normal file
@@ -0,0 +1,121 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
-- Ilona Nowak Wintersemester 2007/08
|
||||
|
||||
-- Adam Slaski, 2009 <adam.slaski@gmail.com>
|
||||
|
||||
-- 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"} ;
|
||||
|
||||
};
|
||||
9
lib/src/polish/TextPol.gf
Normal file
9
lib/src/polish/TextPol.gf
Normal file
@@ -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} ;
|
||||
|
||||
}
|
||||
515
lib/src/polish/VerbMorphoPol.gf
Normal file
515
lib/src/polish/VerbMorphoPol.gf
Normal file
@@ -0,0 +1,515 @@
|
||||
--# -path=.:../prelude:../common:../abstract
|
||||
--# -coding=utf8
|
||||
|
||||
-- A Polish verb Resource Morphology
|
||||
--
|
||||
-- Adam Slaski, 2009 <adam.slaski@gmail.com>
|
||||
--
|
||||
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 <n,p> of {
|
||||
<Sg, P1> => "bym";
|
||||
<Sg, P2> => "byś";
|
||||
<Sg, P3> => "by";
|
||||
<Pl, P1> => "byśmy";
|
||||
<Pl, P2> => "byście";
|
||||
<Pl, P3> => "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 {
|
||||
<Pres, Simul, gn, p> => nie ++ imperf ! (VFinM (extract_num!gn) p) ++ sie ;
|
||||
<Pres, Anter, gn, p> => nie ++ perf ! (VPraetM gn p) ++ sie ;
|
||||
<Past, _, gn, p> => nie ++ perf ! (VPraetM gn p) ++ sie ;
|
||||
<Fut, Simul, gn, p> => nie ++ bedzie ! <(extract_num!gn), p> ++ sie ++ imperf ! (VPraetM gn P3);
|
||||
<Fut, Anter, gn, p> => nie ++ perf ! (VFinM (extract_num!gn) p) ++ sie;
|
||||
<Cond, Simul, gn, p> => nie ++ imperf ! (VCondM gn p) ++ sie;
|
||||
<Cond, Anter, gn, p> => 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 {
|
||||
<Pres, Simul, gn, p> => nie ++ byc ! (VFinM (extract_num!gn) p) ++ verb.ppart ! AF gn Nom;
|
||||
<Pres, Anter, gn, p> => nie ++ zostac ! (VPraetM gn p) ++ verb.ppart ! AF gn Nom;
|
||||
<Past, Simul, gn, p> => nie ++ byc ! (VPraetM gn p) ++ verb.ppart ! AF gn Nom;
|
||||
<Past, Anter, gn, p> => nie ++ zostac ! (VPraetM gn p) ++ verb.ppart ! AF gn Nom;
|
||||
<Fut, Simul, gn, p> => nie ++ case verb.asp of {
|
||||
Perfective => zostac ! (VFinM (extract_num!gn) p);
|
||||
_ => bedzie ! <extract_num!gn, p>
|
||||
} ++ verb.ppart ! AF gn Nom;
|
||||
<Fut, Anter, gn, p> => nie ++ zostac ! (VFinM (extract_num!gn) p) ++ verb.ppart ! AF gn Nom;
|
||||
<Cond, Simul, gn, p> => nie ++ byc ! (VCondM gn p) ++ verb.ppart ! AF gn Nom;
|
||||
<Cond, Anter, gn, p> => nie ++ zostac ! (VCondM gn p) ++ verb.ppart ! AF gn Nom
|
||||
};
|
||||
|
||||
bedzie : Number * Person => Str = table {
|
||||
<Sg, P1> => "będę";
|
||||
<Sg, P2> => "będziesz";
|
||||
<Sg, P3> => "będzie";
|
||||
<Pl, P1> => "będziemy";
|
||||
<Pl, P2> => "będziecie";
|
||||
<Pl, P3> => "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 {
|
||||
<Sg, P1> => "niech" ++ sie ++ verb.sp ! VFinM Sg P1;
|
||||
<Sg, P2> => verb.sp ! VImperSg2M ++ sie;
|
||||
<Sg, P3> => "niech" ++ sie ++ verb.sp ! VFinM Sg P3;
|
||||
<Pl, P1> => verb.sp ! VImperPl1M ++ sie;
|
||||
<Pl, P2> => verb.sp ! VImperPl2M ++ sie;
|
||||
<Pl, P3> => "niech" ++ sie ++ verb.sp ! VFinM Pl P3
|
||||
} ;
|
||||
Neg => case <(extract_num!gn), p> of {
|
||||
<Sg, P1> => "niech" ++ sie ++ "nie" ++ verb.si ! VFinM Sg P1;
|
||||
<Sg, P2> => "nie" ++ verb.si ! VImperSg2M ++ sie;
|
||||
<Sg, P3> => "niech" ++ sie ++ "nie" ++ verb.si ! VFinM Sg P3;
|
||||
<Pl, P1> => "nie" ++ verb.si ! VImperPl1M ++ sie;
|
||||
<Pl, P2> => "nie" ++ verb.si ! VImperPl2M ++ sie;
|
||||
<Pl, P3> => "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 {
|
||||
<Sg, P1> => ["niech będę"];
|
||||
<Sg, P2> => ["bądź"];
|
||||
<Sg, P3> => ["niech będzie"];
|
||||
<Pl, P1> => ["bądźmy"];
|
||||
<Pl, P2> => ["bądźcie"];
|
||||
<Pl, P3> => ["niech będą"]
|
||||
};
|
||||
|
||||
zostan_op : Number * Person => Str = table {
|
||||
<Sg, P1> => ["niech zostanę"];
|
||||
<Sg, P2> => ["zostań"];
|
||||
<Sg, P3> => ["niech zostanie"];
|
||||
<Pl, P1> => ["zostańmy"];
|
||||
<Pl, P2> => ["zostańcie"];
|
||||
<Pl, P3> => ["niech zostaną"]
|
||||
};
|
||||
|
||||
}
|
||||
160
lib/src/polish/VerbPol.gf
Normal file
160
lib/src/polish/VerbPol.gf
Normal file
@@ -0,0 +1,160 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
-- Adam Slaski, 2009 <adam.slaski@gmail.com>
|
||||
|
||||
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 !<p,v3.c.c>) ))
|
||||
** {c=v3.c2};
|
||||
|
||||
Slash3V3 v3 np = (setSufix (defVP (castv3 v3))
|
||||
(\\p,gn =>
|
||||
v3.c2.s ++ np.dep ! (npcase !<p,v3.c.c>) ))
|
||||
** {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 !<p,vps.c.c>));
|
||||
|
||||
-- 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 !<p,v.c.c>) ++ 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
|
||||
};
|
||||
|
||||
} ;
|
||||
|
||||
Reference in New Issue
Block a user