forked from GitHub/gf-rgl
Merge branch 'master' of github.com:GrammaticalFramework/gf-rgl
This commit is contained in:
@@ -92,7 +92,8 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in {
|
|||||||
N = ResAra.Noun ;
|
N = ResAra.Noun ;
|
||||||
N2 = ResAra.Noun2 ;
|
N2 = ResAra.Noun2 ;
|
||||||
N3 = ResAra.Noun3 ;
|
N3 = ResAra.Noun3 ;
|
||||||
GN, SN, LN, PN = {s : Case => Str; g : Gender; h : Species} ;
|
GN, SN, PN = {s : Case => Str; g : Gender; h : Species} ;
|
||||||
|
LN = ResAra.NP ;
|
||||||
|
|
||||||
linref
|
linref
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--# -path=.:../abstract:../common
|
--# -path=.:../abstract:../common
|
||||||
|
|
||||||
-- documenting Arabic inflection
|
-- documenting Arabic inflection
|
||||||
---- so far with English titles and tags, AR 2024-01-31
|
---- so far with English titles and tags, AR 2024-01-31
|
||||||
@@ -32,7 +32,7 @@ lin
|
|||||||
)
|
)
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
InflectionPN, InflectionLN, InflectionGN, InflectionSN = \pn -> { ---- TODO: special for LN, GN, SN
|
InflectionPN, InflectionGN, InflectionSN = \pn -> { ---- TODO: special for LN, GN, SN
|
||||||
t = "pn" ;
|
t = "pn" ;
|
||||||
s1 = heading1 ("Proper Name" ++
|
s1 = heading1 ("Proper Name" ++
|
||||||
case pn.g of {
|
case pn.g of {
|
||||||
|
|||||||
@@ -9,11 +9,10 @@ lin FullName gn sn = emptyNP ** {
|
|||||||
a = {pgn = Per3 gn.g Sg ; isPron = False} ;
|
a = {pgn = Per3 gn.g Sg ; isPron = False} ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
lin UseLN pn = emptyNP ** {
|
lin UseLN ln = ln ;
|
||||||
s = pn.s ;
|
|
||||||
a = {pgn = Per3 pn.g Sg ; isPron = False} ;
|
|
||||||
} ;
|
|
||||||
|
|
||||||
lin InLN n = A.PrepNP S.in_Prep (N.UsePN n) ; ---- TODO: alternative prepositions
|
lin PlainLN ln = ln ;
|
||||||
|
|
||||||
|
lin InLN n = A.PrepNP S.in_Prep n ; ---- TODO: alternative prepositions
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ resource ParadigmsAra = open
|
|||||||
ResAra,
|
ResAra,
|
||||||
OrthoAra,
|
OrthoAra,
|
||||||
(A=AdjectiveAra),
|
(A=AdjectiveAra),
|
||||||
|
(N=NounAra),
|
||||||
CatAra
|
CatAra
|
||||||
in {
|
in {
|
||||||
|
|
||||||
@@ -97,12 +98,17 @@ resource ParadigmsAra = open
|
|||||||
|
|
||||||
mkLN = overload {
|
mkLN = overload {
|
||||||
mkLN : Str -> LN -- Predictable LN from a Str: fem hum if ends in ة, otherwise masc hum.
|
mkLN : Str -> LN -- Predictable LN from a Str: fem hum if ends in ة, otherwise masc hum.
|
||||||
= \s -> lin LN (smartPN s) ;
|
= \s -> lin LN (N.UsePN (smartPN s)) ;
|
||||||
|
mkLN : Str -> Gender -> LN
|
||||||
|
= \s, g -> lin LN (N.UsePN (smartPN s ** {g = g})) ;
|
||||||
mkLN : N -> LN -- Make a LN out of N. The LN is in construct state.
|
mkLN : N -> LN -- Make a LN out of N. The LN is in construct state.
|
||||||
= \n -> lin LN (n ** {
|
= \n -> lin LN (N.MassNP (N.UseN n)) ;
|
||||||
s = \\c => n.s ! Sg ! Const ! c
|
----(n ** { ---- cannot get this to compile AR 2024-04-18
|
||||||
++ n.s2 ! Sg ! Def ! c -- NB this hack works for idaafa constructions (if you used mkN : N -> N -> N), but wrong for mkN : N -> A -> N. /IL
|
---- s = \\c => n.s ! Sg ! Const ! c
|
||||||
}) ;
|
---- ++ n.s2 ! Sg ! Def ! c -- NB this hack works for idaafa constructions (if you used mkN : N -> N -> N), but wrong for mkN : N -> A -> N. /IL
|
||||||
|
---- }))) ;
|
||||||
|
mkLN : NP -> LN
|
||||||
|
= \np -> np ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
--3 Relational nouns
|
--3 Relational nouns
|
||||||
|
|||||||
@@ -6,4 +6,6 @@ lin
|
|||||||
s = prep.s ++ np.prep ! prep.c
|
s = prep.s ++ np.prep ! prep.c
|
||||||
} ;
|
} ;
|
||||||
AdnCAdv a = a ;
|
AdnCAdv a = a ;
|
||||||
|
|
||||||
|
SubjS subj s = {s = subj.s ++ s.s} ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ concrete CatHrv of Cat =
|
|||||||
|
|
||||||
RS = {s : Agr => Str} ;
|
RS = {s : Agr => Str} ;
|
||||||
RCl = {subj,clit,compl : Agr => Str ; verb : VerbForms} ; ---- RAgr with composite RP
|
RCl = {subj,clit,compl : Agr => Str ; verb : VerbForms} ; ---- RAgr with composite RP
|
||||||
RP = AdjForms ;
|
RP = {s : Gender => Number => Case => Str} ; -- same as AP
|
||||||
|
|
||||||
VP = {verb : VerbForms ; clit,compl : Agr => Str} ; ---- more fields probably needed
|
VP = {verb : VerbForms ; clit,compl : Agr => Str} ; ---- more fields probably needed
|
||||||
VPSlash = {verb : VerbForms ; clit,compl : Agr => Str ; c : ComplementCase} ; ----
|
VPSlash = {verb : VerbForms ; clit,compl : Agr => Str ; c : ComplementCase} ; ----
|
||||||
@@ -33,10 +33,12 @@ concrete CatHrv of Cat =
|
|||||||
AdA = {s : Str} ;
|
AdA = {s : Str} ;
|
||||||
|
|
||||||
N = ResHrv.NounForms ** {g : Gender} ;
|
N = ResHrv.NounForms ** {g : Gender} ;
|
||||||
|
N2 = ResHrv.NounForms ** {g : Gender ; c : ComplementCase} ;
|
||||||
CN = ResHrv.Noun ; -- {s : Number => Case => Str ; g : Gender}
|
CN = ResHrv.Noun ; -- {s : Number => Case => Str ; g : Gender}
|
||||||
NP = {s,clit,prep : Case => Str ; a : Agr ; hasClit : Bool} ; -- clit,prep differ for pronouns
|
NP = {s,clit,prep : Case => Str ; a : Agr ; hasClit : Bool} ; -- clit,prep differ for pronouns
|
||||||
PN = {s : Case => Str ; g : Gender} ;
|
PN = {s : Case => Str ; g : Gender} ;
|
||||||
Det = Determiner ; -- {s : Gender => Case => Str ; size : NumSize} ; -- can contain a numeral, therefore NumSize
|
Det = Determiner ; -- {s : Gender => Case => Str ; size : NumSize} ; -- can contain a numeral, therefore NumSize
|
||||||
|
Predet = {s : Gender => Number => Case => Str} ; -- same as AP
|
||||||
Quant = {s : Gender => Number => Case => Str} ; -- same as AP
|
Quant = {s : Gender => Number => Case => Str} ; -- same as AP
|
||||||
Num = Determiner ;
|
Num = Determiner ;
|
||||||
Card = Determiner ; -- {s : Gender => Case => Str ; size : NumSize} ;
|
Card = Determiner ; -- {s : Gender => Case => Str ; size : NumSize} ;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ concrete ExtendHrv of Extend = CatHrv **
|
|||||||
--- ReflPossPron
|
--- ReflPossPron
|
||||||
CardCNCard
|
CardCNCard
|
||||||
---- constant not found (yet)
|
---- constant not found (yet)
|
||||||
|
,GenRP
|
||||||
,youPolFem_Pron
|
,youPolFem_Pron
|
||||||
,UttVPShort
|
,UttVPShort
|
||||||
,UttAccIP
|
,UttAccIP
|
||||||
@@ -32,14 +33,19 @@ concrete ExtendHrv of Extend = CatHrv **
|
|||||||
with (Grammar = GrammarHrv)
|
with (Grammar = GrammarHrv)
|
||||||
**
|
**
|
||||||
open
|
open
|
||||||
ResHrv
|
ResHrv, ParadigmsHrv
|
||||||
in {
|
in {
|
||||||
|
|
||||||
---lin ReflPossPron = justDemPronFormsAdjective reflPossessivePron ;
|
---lin ReflPossPron = justDemPronFormsAdjective reflPossessivePron ;
|
||||||
|
|
||||||
lin CardCNCard card cn = {
|
lin
|
||||||
s = \\g,c => card.s ! g ! c ++ numSizeForm cn.s card.size c ;
|
CardCNCard card cn = {
|
||||||
size = NS_20_
|
s = \\g,c => card.s ! g ! c ++ numSizeForm cn.s card.size c ;
|
||||||
} ;
|
size = NS_20_
|
||||||
|
} ;
|
||||||
|
|
||||||
|
GenRP num cn = {
|
||||||
|
s = \\g, n, c => (adjFormsAdjective (mkA "čiji").posit).s ! g ! n ! c ++ num.s ! cn.g ! c ++ cn.s ! n ! c
|
||||||
|
} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,4 +10,13 @@ lin
|
|||||||
|
|
||||||
ExistNPAdv np adv = ExistNP np ** {compl = adv.s} ;
|
ExistNPAdv np adv = ExistNP np ** {compl = adv.s} ;
|
||||||
|
|
||||||
|
ImpersCl vp =
|
||||||
|
let npa = Ag Neutr Sg P3 in {
|
||||||
|
subj = "" ;
|
||||||
|
verb = vp.verb ;
|
||||||
|
clit = vp.clit ! npa ;
|
||||||
|
compl = vp.compl ! npa ;
|
||||||
|
a = npa ;
|
||||||
|
} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,10 @@ oper AdAdv : AdA -> Adv -> Adv = notYet "AdAdv" ;
|
|||||||
oper AdVVP : AdV -> VP -> VP = notYet "AdVVP" ;
|
oper AdVVP : AdV -> VP -> VP = notYet "AdVVP" ;
|
||||||
oper AdvIAdv : IAdv -> Adv -> IAdv = notYet "AdvIAdv" ;
|
oper AdvIAdv : IAdv -> Adv -> IAdv = notYet "AdvIAdv" ;
|
||||||
oper AdvIP : IP -> Adv -> IP = notYet "AdvIP" ;
|
oper AdvIP : IP -> Adv -> IP = notYet "AdvIP" ;
|
||||||
oper AdvS : Adv -> S -> S = notYet "AdvS" ;
|
|
||||||
oper AdvSlash : ClSlash -> Adv -> ClSlash = notYet "AdvSlash" ;
|
oper AdvSlash : ClSlash -> Adv -> ClSlash = notYet "AdvSlash" ;
|
||||||
oper CAdvAP : CAdv -> AP -> NP -> AP = notYet "CAdvAP" ;
|
oper CAdvAP : CAdv -> AP -> NP -> AP = notYet "CAdvAP" ;
|
||||||
oper CleftAdv : Adv -> S -> Cl = notYet "CleftAdv" ;
|
oper CleftAdv : Adv -> S -> Cl = notYet "CleftAdv" ;
|
||||||
oper CleftNP : NP -> RS -> Cl = notYet "CleftNP" ;
|
oper CleftNP : NP -> RS -> Cl = notYet "CleftNP" ;
|
||||||
oper CompCN : CN -> Comp = notYet "CompCN" ;
|
|
||||||
oper CompIAdv : IAdv -> IComp = notYet "CompIAdv" ;
|
oper CompIAdv : IAdv -> IComp = notYet "CompIAdv" ;
|
||||||
oper CompIP : IP -> IComp = notYet "CompIP" ;
|
oper CompIP : IP -> IComp = notYet "CompIP" ;
|
||||||
oper ComparAdvAdj : CAdv -> A -> NP -> Adv = notYet "ComparAdvAdj" ;
|
oper ComparAdvAdj : CAdv -> A -> NP -> Adv = notYet "ComparAdvAdj" ;
|
||||||
@@ -34,14 +32,12 @@ oper IdetIP : IDet -> IP = notYet "IdetIP" ;
|
|||||||
oper IdetQuant : IQuant -> Num -> IDet = notYet "IdetQuant" ;
|
oper IdetQuant : IQuant -> Num -> IDet = notYet "IdetQuant" ;
|
||||||
oper ImpPl1 : VP -> Utt = notYet "ImpPl1" ;
|
oper ImpPl1 : VP -> Utt = notYet "ImpPl1" ;
|
||||||
oper ImpVP : VP -> Imp = notYet "ImpVP" ;
|
oper ImpVP : VP -> Imp = notYet "ImpVP" ;
|
||||||
oper ImpersCl : VP -> Cl = notYet "ImpersCl" ;
|
|
||||||
oper OrdDigits : Digits -> Ord = notYet "OrdDigits" ;
|
oper OrdDigits : Digits -> Ord = notYet "OrdDigits" ;
|
||||||
oper OrdNumeral : Numeral -> Ord = notYet "OrdNumeral" ;
|
oper OrdNumeral : Numeral -> Ord = notYet "OrdNumeral" ;
|
||||||
oper PPartNP : NP -> V2 -> NP = notYet "PPartNP" ;
|
oper PPartNP : NP -> V2 -> NP = notYet "PPartNP" ;
|
||||||
oper PassV2 : V2 -> VP = notYet "PassV2" ;
|
oper PassV2 : V2 -> VP = notYet "PassV2" ;
|
||||||
oper PositAdvAdj : A -> Adv = notYet "PositAdvAdj" ;
|
oper PositAdvAdj : A -> Adv = notYet "PositAdvAdj" ;
|
||||||
oper PredSCVP : SC -> VP -> Cl = notYet "PredSCVP" ;
|
oper PredSCVP : SC -> VP -> Cl = notYet "PredSCVP" ;
|
||||||
oper PredetNP : Predet -> NP -> NP = notYet "PredetNP" ;
|
|
||||||
oper PrepIP : Prep -> IP -> IAdv = notYet "PrepIP" ;
|
oper PrepIP : Prep -> IP -> IAdv = notYet "PrepIP" ;
|
||||||
oper ProgrVP : VP -> VP = notYet "ProgrVP" ;
|
oper ProgrVP : VP -> VP = notYet "ProgrVP" ;
|
||||||
oper QuestIAdv : IAdv -> Cl -> QCl = notYet "QuestIAdv" ;
|
oper QuestIAdv : IAdv -> Cl -> QCl = notYet "QuestIAdv" ;
|
||||||
@@ -66,7 +62,6 @@ oper SlashV2VNP : V2V -> NP -> VPSlash -> VPSlash = notYet "SlashV2VNP" ;
|
|||||||
oper SlashVP : NP -> VPSlash -> ClSlash = notYet "SlashVP" ;
|
oper SlashVP : NP -> VPSlash -> ClSlash = notYet "SlashVP" ;
|
||||||
oper SlashVS : NP -> VS -> SSlash -> ClSlash = notYet "SlashVS" ;
|
oper SlashVS : NP -> VS -> SSlash -> ClSlash = notYet "SlashVS" ;
|
||||||
oper SlashVV : VV -> VPSlash -> VPSlash = notYet "SlashVV" ;
|
oper SlashVV : VV -> VPSlash -> VPSlash = notYet "SlashVV" ;
|
||||||
oper SubjS : Subj -> S -> Adv = notYet "SubjS" ;
|
|
||||||
oper TCond : Tense = notYet "TCond" ;
|
oper TCond : Tense = notYet "TCond" ;
|
||||||
oper TFut : Tense = notYet "TFut" ;
|
oper TFut : Tense = notYet "TFut" ;
|
||||||
oper Use2N3 : N3 -> N2 = notYet "Use2N3" ;
|
oper Use2N3 : N3 -> N2 = notYet "Use2N3" ;
|
||||||
|
|||||||
@@ -63,6 +63,15 @@ lin
|
|||||||
g = cn.g
|
g = cn.g
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
PredetNP predet np =
|
||||||
|
case np.a of {
|
||||||
|
Ag g n _ => {
|
||||||
|
s,clit,prep = \\c => predet.s ! g ! n ! c ++ np.s ! c ;
|
||||||
|
a = np.a ;
|
||||||
|
hasClit = False
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
RelCN cn rs = {
|
RelCN cn rs = {
|
||||||
s = \\n,c => cn.s ! n ! c ++ rs.s ! Ag cn.g n P3 ;
|
s = \\n,c => cn.s ! n ! c ++ rs.s ! Ag cn.g n P3 ;
|
||||||
g = cn.g
|
g = cn.g
|
||||||
|
|||||||
@@ -6,13 +6,12 @@ concrete RelativeHrv of Relative = CatHrv ** open
|
|||||||
lin
|
lin
|
||||||
RelVP rp vp = vp ** {
|
RelVP rp vp = vp ** {
|
||||||
subj =
|
subj =
|
||||||
let rel = (adjFormsAdjective rp).s
|
let rel = rp.s
|
||||||
in \\a => case a of {
|
in \\a => case a of {
|
||||||
Ag g n _ => rel ! g ! n ! Nom
|
Ag g n _ => rel ! g ! n ! Nom
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
IdRP = (mkA "koji").posit ;
|
IdRP = adjFormsAdjective (mkA "koji").posit ;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,4 +29,8 @@ lin
|
|||||||
rcl.compl ! a ;
|
rcl.compl ! a ;
|
||||||
} ; ---- TODO tenses
|
} ; ---- TODO tenses
|
||||||
|
|
||||||
|
|
||||||
|
AdvS adv s = {s = adv.s ++ s.s} ;
|
||||||
|
ExtAdvS adv s = {s = adv.s ++ Predef.BIND ++ "," ++ s.s} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,4 +31,17 @@ lin
|
|||||||
|
|
||||||
somewhere_Adv = mkAdv "negdje" ;
|
somewhere_Adv = mkAdv "negdje" ;
|
||||||
|
|
||||||
|
if_Subj = lin Subj {s = "ako"} ;
|
||||||
|
every_Det = {s = \\g, c => (adjFormsAdjective (velikA "svaki")).s ! g ! Sg ! c ; size = NS_1} ;
|
||||||
|
all_Predet = adjFormsAdjective (velikA "svi") ;
|
||||||
|
that_Subj = lin Subj {s = "da"} ;
|
||||||
|
someSg_Det = {s = \\g, c => (adjFormsAdjective (velikA "neki")).s ! g ! Sg ! c ; size = NS_1} ;
|
||||||
|
at_least_AdN = lin AdN {s = "najmanje"} ;
|
||||||
|
part_Prep = mkPrep genitive ;
|
||||||
|
|
||||||
|
|
||||||
|
-- ExtAdvS
|
||||||
|
-- mkN2
|
||||||
|
-- mkA2
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,12 @@ lin
|
|||||||
s = \\a_ => np.s ! Nom ;
|
s = \\a_ => np.s ! Nom ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
CompCN cn = {
|
||||||
|
s = \\a => case a of {
|
||||||
|
Ag _ n _ => cn.s ! n ! Nom
|
||||||
|
} ;
|
||||||
|
} ;
|
||||||
|
|
||||||
CompAdv adv = {
|
CompAdv adv = {
|
||||||
s = \\a_ => adv.s
|
s = \\a_ => adv.s
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ concrete CatFin of Cat = CommonX ** open ResFin, StemFin, Prelude in {
|
|||||||
linref
|
linref
|
||||||
SSlash = \ss -> ss.s ++ ss.c2.s.p1 ;
|
SSlash = \ss -> ss.s ++ ss.c2.s.p1 ;
|
||||||
ClSlash = \cls -> cls.s ! Pres ! Simul ! Pos ++ cls.c2.s.p1 ;
|
ClSlash = \cls -> cls.s ! Pres ! Simul ! Pos ++ cls.c2.s.p1 ;
|
||||||
NP = \np -> np.s ! NPAcc ; ----NPSep ;
|
NP = \np -> np.s ! NPCase Nom ; ----NPSep ;
|
||||||
CN = cnRef ;
|
CN = cnRef ;
|
||||||
|
|
||||||
VP = vpRef ;
|
VP = vpRef ;
|
||||||
|
|||||||
Reference in New Issue
Block a user