1
0
forked from GitHub/gf-rgl

Merge pull request #196 from inariksit/persian

Persian
This commit is contained in:
Inari Listenmaa
2019-03-13 16:24:58 +01:00
committed by GitHub
5 changed files with 30 additions and 22 deletions

View File

@@ -1,4 +1,4 @@
concrete CatPes of Cat = CommonX - [Adv] ** open ResPes, Prelude in { concrete CatPes of Cat = CommonX ** open ResPes, Prelude in {
flags optimize=all_subs ; flags optimize=all_subs ;
@@ -44,9 +44,6 @@ concrete CatPes of Cat = CommonX - [Adv] ** open ResPes, Prelude in {
VPSlash = ResPes.VPHSlash ; VPSlash = ResPes.VPHSlash ;
Comp = {s : Agr => Str} ; Comp = {s : Agr => Str} ;
---- Adv
Adv = {s : Str} ;
---- Adjective ---- Adjective
AP = ResPes.Adjective ; AP = ResPes.Adjective ;

View File

@@ -3,6 +3,7 @@
concrete ExtendPes of Extend = concrete ExtendPes of Extend =
CatPes ** ExtendFunctor - [ CatPes ** ExtendFunctor - [
GenNP, ApposNP, ICompAP GenNP, ApposNP, ICompAP
,GerundNP,GerundCN,GerundAdv
] ]
with (Grammar=GrammarPes) with (Grammar=GrammarPes)
** open Prelude, ResPes in { ** open Prelude, ResPes in {
@@ -20,4 +21,13 @@ lin
} ; } ;
ICompAP ap = {s = "چقدر" ++ ap.s ! Bare} ; ICompAP ap = {s = "چقدر" ++ ap.s ! Bare} ;
-- : VP -> CN ; -- publishing of the document (can get a determiner)
GerundCN vp = useN (indeclN (showVPH Inf defaultAgr vp)) ;
-- : VP -> NP ; -- publishing the document (by nature definite)
GerundNP vp = indeclNP (showVPH Inf defaultAgr vp) ;
-- : VP -> Adv ; -- publishing the document (prepositionless adverb)
GerundAdv vp = lin Adv {s = showVPH Inf defaultAgr vp} ;
} }

View File

@@ -12,14 +12,12 @@
ConjunctionPes, ConjunctionPes,
PhrasePes, PhrasePes,
TextPes - [Adv], TextPes,
StructuralPes, StructuralPes,
TenseX - [Adv], TenseX,
IdiomPes IdiomPes
** { ** {
flags startcat = Phr ; unlexer = text ; lexer = text ; flags startcat = Phr ; unlexer = text ; lexer = text ;
} }

View File

@@ -97,7 +97,7 @@ oper
isCmpd : CmpdStatus -- Affects possession: awkward to use poss. suff. with compound nouns isCmpd : CmpdStatus -- Affects possession: awkward to use poss. suff. with compound nouns
} ; } ;
mkN : (x1,x2 : Str) -> Animacy -> Noun = \sg,pl,ani -> { mkN : (x1,x2 : Str) -> Animacy -> Noun = \sg,pl,ani -> indeclN sg ** {
s = table { s = table {
Sg => table {Bare => sg ; Sg => table {Bare => sg ;
Ezafe => mkEzafe sg ; Ezafe => mkEzafe sg ;
@@ -106,10 +106,13 @@ oper
Pl => table {Bare => pl ; Pl => table {Bare => pl ;
Ezafe => mkEzafe pl ; Ezafe => mkEzafe pl ;
Clitic => mkEnclic pl ; Clitic => mkEnclic pl ;
Poss => mkPossStem pl } Poss => mkPossStem pl }}
} ; } ;
animacy = ani ; isCmpd = NotCmpd
} ; indeclN : Str -> Noun = \s -> {
s = \\_,_ => s ;
animacy = Inanimate ; isCmpd = NotCmpd
} ;
-- masculine nouns end with alif, choTi_hay, ain Translitration: (a, h, e) -- masculine nouns end with alif, choTi_hay, ain Translitration: (a, h, e)
-- Arabic nouns ends with h. also taken as Masc -- Arabic nouns ends with h. also taken as Masc

View File

@@ -12,8 +12,8 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in {
<IsCmpd,Poss> => Ezafe ; -- If CN is compound and Det is poss.pron, don't use poss.suff but Ezafe and full form of pronoun <IsCmpd,Poss> => Ezafe ; -- If CN is compound and Det is poss.pron, don't use poss.suff but Ezafe and full form of pronoun
_ => det.mod } ; _ => det.mod } ;
detStr : Str = case cn.isCmpd of { detStr : Str = case cn.isCmpd of {
IsCmpd => det.sp ; NotCmpd => det.s ; -- possessive suffix
NotCmpd => det.sp } ; IsCmpd => det.sp } ; -- full form
in case mod of { in case mod of {
Bare => detStr ++ cn.s ! num ! m ; -- det doesn't require a special form, keep the Mod=>Str table Bare => detStr ++ cn.s ! num ! m ; -- det doesn't require a special form, keep the Mod=>Str table
x => cn.s ! num ! x ++ detStr } ; -- det requires a special form x => cn.s ! num ! x ++ detStr } ; -- det requires a special form
@@ -42,7 +42,7 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in {
DetQuantOrd quant num ord = { DetQuantOrd quant num ord = {
s = quant.s ! num.n ! NotCmpd ++ num.s ++ ord.s ; s = quant.s ! num.n ! NotCmpd ++ num.s ++ ord.s ;
sp = quant.s ! num.n ! IsCmpd ; -- only matters for PossPron sp = quant.s ! num.n ! IsCmpd ++ num.s ++ ord.s ; -- only matters for PossPron
isNum = orB num.isNum ord.isNum ; isNum = orB num.isNum ord.isNum ;
mod = quant.mod ; mod = quant.mod ;
n = num.n n = num.n
@@ -50,7 +50,7 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in {
DetQuant quant num = { DetQuant quant num = {
s = quant.s ! num.n ! NotCmpd ++ num.s ; s = quant.s ! num.n ! NotCmpd ++ num.s ;
sp = quant.s ! num.n ! IsCmpd ; -- only matters for PossPron sp = quant.s ! num.n ! IsCmpd ++ num.s ; -- only matters for PossPron
isNum = num.isNum; isNum = num.isNum;
mod = quant.mod ; mod = quant.mod ;
n = num.n n = num.n