1
0
forked from GitHub/gf-rgl

Merge remote-tracking branch 'origin/master' into pl-reflpron

This commit is contained in:
Paula Pawlowski
2020-11-30 10:02:33 +01:00
20 changed files with 132 additions and 37 deletions

View File

@@ -4,7 +4,7 @@ language: c
os: os:
- linux - linux
- osx - osx
- windows # - windows
addons: addons:
apt: apt:

View File

@@ -193,6 +193,9 @@ abstract Extend = Cat ** {
Cons_nr_RNP : NP -> RNPList -> RNPList ; -- John, my family, myself Cons_nr_RNP : NP -> RNPList -> RNPList ; -- John, my family, myself
---- Cons_rn_RNP : RNP -> ListNP -> RNPList ; -- myself, John, Mary ---- Cons_rn_RNP : RNP -> ListNP -> RNPList ; -- myself, John, Mary
-- reflexive possessive on its own right, like in Swedish, Czech, Slovak
ReflPossPron : Quant ; -- Swe sin,sitt,sina
--- from Extensions --- from Extensions

View File

@@ -79,6 +79,7 @@ lin
Base_rn_RNP = variants {} ; -- RNP -> NP -> RNPList ; -- myself, John Base_rn_RNP = variants {} ; -- RNP -> NP -> RNPList ; -- myself, John
Cons_rr_RNP = variants {} ; -- RNP -> RNPList -> RNPList ; -- my family, myself, John Cons_rr_RNP = variants {} ; -- RNP -> RNPList -> RNPList ; -- my family, myself, John
Cons_nr_RNP = variants {} ; -- NP -> RNPList -> RNPList ; -- John, my family, myself Cons_nr_RNP = variants {} ; -- NP -> RNPList -> RNPList ; -- John, my family, myself
ReflPossPron = PossPron he_Pron ; -- : Quant ; -- Swe sin,sitt,sina
ComplGenVV = variants {} ; -- VV -> Ant -> Pol -> VP -> VP ; -- want not to have slept ComplGenVV = variants {} ; -- VV -> Ant -> Pol -> VP -> VP ; -- want not to have slept
ComplSlashPartLast = ComplSlash ; ComplSlashPartLast = ComplSlash ;
--SlashV2V = variants {} ; -- V2V -> Ant -> Pol -> VPS -> VPSlash ; -- force (her) not to have slept --SlashV2V = variants {} ; -- V2V -> Ant -> Pol -> VPS -> VPSlash ; -- force (her) not to have slept

View File

@@ -1,6 +1,7 @@
--# -path=.:../abstract:../common:../api --# -path=.:../abstract:../common:../api
concrete AllCze of AllCzeAbs = concrete AllCze of AllCzeAbs =
LangCze LangCze,
ExtendCze
; ;

View File

@@ -1,6 +1,7 @@
--# -path=.:../abstract:../common:prelude --# -path=.:../abstract:../common:prelude
abstract AllCzeAbs = abstract AllCzeAbs =
Lang Lang,
Extend
; ;

View File

@@ -24,6 +24,7 @@ concrete CatCze of Cat =
VPSlash = {verb : VerbForms ; clit,compl : Agr => Str ; c : ComplementCase} ; ---- VPSlash = {verb : VerbForms ; clit,compl : Agr => Str ; c : ComplementCase} ; ----
V = ResCze.VerbForms ; V = ResCze.VerbForms ;
V2 = ResCze.VerbForms ** {c : ComplementCase} ; V2 = ResCze.VerbForms ** {c : ComplementCase} ;
VS,VQ = ResCze.VerbForms ;
A = ResCze.AdjForms ; A = ResCze.AdjForms ;
AP = ResCze.Adjective ** {isPost : Bool} ; -- {s : Gender => Number => Case => Str} AP = ResCze.Adjective ** {isPost : Bool} ; -- {s : Gender => Number => Case => Str}

38
src/czech/ExtendCze.gf Normal file
View File

@@ -0,0 +1,38 @@
concrete ExtendCze of Extend = CatCze **
ExtendFunctor - [
ReflPossPron
---- constant not found (yet)
,youPolFem_Pron
,UttVPShort
,UttAccIP
,UttDatIP
,SubjRelNP
,StrandRelSlash
,StrandQuestSlash
,SlashBareV2S
,PredIAdvVP
,PredAPVP
,ExistsNP
,ExistS
,ExistPluralCN
,ExistNPQS
,ExistMassCN
,ExistIPQS
,ExistCN
,EmptyRelSlash
,DetNPMasc
,DetNPFem
,ComplBareVS
,CompIQuant
,CompBareCN
]
with (Grammar = GrammarCze)
**
open
ResCze
in {
lin ReflPossPron = justDemPronFormsAdjective reflPossessivePron ;
}

View File

@@ -632,8 +632,6 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> {
a : Agr a : Agr
} ; } ;
---- TODO: possessives
personalPron : Agr -> PronForms = \a -> personalPron : Agr -> PronForms = \a ->
{a = a ; cnom = []} ** {a = a ; cnom = []} **
case a of { case a of {
@@ -753,6 +751,7 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> {
} ; } ;
reflPossessivePron : DemPronForms = mladyAdjForms "svy" ** {msnom = "svůj" ; pdat = "svým"} ;
mkPron : Agr -> PronForms ** {poss : DemPronForms} = \a -> mkPron : Agr -> PronForms ** {poss : DemPronForms} = \a ->
personalPron a ** {poss = possessivePron a} ; personalPron a ** {poss = possessivePron a} ;

View File

@@ -23,6 +23,7 @@ lin
youSg_Pron = mkPron (Ag (Masc Anim) Sg P2) ; youSg_Pron = mkPron (Ag (Masc Anim) Sg P2) ;
he_Pron = mkPron (Ag (Masc Anim) Sg P3) ; he_Pron = mkPron (Ag (Masc Anim) Sg P3) ;
she_Pron = mkPron (Ag Fem Sg P3) ; she_Pron = mkPron (Ag Fem Sg P3) ;
it_Pron = mkPron (Ag Neutr Sg P3) ;
we_Pron = mkPron (Ag (Masc Anim) Pl P1) ; we_Pron = mkPron (Ag (Masc Anim) Pl P1) ;
youPl_Pron = mkPron (Ag (Masc Anim) Pl P2) ; youPl_Pron = mkPron (Ag (Masc Anim) Pl P2) ;
they_Pron = mkPron (Ag (Masc Anim) Pl P3) ; they_Pron = mkPron (Ag (Masc Anim) Pl P3) ;

View File

@@ -412,7 +412,15 @@ mkInterj : Str -> Interj
compoundN s n = lin N {s = \\x,y => s ++ n.s ! x ! y ; g=n.g} ; compoundN s n = lin N {s = \\x,y => s ++ n.s ! x ! y ; g=n.g} ;
verbalN v = regN (v.s ! VPresPart) ; -- NB. this only works when constructing lexicon, not applied to runtime arguments
verbalN v =
let switching : Str = v.s ! VPresPart ;
on : Str = v.p ;
in particleN (regN switching) on ;
particleN : N -> Str -> N = \n,str -> n ** {
s = \\num,cas => n.s ! num ! cas ++ str
} ;
mkPN = overload { mkPN = overload {
mkPN : Str -> PN = regPN ; mkPN : Str -> PN = regPN ;

View File

@@ -99,14 +99,13 @@ concrete NounHun of Noun = CatHun ** open
quant ** num ** { quant ** num ** {
s = \\c => case <isNum num,isIndefArt quant> of { s = \\c => case <isNum num,isIndefArt quant> of {
<True,True> => [] ; -- don't output "a 2 cars" <True,True> => [] ; -- don't output "a 2 cars"
_ => quant.s ! n ! c } _ => quant.s ! n ! c } -- az/azok a …
++ num.s ! Attrib ; -- TODO: add inflection table in numbers ++ num.s ! Attrib ; -- TODO: add inflection table in numbers
sp = \\c => case <isNum num,isIndefArt quant> of { sp = \\c => case <isNum num,isIndefArt quant> of {
<True,True> => [] ; <True,True> => [] ;
_ => quant.sp ! n ! c } _ => quant.sp ! n ! c } -- az/azok …
++ num.s ! Indep ; ++ num.s ! Indep ;
n = n ; n = n ;
dt = qt2dt quant.qt ;
} ; } ;
-- : Quant -> Num -> Ord -> Det ; -- these five best -- : Quant -> Num -> Ord -> Det ; -- these five best
@@ -170,20 +169,20 @@ concrete NounHun of Noun = CatHun ** open
DefArt = mkQuant "a" "a" ** { DefArt = mkQuant "a" "a" ** {
s, s,
sp = \\_,_ => pre {"a" ; "az" / v } ; sp = \\_,_ => pre {"a" ; "az" / v } ;
qt = DefQuant ; dt = DefDet ;
} ; } ;
-- : Quant -- : Quant
IndefArt = mkQuant "egy" [] ** { IndefArt = mkQuant "egy" [] ** {
s = \\n,_ => case n of {Sg => "egy" ; Pl => []} ; s = \\n,_ => case n of {Sg => "egy" ; Pl => []} ;
sp = \\n,_ => case n of {Sg => "egy" ; Pl => "sok"} ; sp = \\n,_ => case n of {Sg => "egy" ; Pl => "sok"} ;
qt = IndefArticle ; dt = IndefDet ;
} ; } ;
-- : Pron -> Quant -- : Pron -> Quant
PossPron pron = pron ** { PossPron pron = pron ** {
s,sp = \\_ => pron.s ; s,sp = \\_ => pron.s ;
qt = QuantPoss (agr2pstem pron.agr) ; dt = DetPoss (agr2pstem pron.agr) ;
caseagr = False ; caseagr = False ;
} ; } ;

View File

@@ -17,17 +17,11 @@ oper
-- Quant -- Quant
param param
QuantType =
IndefArticle -- Needed to prevent "a 2 cars"
| IndefQuant -- Not IndefArt, not poss, not def
| DefQuant
| QuantPoss PossStem -- Which possessive stem it takes
;
DetType = DetType =
DefDet -- distinction between Article and Other no longer needed DefDet
| IndefDet -- still need def or indef | IndefDet -- Def or Indef relevant for verb agreement
| DetPoss PossStem -- Sill need to know which stem it takes if Poss | DetPoss PossStem -- Which possessive stem it takes
; ;
-- Singular stems. Plural is always same, no need to add here. -- Singular stems. Plural is always same, no need to add here.
@@ -35,9 +29,9 @@ param
oper oper
-- standard trick to prevent "a one car" -- standard trick to prevent "a one car"
isIndefArt : {qt : QuantType} -> Bool = \quant -> isIndefArt : {dt : DetType} -> Bool = \quant ->
case quant.qt of { case quant.dt of {
IndefArticle => True ; IndefDet => True ;
_ => False _ => False
} ; } ;
@@ -51,12 +45,6 @@ oper
Indef => IndefDet Indef => IndefDet
} ; } ;
qt2dt : QuantType -> DetType = \qt -> case qt of {
QuantPoss x => DetPoss x ;
DefQuant => DefDet ;
_ => IndefDet
} ;
agr2pstem : Person*Number -> PossStem = \pn -> agr2pstem : Person*Number -> PossStem = \pn ->
case <pn.p1,pn.p2> of { case <pn.p1,pn.p2> of {
<P1,Pl> => dSg_rPl1 ; <P1,Pl> => dSg_rPl1 ;

View File

@@ -203,13 +203,13 @@ oper
Quant : Type = BaseQuant ** { Quant : Type = BaseQuant ** {
s, -- form that comes before noun: "{this} car" s, -- form that comes before noun: "{this} car"
sp : Number => Case => Str ; -- independent form, "I like {this}" (DetNP) sp : Number => Case => Str ; -- independent form, "I like {this}" (DetNP)
qt : QuantType ; dt : DetType ;
} ; } ;
mkQuant : (s,sp : Str) -> Quant = \s,sp -> { mkQuant : (s,sp : Str) -> Quant = \s,sp -> {
s = mkCaseNoun s ; s = mkCaseNoun s ;
sp = mkCaseNoun sp ; sp = mkCaseNoun sp ;
qt = DefQuant ; dt = DefDet ;
caseagr = True ; caseagr = True ;
poss = harm1 [] ; poss = harm1 [] ;
} ; } ;

View File

@@ -1,6 +1,7 @@
--# -path=.:../abstract:../common:../api --# -path=.:../abstract:../common:../api
concrete AllSlo of AllSloAbs = concrete AllSlo of AllSloAbs =
LangSlo LangSlo,
ExtendSlo
; ;

View File

@@ -1,6 +1,7 @@
--# -path=.:../abstract:../common:prelude --# -path=.:../abstract:../common:prelude
abstract AllSloAbs = abstract AllSloAbs =
Lang Lang,
Extend
; ;

View File

@@ -24,6 +24,7 @@ concrete CatSlo of Cat =
VPSlash = {verb : VerbForms ; clit,compl : Agr => Str ; c : ComplementCase} ; ---- VPSlash = {verb : VerbForms ; clit,compl : Agr => Str ; c : ComplementCase} ; ----
V = ResSlo.VerbForms ; V = ResSlo.VerbForms ;
V2 = ResSlo.VerbForms ** {c : ComplementCase} ; V2 = ResSlo.VerbForms ** {c : ComplementCase} ;
VS,VQ = ResSlo.VerbForms ;
A = ResSlo.AdjForms ; A = ResSlo.AdjForms ;
AP = ResSlo.Adjective ** {isPost : Bool} ; -- {s : Gender => Number => Case => Str} AP = ResSlo.Adjective ** {isPost : Bool} ; -- {s : Gender => Number => Case => Str}

38
src/slovak/ExtendSlo.gf Normal file
View File

@@ -0,0 +1,38 @@
concrete ExtendSlo of Extend = CatSlo **
ExtendFunctor - [
ReflPossPron
---- constant not found (yet)
,youPolFem_Pron
,UttVPShort
,UttAccIP
,UttDatIP
,SubjRelNP
,StrandRelSlash
,StrandQuestSlash
,SlashBareV2S
,PredIAdvVP
,PredAPVP
,ExistsNP
,ExistS
,ExistPluralCN
,ExistNPQS
,ExistMassCN
,ExistIPQS
,ExistCN
,EmptyRelSlash
,DetNPMasc
,DetNPFem
,ComplBareVS
,CompIQuant
,CompBareCN
]
with (Grammar = GrammarSlo)
**
open
ResSlo
in {
lin ReflPossPron = justDemPronFormsAdjective reflPossessivePron ;
}

View File

@@ -869,6 +869,15 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> {
} ; } ;
reflPossessivePron : DemPronForms = otcovA "svoj" ** {
msnom = "svoj" ; msgen = "svojho" ; msdat = "svojmu" ;
msins = "svojím" ;
ampnom = "svoji" ;
nsnom, fpnom = "svoje" ;
pgen = "svojich" ;
pdat = "svojim" ;
pins = "svojimi" ;
} ;
mkPron : Agr -> PronForms ** {poss : DemPronForms} = \a -> mkPron : Agr -> PronForms ** {poss : DemPronForms} = \a ->
personalPron a ** {poss = possessivePron a} ; personalPron a ** {poss = possessivePron a} ;

View File

@@ -24,6 +24,7 @@ lin
youSg_Pron = mkPron (Ag (Masc Anim) Sg P2) ; youSg_Pron = mkPron (Ag (Masc Anim) Sg P2) ;
he_Pron = mkPron (Ag (Masc Anim) Sg P3) ; he_Pron = mkPron (Ag (Masc Anim) Sg P3) ;
she_Pron = mkPron (Ag Fem Sg P3) ; she_Pron = mkPron (Ag Fem Sg P3) ;
it_Pron = mkPron (Ag Neutr Sg P3) ;
we_Pron = mkPron (Ag (Masc Anim) Pl P1) ; we_Pron = mkPron (Ag (Masc Anim) Pl P1) ;
youPl_Pron = mkPron (Ag (Masc Anim) Pl P2) ; youPl_Pron = mkPron (Ag (Masc Anim) Pl P2) ;
they_Pron = mkPron (Ag (Masc Anim) Pl P3) ; they_Pron = mkPron (Ag (Masc Anim) Pl P3) ;

View File

@@ -12,14 +12,16 @@ concrete ExtendSwe of Extend = CatSwe **
ICompAP,ProDrop,EmbedSSlash, ICompAP,ProDrop,EmbedSSlash,
AdAdV, PositAdVAdj, GerundCN, GerundNP, GerundAdv, PresPartAP, PastPartAP, PastPartAgentAP, AdAdV, PositAdVAdj, GerundCN, GerundNP, GerundAdv, PresPartAP, PastPartAP, PastPartAgentAP,
RNP, RNPList, ReflRNP, ReflPron, ReflPoss, PredetRNP, ConjRNP, RNP, RNPList, ReflRNP, ReflPron, ReflPoss, PredetRNP, ConjRNP,
Base_rr_RNP, Base_nr_RNP, Base_rn_RNP, Cons_rr_RNP, Cons_nr_RNP, Base_rr_RNP, Base_nr_RNP, Base_rn_RNP, Cons_rr_RNP, Cons_nr_RNP, ReflPossPron,
CompoundN, CompoundAP, AdvIsNP, CompoundN, CompoundAP, AdvIsNP,
UttAccNP UttAccNP
] ]
with (Grammar = GrammarSwe) with (Grammar = GrammarSwe)
** **
open CommonScand, ResSwe, ParamX, VerbSwe, Prelude, DiffSwe, StructuralSwe, MorphoSwe, open CommonScand, ResSwe, ParamX, VerbSwe, Prelude, DiffSwe, StructuralSwe, MorphoSwe,
NounSwe, Coordination, AdjectiveSwe, SentenceSwe, AdverbSwe, RelativeSwe, (P = ParadigmsSwe) in { NounSwe, Coordination, AdjectiveSwe, SentenceSwe, AdverbSwe, RelativeSwe, (P = ParadigmsSwe),
(M = MakeStructuralSwe)
in {
flags coding=utf8 ; flags coding=utf8 ;
@@ -207,6 +209,8 @@ concrete ExtendSwe of Extend = CatSwe **
Cons_rr_RNP x xs = consrTable Agr comma x xs ; Cons_rr_RNP x xs = consrTable Agr comma x xs ;
Cons_nr_RNP x xs = consrTable Agr comma {s = \\a => x.s ! NPAcc} xs ; Cons_nr_RNP x xs = consrTable Agr comma {s = \\a => x.s ! NPAcc} xs ;
ReflPossPron = M.mkQuant "sin" "sitt" "sina" ;
lin lin
ApposNP np1 np2 = {s = \\nform => np1.s ! nform ++ comma ++ np2.s ! nform; a = np1.a; isPron = False} ; ApposNP np1 np2 = {s = \\nform => np1.s ! nform ++ comma ++ np2.s ! nform; a = np1.a; isPron = False} ;