mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
Merge remote-tracking branch 'origin/master' into pl-reflpron
This commit is contained in:
@@ -4,7 +4,7 @@ language: c
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
- windows
|
||||
# - windows
|
||||
|
||||
addons:
|
||||
apt:
|
||||
|
||||
@@ -193,6 +193,9 @@ abstract Extend = Cat ** {
|
||||
Cons_nr_RNP : NP -> RNPList -> RNPList ; -- John, my family, myself
|
||||
---- 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
|
||||
|
||||
|
||||
@@ -79,6 +79,7 @@ lin
|
||||
Base_rn_RNP = variants {} ; -- RNP -> NP -> RNPList ; -- myself, John
|
||||
Cons_rr_RNP = variants {} ; -- RNP -> RNPList -> RNPList ; -- my family, myself, John
|
||||
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
|
||||
ComplSlashPartLast = ComplSlash ;
|
||||
--SlashV2V = variants {} ; -- V2V -> Ant -> Pol -> VPS -> VPSlash ; -- force (her) not to have slept
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
--# -path=.:../abstract:../common:../api
|
||||
|
||||
concrete AllCze of AllCzeAbs =
|
||||
LangCze
|
||||
LangCze,
|
||||
ExtendCze
|
||||
;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
--# -path=.:../abstract:../common:prelude
|
||||
|
||||
abstract AllCzeAbs =
|
||||
Lang
|
||||
Lang,
|
||||
Extend
|
||||
;
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ concrete CatCze of Cat =
|
||||
VPSlash = {verb : VerbForms ; clit,compl : Agr => Str ; c : ComplementCase} ; ----
|
||||
V = ResCze.VerbForms ;
|
||||
V2 = ResCze.VerbForms ** {c : ComplementCase} ;
|
||||
VS,VQ = ResCze.VerbForms ;
|
||||
|
||||
A = ResCze.AdjForms ;
|
||||
AP = ResCze.Adjective ** {isPost : Bool} ; -- {s : Gender => Number => Case => Str}
|
||||
|
||||
38
src/czech/ExtendCze.gf
Normal file
38
src/czech/ExtendCze.gf
Normal 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 ;
|
||||
|
||||
|
||||
}
|
||||
@@ -632,8 +632,6 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> {
|
||||
a : Agr
|
||||
} ;
|
||||
|
||||
---- TODO: possessives
|
||||
|
||||
personalPron : Agr -> PronForms = \a ->
|
||||
{a = a ; cnom = []} **
|
||||
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 ->
|
||||
personalPron a ** {poss = possessivePron a} ;
|
||||
|
||||
@@ -23,6 +23,7 @@ lin
|
||||
youSg_Pron = mkPron (Ag (Masc Anim) Sg P2) ;
|
||||
he_Pron = mkPron (Ag (Masc Anim) Sg P3) ;
|
||||
she_Pron = mkPron (Ag Fem Sg P3) ;
|
||||
it_Pron = mkPron (Ag Neutr Sg P3) ;
|
||||
we_Pron = mkPron (Ag (Masc Anim) Pl P1) ;
|
||||
youPl_Pron = mkPron (Ag (Masc Anim) Pl P2) ;
|
||||
they_Pron = mkPron (Ag (Masc Anim) Pl P3) ;
|
||||
|
||||
@@ -412,7 +412,15 @@ mkInterj : Str -> Interj
|
||||
|
||||
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 : Str -> PN = regPN ;
|
||||
|
||||
@@ -99,14 +99,13 @@ concrete NounHun of Noun = CatHun ** open
|
||||
quant ** num ** {
|
||||
s = \\c => case <isNum num,isIndefArt quant> of {
|
||||
<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
|
||||
sp = \\c => case <isNum num,isIndefArt quant> of {
|
||||
<True,True> => [] ;
|
||||
_ => quant.sp ! n ! c }
|
||||
_ => quant.sp ! n ! c } -- az/azok …
|
||||
++ num.s ! Indep ;
|
||||
n = n ;
|
||||
dt = qt2dt quant.qt ;
|
||||
} ;
|
||||
|
||||
-- : Quant -> Num -> Ord -> Det ; -- these five best
|
||||
@@ -170,20 +169,20 @@ concrete NounHun of Noun = CatHun ** open
|
||||
DefArt = mkQuant "a" "a" ** {
|
||||
s,
|
||||
sp = \\_,_ => pre {"a" ; "az" / v } ;
|
||||
qt = DefQuant ;
|
||||
dt = DefDet ;
|
||||
} ;
|
||||
|
||||
-- : Quant
|
||||
IndefArt = mkQuant "egy" [] ** {
|
||||
s = \\n,_ => case n of {Sg => "egy" ; Pl => []} ;
|
||||
sp = \\n,_ => case n of {Sg => "egy" ; Pl => "sok"} ;
|
||||
qt = IndefArticle ;
|
||||
dt = IndefDet ;
|
||||
} ;
|
||||
|
||||
-- : Pron -> Quant
|
||||
PossPron pron = pron ** {
|
||||
s,sp = \\_ => pron.s ;
|
||||
qt = QuantPoss (agr2pstem pron.agr) ;
|
||||
dt = DetPoss (agr2pstem pron.agr) ;
|
||||
caseagr = False ;
|
||||
} ;
|
||||
|
||||
|
||||
@@ -17,17 +17,11 @@ oper
|
||||
-- Quant
|
||||
|
||||
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 =
|
||||
DefDet -- distinction between Article and Other no longer needed
|
||||
| IndefDet -- still need def or indef
|
||||
| DetPoss PossStem -- Sill need to know which stem it takes if Poss
|
||||
DefDet
|
||||
| IndefDet -- Def or Indef relevant for verb agreement
|
||||
| DetPoss PossStem -- Which possessive stem it takes
|
||||
;
|
||||
|
||||
-- Singular stems. Plural is always same, no need to add here.
|
||||
@@ -35,10 +29,10 @@ param
|
||||
|
||||
oper
|
||||
-- standard trick to prevent "a one car"
|
||||
isIndefArt : {qt : QuantType} -> Bool = \quant ->
|
||||
case quant.qt of {
|
||||
IndefArticle => True ;
|
||||
_ => False
|
||||
isIndefArt : {dt : DetType} -> Bool = \quant ->
|
||||
case quant.dt of {
|
||||
IndefDet => True ;
|
||||
_ => False
|
||||
} ;
|
||||
|
||||
dt2objdef : DetType -> ObjDef = \dt -> case dt of {
|
||||
@@ -51,12 +45,6 @@ oper
|
||||
Indef => IndefDet
|
||||
} ;
|
||||
|
||||
qt2dt : QuantType -> DetType = \qt -> case qt of {
|
||||
QuantPoss x => DetPoss x ;
|
||||
DefQuant => DefDet ;
|
||||
_ => IndefDet
|
||||
} ;
|
||||
|
||||
agr2pstem : Person*Number -> PossStem = \pn ->
|
||||
case <pn.p1,pn.p2> of {
|
||||
<P1,Pl> => dSg_rPl1 ;
|
||||
|
||||
@@ -203,13 +203,13 @@ oper
|
||||
Quant : Type = BaseQuant ** {
|
||||
s, -- form that comes before noun: "{this} car"
|
||||
sp : Number => Case => Str ; -- independent form, "I like {this}" (DetNP)
|
||||
qt : QuantType ;
|
||||
dt : DetType ;
|
||||
} ;
|
||||
|
||||
mkQuant : (s,sp : Str) -> Quant = \s,sp -> {
|
||||
s = mkCaseNoun s ;
|
||||
sp = mkCaseNoun sp ;
|
||||
qt = DefQuant ;
|
||||
dt = DefDet ;
|
||||
caseagr = True ;
|
||||
poss = harm1 [] ;
|
||||
} ;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
--# -path=.:../abstract:../common:../api
|
||||
|
||||
concrete AllSlo of AllSloAbs =
|
||||
LangSlo
|
||||
LangSlo,
|
||||
ExtendSlo
|
||||
;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
--# -path=.:../abstract:../common:prelude
|
||||
|
||||
abstract AllSloAbs =
|
||||
Lang
|
||||
Lang,
|
||||
Extend
|
||||
;
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ concrete CatSlo of Cat =
|
||||
VPSlash = {verb : VerbForms ; clit,compl : Agr => Str ; c : ComplementCase} ; ----
|
||||
V = ResSlo.VerbForms ;
|
||||
V2 = ResSlo.VerbForms ** {c : ComplementCase} ;
|
||||
VS,VQ = ResSlo.VerbForms ;
|
||||
|
||||
A = ResSlo.AdjForms ;
|
||||
AP = ResSlo.Adjective ** {isPost : Bool} ; -- {s : Gender => Number => Case => Str}
|
||||
|
||||
38
src/slovak/ExtendSlo.gf
Normal file
38
src/slovak/ExtendSlo.gf
Normal 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 ;
|
||||
|
||||
|
||||
}
|
||||
@@ -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 ->
|
||||
personalPron a ** {poss = possessivePron a} ;
|
||||
|
||||
@@ -24,6 +24,7 @@ lin
|
||||
youSg_Pron = mkPron (Ag (Masc Anim) Sg P2) ;
|
||||
he_Pron = mkPron (Ag (Masc Anim) Sg P3) ;
|
||||
she_Pron = mkPron (Ag Fem Sg P3) ;
|
||||
it_Pron = mkPron (Ag Neutr Sg P3) ;
|
||||
we_Pron = mkPron (Ag (Masc Anim) Pl P1) ;
|
||||
youPl_Pron = mkPron (Ag (Masc Anim) Pl P2) ;
|
||||
they_Pron = mkPron (Ag (Masc Anim) Pl P3) ;
|
||||
|
||||
@@ -12,14 +12,16 @@ concrete ExtendSwe of Extend = CatSwe **
|
||||
ICompAP,ProDrop,EmbedSSlash,
|
||||
AdAdV, PositAdVAdj, GerundCN, GerundNP, GerundAdv, PresPartAP, PastPartAP, PastPartAgentAP,
|
||||
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,
|
||||
UttAccNP
|
||||
]
|
||||
with (Grammar = GrammarSwe)
|
||||
**
|
||||
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 ;
|
||||
|
||||
@@ -207,6 +209,8 @@ concrete ExtendSwe of Extend = CatSwe **
|
||||
Cons_rr_RNP x xs = consrTable Agr comma x xs ;
|
||||
Cons_nr_RNP x xs = consrTable Agr comma {s = \\a => x.s ! NPAcc} xs ;
|
||||
|
||||
ReflPossPron = M.mkQuant "sin" "sitt" "sina" ;
|
||||
|
||||
lin
|
||||
ApposNP np1 np2 = {s = \\nform => np1.s ! nform ++ comma ++ np2.s ! nform; a = np1.a; isPron = False} ;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user