mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 08:58:55 -06:00
simplify the code and allow for non-standard pronouns
This commit is contained in:
@@ -2,5 +2,5 @@
|
|||||||
|
|
||||||
concrete AllPol of AllPolAbs =
|
concrete AllPol of AllPolAbs =
|
||||||
LangPol,
|
LangPol,
|
||||||
ExtraPol
|
ExtendPol
|
||||||
** {} ;
|
** {} ;
|
||||||
|
|||||||
@@ -54,11 +54,8 @@ concrete CatPol of Cat = CommonX - [CAdv] ** open ResPol, Prelude, (R = ParamX)
|
|||||||
|
|
||||||
CN = { s : Number => Case => Str; g : Gender };
|
CN = { s : Number => Case => Str; g : Gender };
|
||||||
|
|
||||||
-- NounPhrase : Type = { s : PronForm => Str; n : Number; g: Gender; p : Person };
|
|
||||||
NP = NounPhrase;
|
NP = NounPhrase;
|
||||||
|
|
||||||
-- oper Pron = { s : PronForm => Str ; sp: AForm => Str ; n : Number ; p : Person ;
|
|
||||||
-- g: PronGen } ;
|
|
||||||
Pron = ResPol.Pron;
|
Pron = ResPol.Pron;
|
||||||
|
|
||||||
Det = Determiner;
|
Det = Determiner;
|
||||||
|
|||||||
24
src/polish/ExtendPol.gf
Normal file
24
src/polish/ExtendPol.gf
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
--# -path=.:../common:../abstract
|
||||||
|
|
||||||
|
concrete ExtendPol of Extend =
|
||||||
|
CatPol ** ExtendFunctor - [
|
||||||
|
iFem_Pron, youFem_Pron, theyFem_Pron, ProDrop
|
||||||
|
]
|
||||||
|
with
|
||||||
|
(Grammar = GrammarPol) **
|
||||||
|
open PronounMorphoPol in {
|
||||||
|
|
||||||
|
lin iFem_Pron = pronJa FemSg ;
|
||||||
|
lin youFem_Pron = pronTy FemSg ;
|
||||||
|
lin theyFem_Pron = pronOneFem ;
|
||||||
|
|
||||||
|
lin ProDrop p = {
|
||||||
|
nom = [] ;
|
||||||
|
voc = p.voc ;
|
||||||
|
dep = p.dep ;
|
||||||
|
sp = p.sp ;
|
||||||
|
p = p.p ;
|
||||||
|
gn = p.gn ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -7,13 +7,4 @@ concrete ExtraPol of ExtraPolAbs = CatPol ** open ResPol in {
|
|||||||
g = cn.g
|
g = cn.g
|
||||||
};
|
};
|
||||||
|
|
||||||
ProDrop p = {
|
|
||||||
nom = [] ;
|
|
||||||
voc = p.voc ;
|
|
||||||
dep = p.dep ;
|
|
||||||
sp = p.sp ;
|
|
||||||
n = p.n ;
|
|
||||||
p = p.p ;
|
|
||||||
g = p.g ;
|
|
||||||
} ;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,18 +41,9 @@ concrete NounPol of Noun = CatPol ** open ResPol, Prelude, PronounMorphoPol, Mor
|
|||||||
gn = cast_gennum! <piwo.g, Sg>;
|
gn = cast_gennum! <piwo.g, Sg>;
|
||||||
p = P3 ;
|
p = P3 ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
UsePron p = {
|
UsePron p = 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 = {
|
AdjCN mily facet = {
|
||||||
s = \\n,c => case mily.isPost of {
|
s = \\n,c => case mily.isPost of {
|
||||||
True => (facet.s ! n ! c) ++ (mily.s ! AF (cast_gennum!<facet.g,n>) c) ;
|
True => (facet.s ! n ! c) ++ (mily.s ! AF (cast_gennum!<facet.g,n>) c) ;
|
||||||
@@ -77,8 +68,8 @@ concrete NounPol of Noun = CatPol ** open ResPol, Prelude, PronounMorphoPol, Mor
|
|||||||
};
|
};
|
||||||
|
|
||||||
-- surface structures of NP formed with MassNP, DefArt and IndefArt are identical
|
-- surface structures of NP formed with MassNP, DefArt and IndefArt are identical
|
||||||
DefArt = {s = \\_=>[] ; sp = (demPronTen "ten").sp ; c=Nom; g = PNoGen };
|
DefArt = {s = \\_=>[] ; sp = (demPronTen "ten").sp };
|
||||||
IndefArt = {s = \\_=>[] ; sp = jaki ; c=Nom; g = PNoGen };
|
IndefArt = {s = \\_=>[] ; sp = jaki };
|
||||||
|
|
||||||
UseN sb = {
|
UseN sb = {
|
||||||
s = \\n,c => sb.s ! SF n c;
|
s = \\n,c => sb.s ! SF n c;
|
||||||
|
|||||||
@@ -19,8 +19,7 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
|
|||||||
--4.2 Personal pronouns and their possessive forms
|
--4.2 Personal pronouns and their possessive forms
|
||||||
|
|
||||||
-- for "I", "my", "mine"
|
-- for "I", "my", "mine"
|
||||||
oper pronJa: Pron = pronJaFoo PNoGen;
|
oper pronJa: GenNum -> Pron = \gn ->
|
||||||
oper pronJaFoo: PronGen -> Pron = \gender ->
|
|
||||||
{ nom = "ja";
|
{ nom = "ja";
|
||||||
voc = "ja";
|
voc = "ja";
|
||||||
dep = table {
|
dep = table {
|
||||||
@@ -68,15 +67,13 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
|
|||||||
AF MascPersPl VocP => "moi";
|
AF MascPersPl VocP => "moi";
|
||||||
AF (MascPersPl|OthersPl) VocP=> "moje"
|
AF (MascPersPl|OthersPl) VocP=> "moje"
|
||||||
};
|
};
|
||||||
n = Sg;
|
p = P1 ;
|
||||||
p = P1 ;
|
gn = gn
|
||||||
g = gender
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
-- for "you", "yours"
|
-- for "you", "yours"
|
||||||
oper pronTy: Pron = pronTyFoo PNoGen;
|
oper pronTy: GenNum -> Pron = \gn ->
|
||||||
oper pronTyFoo: PronGen -> Pron = \gender ->
|
|
||||||
{ sp = table {
|
{ sp = table {
|
||||||
AF (MascPersSg|MascAniSg|MascInaniSg) Nom => "twój";
|
AF (MascPersSg|MascAniSg|MascInaniSg) Nom => "twój";
|
||||||
AF (MascPersSg|MascAniSg|MascInaniSg) Gen => "twojego";
|
AF (MascPersSg|MascAniSg|MascInaniSg) Gen => "twojego";
|
||||||
@@ -126,9 +123,8 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
|
|||||||
InstrC => "tobą";
|
InstrC => "tobą";
|
||||||
LocPrep => "tobie"
|
LocPrep => "tobie"
|
||||||
};
|
};
|
||||||
n = Sg;
|
p = P2 ;
|
||||||
p = P2 ;
|
gn = gn
|
||||||
g = gender
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -147,9 +143,8 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
|
|||||||
LocPrep => "panu"
|
LocPrep => "panu"
|
||||||
};
|
};
|
||||||
sp = \\_ => "pana";
|
sp = \\_ => "pana";
|
||||||
n = Sg;
|
|
||||||
p = P3 ;
|
p = P3 ;
|
||||||
g = PGen (Masc Personal)
|
gn = MascPersSg
|
||||||
};
|
};
|
||||||
|
|
||||||
-- for "you polite" (very idiomatic: pron you = 'madam') female version
|
-- for "you polite" (very idiomatic: pron you = 'madam') female version
|
||||||
@@ -167,9 +162,8 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
|
|||||||
LocPrep => "pani"
|
LocPrep => "pani"
|
||||||
};
|
};
|
||||||
sp = \\_ => "pani";
|
sp = \\_ => "pani";
|
||||||
n = Sg;
|
p = P3 ;
|
||||||
p = P3 ;
|
gn = FemSg
|
||||||
g = PGen (Fem)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
-- for "he", "his"
|
-- for "he", "his"
|
||||||
@@ -187,9 +181,8 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
|
|||||||
LocPrep => "nim"
|
LocPrep => "nim"
|
||||||
};
|
};
|
||||||
sp = \\_ => "jego";
|
sp = \\_ => "jego";
|
||||||
n = Sg;
|
p = P3 ;
|
||||||
p = P3 ;
|
gn = MascPersSg
|
||||||
g = PGen (Masc Personal)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -208,16 +201,12 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
|
|||||||
LocPrep => "niej"
|
LocPrep => "niej"
|
||||||
};
|
};
|
||||||
sp = \\_ => "jej";
|
sp = \\_ => "jej";
|
||||||
n = Sg;
|
p = P3 ;
|
||||||
p = P3 ;
|
gn = FemSg
|
||||||
g = PGen Fem;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- A loose translation of "its" (reflexive)
|
-- A loose translation of "its" (reflexive)
|
||||||
oper pronRefl: Pron = pronReflFoo PNoGen;
|
oper pronRefl: GenNum -> Pron = \gn ->
|
||||||
oper pronReflFoo: PronGen -> Pron = \gender ->
|
|
||||||
{ sp = table {
|
{ sp = table {
|
||||||
AF (MascPersSg|MascAniSg|MascInaniSg) Nom => "swój";
|
AF (MascPersSg|MascAniSg|MascInaniSg) Nom => "swój";
|
||||||
AF (MascPersSg|MascAniSg|MascInaniSg) Gen => "swojego";
|
AF (MascPersSg|MascAniSg|MascInaniSg) Gen => "swojego";
|
||||||
@@ -267,9 +256,8 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
|
|||||||
InstrC => "sobą";
|
InstrC => "sobą";
|
||||||
LocPrep => "sobie"
|
LocPrep => "sobie"
|
||||||
};
|
};
|
||||||
n = Sg;
|
p = P2 ;
|
||||||
p = P2 ;
|
gn = gn
|
||||||
g = gender
|
|
||||||
};
|
};
|
||||||
|
|
||||||
-- for "it", "its"
|
-- for "it", "its"
|
||||||
@@ -277,9 +265,9 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
|
|||||||
{ nom = "ono" ;
|
{ nom = "ono" ;
|
||||||
voc = "ono" ;
|
voc = "ono" ;
|
||||||
dep= table {
|
dep= table {
|
||||||
GenNoPrep => "jego"; --"go"};
|
GenNoPrep => "jego"; --"go";
|
||||||
GenPrep => "niego";
|
GenPrep => "niego";
|
||||||
DatNoPrep => "jemu"; --"mu"};
|
DatNoPrep => "jemu"; --"mu";
|
||||||
DatPrep => "niemu";
|
DatPrep => "niemu";
|
||||||
AccNoPrep => "je";
|
AccNoPrep => "je";
|
||||||
AccPrep => "nie";
|
AccPrep => "nie";
|
||||||
@@ -287,9 +275,8 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
|
|||||||
LocPrep => "nim"
|
LocPrep => "nim"
|
||||||
};
|
};
|
||||||
sp = \\_ => "jej";
|
sp = \\_ => "jej";
|
||||||
n = Sg;
|
|
||||||
p = P3 ;
|
p = P3 ;
|
||||||
g = PGen Neut
|
gn = NeutSg
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -341,9 +328,8 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
|
|||||||
AF MascPersPl VocP => "nasi";
|
AF MascPersPl VocP => "nasi";
|
||||||
AF (MascPersPl|OthersPl) VocP => "nasze"
|
AF (MascPersPl|OthersPl) VocP => "nasze"
|
||||||
};
|
};
|
||||||
n = Pl;
|
p = P1 ;
|
||||||
p = P1 ;
|
gn = MascPersPl
|
||||||
g = PNoGen
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -395,9 +381,8 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
|
|||||||
AF MascPersPl VocP => "wasi";
|
AF MascPersPl VocP => "wasi";
|
||||||
AF (MascPersPl|OthersPl) VocP => "wasze"
|
AF (MascPersPl|OthersPl) VocP => "wasze"
|
||||||
};
|
};
|
||||||
n = Pl;
|
p = P2 ;
|
||||||
p = P2 ;
|
gn = MascPersPl
|
||||||
g = PNoGen
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -416,9 +401,8 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
|
|||||||
LocPrep => "nich"
|
LocPrep => "nich"
|
||||||
};
|
};
|
||||||
sp = \\_ => "ich";
|
sp = \\_ => "ich";
|
||||||
n = Pl;
|
p = P3 ;
|
||||||
p = P3 ;
|
gn = MascPersPl
|
||||||
g = PGen (Masc Personal)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -437,9 +421,8 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
|
|||||||
LocPrep => "nich"
|
LocPrep => "nich"
|
||||||
};
|
};
|
||||||
sp = \\_ => "ich";
|
sp = \\_ => "ich";
|
||||||
n = Pl;
|
p = P3 ;
|
||||||
p = P3 ;
|
gn = OthersPl
|
||||||
g = PGen Fem
|
|
||||||
};
|
};
|
||||||
|
|
||||||
oper pronOneNeut: Pron =
|
oper pronOneNeut: Pron =
|
||||||
@@ -456,9 +439,8 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
|
|||||||
LocPrep => "nich"
|
LocPrep => "nich"
|
||||||
};
|
};
|
||||||
sp = \\_ => "ich";
|
sp = \\_ => "ich";
|
||||||
n = Pl;
|
p = P3 ;
|
||||||
p = P3 ;
|
gn = OthersPl
|
||||||
g = PGen Neut
|
|
||||||
};
|
};
|
||||||
--4.3 Interrogative pronouns
|
--4.3 Interrogative pronouns
|
||||||
{-
|
{-
|
||||||
|
|||||||
@@ -180,14 +180,6 @@
|
|||||||
|
|
||||||
----------------------- Parameter for pronouns -------------------------
|
----------------------- 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 AfterPrep parameter is introduced in order to describe --FIXME
|
||||||
-- the variations of the third person personal pronoun forms
|
-- the variations of the third person personal pronoun forms
|
||||||
-- depending on whether they come after a preposition or not.
|
-- depending on whether they come after a preposition or not.
|
||||||
@@ -196,8 +188,7 @@
|
|||||||
|
|
||||||
-- The sp field stands for the possesive variant of the pronoun.
|
-- 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 ;
|
oper Pron = NounPhrase ** { sp: AForm => Str } ;
|
||||||
g: PronGen } ;
|
|
||||||
|
|
||||||
--6 Complement definition
|
--6 Complement definition
|
||||||
|
|
||||||
@@ -245,7 +236,7 @@
|
|||||||
NounPhrase : Type = {
|
NounPhrase : Type = {
|
||||||
nom: Str; voc: Str; dep: ComplCase => Str; -- dep = dependent cases
|
nom: Str; voc: Str; dep: ComplCase => Str; -- dep = dependent cases
|
||||||
gn: GenNum; p : Person };
|
gn: GenNum; p : Person };
|
||||||
|
|
||||||
cast_gennum = table {
|
cast_gennum = table {
|
||||||
<Masc Personal,Sg> => MascPersSg;
|
<Masc Personal,Sg> => MascPersSg;
|
||||||
<Masc Animate,Sg> => MascAniSg;
|
<Masc Animate,Sg> => MascAniSg;
|
||||||
@@ -387,4 +378,4 @@
|
|||||||
VocP => ["[siebie: the vocative form does not exist]"]
|
VocP => ["[siebie: the vocative form does not exist]"]
|
||||||
};
|
};
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -51,13 +51,12 @@ lin
|
|||||||
here7from_Adv = ss "stąd";
|
here7from_Adv = ss "stąd";
|
||||||
how_IAdv = ss "jak";
|
how_IAdv = ss "jak";
|
||||||
how8many_IDet = ileDet;
|
how8many_IDet = ileDet;
|
||||||
i_Pron = pronJa;
|
i_Pron = pronJa MascPersSg;
|
||||||
if_Subj = ss "jeśli";
|
if_Subj = ss "jeśli";
|
||||||
if_then_Conj = {s1="jeżeli"; s2=[", to"]; sent1="jeżeli"; sent2=[", to"]};
|
if_then_Conj = {s1="jeżeli"; s2=[", to"]; sent1="jeżeli"; sent2=[", to"]};
|
||||||
in8front_Prep = mkPrep "przed" Instr;
|
in8front_Prep = mkPrep "przed" Instr;
|
||||||
in_Prep = mkPrep "w" Loc;
|
in_Prep = mkPrep "w" Loc;
|
||||||
it_Pron = pronOno;
|
it_Pron = pronOno;
|
||||||
-- it_ReflPron = pronRefl; -- Use directly in PronounMorphoPol for "swój" as a pronoun/poss. pronoun
|
|
||||||
language_title_Utt = ss "polski";
|
language_title_Utt = ss "polski";
|
||||||
less_CAdv = {s,sn = "mniej" ; p,pn = "niż" } ;
|
less_CAdv = {s,sn = "mniej" ; p,pn = "niż" } ;
|
||||||
many_Det = wieleDet;
|
many_Det = wieleDet;
|
||||||
@@ -92,7 +91,7 @@ lin
|
|||||||
there7to_Adv = ss "tam";
|
there7to_Adv = ss "tam";
|
||||||
there7from_Adv = ss "stamtąd";
|
there7from_Adv = ss "stamtąd";
|
||||||
therefore_PConj = ss "dlatego";
|
therefore_PConj = ss "dlatego";
|
||||||
they_Pron = pronOni;-- pronOneFem; pronOneNeut};
|
they_Pron = pronOni;
|
||||||
this_Quant = demPronTen "ten";
|
this_Quant = demPronTen "ten";
|
||||||
through_Prep = mkPrep "przez" Acc;
|
through_Prep = mkPrep "przez" Acc;
|
||||||
to_Prep = doPrep;
|
to_Prep = doPrep;
|
||||||
@@ -114,7 +113,7 @@ lin
|
|||||||
without_Prep = mkPrep "bez" Gen;
|
without_Prep = mkPrep "bez" Gen;
|
||||||
youPl_Pron = pronWy;
|
youPl_Pron = pronWy;
|
||||||
yes_Utt = ss "tak";
|
yes_Utt = ss "tak";
|
||||||
youSg_Pron = pronTy;
|
youSg_Pron = pronTy MascPersSg;
|
||||||
youPol_Pron = pronWy;
|
youPol_Pron = pronWy;
|
||||||
|
|
||||||
as_CAdv = { s,sn="tak"; p,pn="jak"} ;
|
as_CAdv = { s,sn="tak"; p,pn="jak"} ;
|
||||||
|
|||||||
Reference in New Issue
Block a user