1
0
forked from GitHub/gf-rgl

Merge pull request #23 from inariksit/arabic

Arabic: bugfixes + GenNP
This commit is contained in:
Inari Listenmaa
2018-09-21 09:47:08 +02:00
committed by GitHub
5 changed files with 25 additions and 5 deletions

20
src/arabic/ExtendAra.gf Normal file
View File

@@ -0,0 +1,20 @@
--# -path=.:../common:../abstract
concrete ExtendAra of Extend =
CatAra ** ExtendFunctor - [
GenNP, SlashBareV2S, PredAPVP, GenModNP, ExistsNP,
StrandRelSlash, ExistPluralCN, ExistMassCN, ExistCN, EmptyRelSlash, DetNPMasc, DetNPFem,
ComplBareVS, ComplDirectVS, ComplDirectVQ
]
with (Grammar=GrammarAra)
** open
Prelude,
ResAra
in {
lin
GenNP np = { s = \\_,_,_,_ => np.s ! Gen ; d = Const ; isNum, isPron = False } ;
} ;

View File

@@ -8,12 +8,12 @@ lin
number = sizeToNumber det.n; number = sizeToNumber det.n;
determiner : Case -> Str = \c -> determiner : Case -> Str = \c ->
det.s ! cn.h ! (detGender cn.g det.n) ! c; det.s ! cn.h ! (detGender cn.g det.n) ! c;
noun : Case -> Str = \c -> cn.s ! noun : Case -> NTable -> Str = \c,nt -> nt !
number ! (nounState det.d number) ! (nounCase c det.n det.d) number ! (nounState det.d number) ! (nounCase c det.n det.d)
} in { } in {
s = \\c => s = \\c =>
case cnB4det det.isPron det.isNum det.n det.d of { case cnB4det det.isPron det.isNum det.n det.d of {
False => determiner c ++ noun c; False => determiner c ++ noun c cn.s ++ noun c cn.adj ;
--FIXME use the adj -> cn -> cn rule from below instead of --FIXME use the adj -> cn -> cn rule from below instead of
--repeating code --repeating code
True => cn.s ! number ! det.d ! c ++ det.s ! cn.h ! cn.g ! c True => cn.s ! number ! det.d ! c ++ det.s ! cn.h ! cn.g ! c

View File

@@ -8,7 +8,7 @@ concrete QuestionAra of Question = CatAra ** open ResAra, ParamX, Prelude, VerbA
s = \\t,p => s = \\t,p =>
table { table {
QIndir => "إِذا" ++ cl.s ! t ! p ! Verbal ; QIndir => "إِذا" ++ cl.s ! t ! p ! Verbal ;
QDir => cl.s ! t ! p ! Verbal QDir => "هَل" ++ cl.s ! t ! p ! Verbal
} }
}; };

View File

@@ -1095,7 +1095,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
}; };
insertStr : Str -> VP -> VP = \str,vp -> vp ** insertStr : Str -> VP -> VP = \str,vp -> vp **
{ s2 = str }; { s2 = vp.s2 ++ str };
kaan : {s : AAgr => Case => Str} -> VP = \xabar -> kaan : {s : AAgr => Case => Str} -> VP = \xabar ->
insertPred xabar (predV (v1hollow {f = "ك"; c = "و" ; l = "ن"} u) ); insertPred xabar (predV (v1hollow {f = "ك"; c = "و" ; l = "ن"} u) );

View File

@@ -120,7 +120,7 @@ concrete SentenceAra of Sentence = CatAra ** open
UseQCl t ap qcl = --{s = cl.s ! t ! p ! Verbal } ; UseQCl t ap qcl = --{s = cl.s ! t ! p ! Verbal } ;
{s = {s =
table { table {
QDir => "هَل" ++ qcl.s ! ResAra.Pres ! ap.p ! QDir; QDir => qcl.s ! ResAra.Pres ! ap.p ! QDir;
QIndir => qcl.s ! ResAra.Pres ! ap.p ! QIndir QIndir => qcl.s ! ResAra.Pres ! ap.p ! QIndir
} }
{- case t of { {- case t of {