1
0
forked from GitHub/gf-rgl

simplify the code and allow for non-standard pronouns

This commit is contained in:
krangelov
2021-04-27 08:42:57 +02:00
parent 6bf2555a4a
commit b3cc234c14
8 changed files with 65 additions and 90 deletions

View File

@@ -2,5 +2,5 @@
concrete AllPol of AllPolAbs =
LangPol,
ExtraPol
ExtendPol
** {} ;

View File

@@ -54,11 +54,8 @@ concrete CatPol of Cat = CommonX - [CAdv] ** open ResPol, Prelude, (R = ParamX)
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;

24
src/polish/ExtendPol.gf Normal file
View 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 ;
} ;
}

View File

@@ -7,13 +7,4 @@ concrete ExtraPol of ExtraPolAbs = CatPol ** open ResPol in {
g = cn.g
};
ProDrop p = {
nom = [] ;
voc = p.voc ;
dep = p.dep ;
sp = p.sp ;
n = p.n ;
p = p.p ;
g = p.g ;
} ;
}

View File

@@ -41,18 +41,9 @@ concrete NounPol of Noun = CatPol ** open ResPol, Prelude, PronounMorphoPol, Mor
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;
};
UsePron p = p ;
AdjCN mily facet = {
s = \\n,c => case mily.isPost of {
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
DefArt = {s = \\_=>[] ; sp = (demPronTen "ten").sp ; c=Nom; g = PNoGen };
IndefArt = {s = \\_=>[] ; sp = jaki ; c=Nom; g = PNoGen };
DefArt = {s = \\_=>[] ; sp = (demPronTen "ten").sp };
IndefArt = {s = \\_=>[] ; sp = jaki };
UseN sb = {
s = \\n,c => sb.s ! SF n c;

View File

@@ -19,8 +19,7 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
--4.2 Personal pronouns and their possessive forms
-- for "I", "my", "mine"
oper pronJa: Pron = pronJaFoo PNoGen;
oper pronJaFoo: PronGen -> Pron = \gender ->
oper pronJa: GenNum -> Pron = \gn ->
{ nom = "ja";
voc = "ja";
dep = table {
@@ -68,15 +67,13 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
AF MascPersPl VocP => "moi";
AF (MascPersPl|OthersPl) VocP=> "moje"
};
n = Sg;
p = P1 ;
g = gender
p = P1 ;
gn = gn
};
-- for "you", "yours"
oper pronTy: Pron = pronTyFoo PNoGen;
oper pronTyFoo: PronGen -> Pron = \gender ->
oper pronTy: GenNum -> Pron = \gn ->
{ sp = table {
AF (MascPersSg|MascAniSg|MascInaniSg) Nom => "twój";
AF (MascPersSg|MascAniSg|MascInaniSg) Gen => "twojego";
@@ -126,9 +123,8 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
InstrC => "tobą";
LocPrep => "tobie"
};
n = Sg;
p = P2 ;
g = gender
p = P2 ;
gn = gn
};
@@ -147,9 +143,8 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
LocPrep => "panu"
};
sp = \\_ => "pana";
n = Sg;
p = P3 ;
g = PGen (Masc Personal)
gn = MascPersSg
};
-- for "you polite" (very idiomatic: pron you = 'madam') female version
@@ -167,9 +162,8 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
LocPrep => "pani"
};
sp = \\_ => "pani";
n = Sg;
p = P3 ;
g = PGen (Fem)
p = P3 ;
gn = FemSg
};
-- for "he", "his"
@@ -187,9 +181,8 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
LocPrep => "nim"
};
sp = \\_ => "jego";
n = Sg;
p = P3 ;
g = PGen (Masc Personal)
p = P3 ;
gn = MascPersSg
};
@@ -208,16 +201,12 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
LocPrep => "niej"
};
sp = \\_ => "jej";
n = Sg;
p = P3 ;
g = PGen Fem;
p = P3 ;
gn = FemSg
};
-- A loose translation of "its" (reflexive)
oper pronRefl: Pron = pronReflFoo PNoGen;
oper pronReflFoo: PronGen -> Pron = \gender ->
oper pronRefl: GenNum -> Pron = \gn ->
{ sp = table {
AF (MascPersSg|MascAniSg|MascInaniSg) Nom => "swój";
AF (MascPersSg|MascAniSg|MascInaniSg) Gen => "swojego";
@@ -267,9 +256,8 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
InstrC => "sobą";
LocPrep => "sobie"
};
n = Sg;
p = P2 ;
g = gender
p = P2 ;
gn = gn
};
-- for "it", "its"
@@ -277,9 +265,9 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
{ nom = "ono" ;
voc = "ono" ;
dep= table {
GenNoPrep => "jego"; --"go"};
GenNoPrep => "jego"; --"go";
GenPrep => "niego";
DatNoPrep => "jemu"; --"mu"};
DatNoPrep => "jemu"; --"mu";
DatPrep => "niemu";
AccNoPrep => "je";
AccPrep => "nie";
@@ -287,9 +275,8 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
LocPrep => "nim"
};
sp = \\_ => "jej";
n = Sg;
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|OthersPl) VocP => "nasze"
};
n = Pl;
p = P1 ;
g = PNoGen
p = P1 ;
gn = MascPersPl
};
@@ -395,9 +381,8 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
AF MascPersPl VocP => "wasi";
AF (MascPersPl|OthersPl) VocP => "wasze"
};
n = Pl;
p = P2 ;
g = PNoGen
p = P2 ;
gn = MascPersPl
};
@@ -416,9 +401,8 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
LocPrep => "nich"
};
sp = \\_ => "ich";
n = Pl;
p = P3 ;
g = PGen (Masc Personal)
p = P3 ;
gn = MascPersPl
};
@@ -437,9 +421,8 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
LocPrep => "nich"
};
sp = \\_ => "ich";
n = Pl;
p = P3 ;
g = PGen Fem
p = P3 ;
gn = OthersPl
};
oper pronOneNeut: Pron =
@@ -456,9 +439,8 @@ resource PronounMorphoPol = ResPol ** open Prelude, (Predef=Predef) in {
LocPrep => "nich"
};
sp = \\_ => "ich";
n = Pl;
p = P3 ;
g = PGen Neut
p = P3 ;
gn = OthersPl
};
--4.3 Interrogative pronouns
{-

View File

@@ -180,14 +180,6 @@
----------------------- 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.
@@ -196,8 +188,7 @@
-- 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 } ;
oper Pron = NounPhrase ** { sp: AForm => Str } ;
--6 Complement definition
@@ -245,7 +236,7 @@
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;
@@ -387,4 +378,4 @@
VocP => ["[siebie: the vocative form does not exist]"]
};
} ;
} ;

