Merge branch 'master' of github.com:GrammaticalFramework/gf-rgl

This commit is contained in:
Krasimir Angelov
2024-05-07 12:43:24 +02:00
15 changed files with 79 additions and 28 deletions

View File

@@ -92,7 +92,8 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in {
N = ResAra.Noun ;
N2 = ResAra.Noun2 ;
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

View File

@@ -1,4 +1,4 @@
--# -path=.:../abstract:../common
--# -path=.:../abstract:../common
-- documenting Arabic inflection
---- 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" ;
s1 = heading1 ("Proper Name" ++
case pn.g of {

View File

@@ -9,11 +9,10 @@ lin FullName gn sn = emptyNP ** {
a = {pgn = Per3 gn.g Sg ; isPron = False} ;
} ;
lin UseLN pn = emptyNP ** {
s = pn.s ;
a = {pgn = Per3 pn.g Sg ; isPron = False} ;
} ;
lin UseLN ln = ln ;
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
}

View File

@@ -30,6 +30,7 @@ resource ParadigmsAra = open
ResAra,
OrthoAra,
(A=AdjectiveAra),
(N=NounAra),
CatAra
in {
@@ -97,12 +98,17 @@ resource ParadigmsAra = open
mkLN = overload {
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.
= \n -> lin LN (n ** {
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
}) ;
= \n -> lin LN (N.MassNP (N.UseN n)) ;
----(n ** { ---- cannot get this to compile AR 2024-04-18
---- 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

View File

@@ -6,4 +6,6 @@ lin
s = prep.s ++ np.prep ! prep.c
} ;
AdnCAdv a = a ;
SubjS subj s = {s = subj.s ++ s.s} ;
}

View File

@@ -18,7 +18,7 @@ concrete CatHrv of Cat =
RS = {s : Agr => Str} ;
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
VPSlash = {verb : VerbForms ; clit,compl : Agr => Str ; c : ComplementCase} ; ----
@@ -33,10 +33,12 @@ concrete CatHrv of Cat =
AdA = {s : Str} ;
N = ResHrv.NounForms ** {g : Gender} ;
N2 = ResHrv.NounForms ** {g : Gender ; c : ComplementCase} ;
CN = ResHrv.Noun ; -- {s : Number => Case => Str ; g : Gender}
NP = {s,clit,prep : Case => Str ; a : Agr ; hasClit : Bool} ; -- clit,prep differ for pronouns
PN = {s : Case => Str ; g : Gender} ;
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
Num = Determiner ;
Card = Determiner ; -- {s : Gender => Case => Str ; size : NumSize} ;

View File

@@ -3,6 +3,7 @@ concrete ExtendHrv of Extend = CatHrv **
--- ReflPossPron
CardCNCard
---- constant not found (yet)
,GenRP
,youPolFem_Pron
,UttVPShort
,UttAccIP
@@ -32,14 +33,19 @@ concrete ExtendHrv of Extend = CatHrv **
with (Grammar = GrammarHrv)
**
open
ResHrv
ResHrv, ParadigmsHrv
in {
---lin ReflPossPron = justDemPronFormsAdjective reflPossessivePron ;
lin CardCNCard card cn = {
lin
CardCNCard card cn = {
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
} ;
}

View File

@@ -10,4 +10,13 @@ lin
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 ;
} ;
}

View File

@@ -6,12 +6,10 @@ oper AdAdv : AdA -> Adv -> Adv = notYet "AdAdv" ;
oper AdVVP : AdV -> VP -> VP = notYet "AdVVP" ;
oper AdvIAdv : IAdv -> Adv -> IAdv = notYet "AdvIAdv" ;
oper AdvIP : IP -> Adv -> IP = notYet "AdvIP" ;
oper AdvS : Adv -> S -> S = notYet "AdvS" ;
oper AdvSlash : ClSlash -> Adv -> ClSlash = notYet "AdvSlash" ;
oper CAdvAP : CAdv -> AP -> NP -> AP = notYet "CAdvAP" ;
oper CleftAdv : Adv -> S -> Cl = notYet "CleftAdv" ;
oper CleftNP : NP -> RS -> Cl = notYet "CleftNP" ;
oper CompCN : CN -> Comp = notYet "CompCN" ;
oper CompIAdv : IAdv -> IComp = notYet "CompIAdv" ;
oper CompIP : IP -> IComp = notYet "CompIP" ;
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 ImpPl1 : VP -> Utt = notYet "ImpPl1" ;
oper ImpVP : VP -> Imp = notYet "ImpVP" ;
oper ImpersCl : VP -> Cl = notYet "ImpersCl" ;
oper OrdDigits : Digits -> Ord = notYet "OrdDigits" ;
oper OrdNumeral : Numeral -> Ord = notYet "OrdNumeral" ;
oper PPartNP : NP -> V2 -> NP = notYet "PPartNP" ;
oper PassV2 : V2 -> VP = notYet "PassV2" ;
oper PositAdvAdj : A -> Adv = notYet "PositAdvAdj" ;
oper PredSCVP : SC -> VP -> Cl = notYet "PredSCVP" ;
oper PredetNP : Predet -> NP -> NP = notYet "PredetNP" ;
oper PrepIP : Prep -> IP -> IAdv = notYet "PrepIP" ;
oper ProgrVP : VP -> VP = notYet "ProgrVP" ;
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 SlashVS : NP -> VS -> SSlash -> ClSlash = notYet "SlashVS" ;
oper SlashVV : VV -> VPSlash -> VPSlash = notYet "SlashVV" ;
oper SubjS : Subj -> S -> Adv = notYet "SubjS" ;
oper TCond : Tense = notYet "TCond" ;
oper TFut : Tense = notYet "TFut" ;
oper Use2N3 : N3 -> N2 = notYet "Use2N3" ;

View File

@@ -63,6 +63,15 @@ lin
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 = {
s = \\n,c => cn.s ! n ! c ++ rs.s ! Ag cn.g n P3 ;
g = cn.g

View File

@@ -6,13 +6,12 @@ concrete RelativeHrv of Relative = CatHrv ** open
lin
RelVP rp vp = vp ** {
subj =
let rel = (adjFormsAdjective rp).s
let rel = rp.s
in \\a => case a of {
Ag g n _ => rel ! g ! n ! Nom
}
} ;
IdRP = (mkA "koji").posit ;
IdRP = adjFormsAdjective (mkA "koji").posit ;
}

View File

@@ -29,4 +29,8 @@ lin
rcl.compl ! a ;
} ; ---- TODO tenses
AdvS adv s = {s = adv.s ++ s.s} ;
ExtAdvS adv s = {s = adv.s ++ Predef.BIND ++ "," ++ s.s} ;
}

View File

@@ -31,4 +31,17 @@ lin
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
}

View File

@@ -37,6 +37,12 @@ lin
s = \\a_ => np.s ! Nom ;
} ;
CompCN cn = {
s = \\a => case a of {
Ag _ n _ => cn.s ! n ! Nom
} ;
} ;
CompAdv adv = {
s = \\a_ => adv.s
} ;

View File

@@ -104,7 +104,7 @@ concrete CatFin of Cat = CommonX ** open ResFin, StemFin, Prelude in {
linref
SSlash = \ss -> ss.s ++ ss.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 ;
VP = vpRef ;