View File

@@ -51,13 +51,12 @@ lin
here7from_Adv = ss "stąd";
how_IAdv = ss "jak";
how8many_IDet = ileDet;
i_Pron = pronJa;
i_Pron = pronJa MascPersSg;
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;
-- it_ReflPron = pronRefl; -- Use directly in PronounMorphoPol for "swój" as a pronoun/poss. pronoun
language_title_Utt = ss "polski";
less_CAdv = {s,sn = "mniej" ; p,pn = "niż" } ;
many_Det = wieleDet;
@@ -92,7 +91,7 @@ lin
there7to_Adv = ss "tam";
there7from_Adv = ss "stamtąd";
therefore_PConj = ss "dlatego";
they_Pron = pronOni;-- pronOneFem; pronOneNeut};
they_Pron = pronOni;
this_Quant = demPronTen "ten";
through_Prep = mkPrep "przez" Acc;
to_Prep = doPrep;
@@ -114,7 +113,7 @@ lin
without_Prep = mkPrep "bez" Gen;
youPl_Pron = pronWy;
yes_Utt = ss "tak";
youSg_Pron = pronTy;
youSg_Pron = pronTy MascPersSg;
youPol_Pron = pronWy;
as_CAdv = { s,sn="tak"; p,pn="jak"} ;