1
0
forked from GitHub/gf-rgl

Merge pull request #114 from inariksit/arabic

Arabic
This commit is contained in:
Inari Listenmaa
2018-12-31 20:26:58 +02:00
committed by GitHub
17 changed files with 86 additions and 64 deletions

View File

@@ -69,11 +69,6 @@ oper
s2 = x.s
} ;
conjunctTable5 :
(P,Q,R,T,S : PType) -> Conjunction -> ListTable5 P Q R T S -> {s : P => Q => R => T => S => Str} =
\P,Q,R,T,S,or,xs ->
{s = \\p,q,r,t,s => xs.s1 ! p ! q ! r ! t ! s ++ or.s ++ xs.s2 ! p ! q ! r ! t ! s} ;
conjunctDistrTable5 :
(P,Q,R,T,S : PType) -> ConjunctionDistr -> ListTable5 P Q R T S ->
{s : P => Q => R => T => S => Str} =

View File

@@ -46,10 +46,19 @@ lin
intYear = symb ;
intMonthday = symb ;
-- n_units_AP
-- : Card -> CN -> A -> AP
n_units_AP card cn a =
let ap = mkAP a in ap ** {
s = \\s,g,n,d,c =>
ap.s ! s ! g ! n ! d ! c
++ (mkAdv R.biPrep (mkNP amount_N)).s
++ (mkNP card cn).s ! R.Bare ---- ? /IL
} ;
oper
amount_N : N = mkN "مِقْدَار" "مَقَادِير‎" masc nohum ;
-- hack used in the name constructions
toNP : Bool -> NP -> NP = \b -> if_then_else NP b R.emptyNP ;

View File

@@ -9,5 +9,3 @@ concrete LangAra of Lang =
flags startcat = Phr ; unlexer = text ; lexer = text ; coding = utf8 ;
}

View File

@@ -23,7 +23,6 @@ oper ReflA2 : A2 -> AP = notYet "ReflA2" ;
oper ReflVP : VPSlash -> VP = notYet "ReflVP" ;
oper SentCN : CN -> SC -> CN = notYet "SentCN" ;
oper SlashPrep : Cl -> Prep -> ClSlash = notYet "SlashPrep" ;
oper Slash2V3 : V3 -> NP -> VPSlash = notYet "Slash2V3" ;
oper SlashV2A : V2A -> AP -> VPSlash = notYet "SlashV2A" ;
oper SlashV2Q : V2Q -> QS -> VPSlash = notYet "SlashV2Q" ;
oper SlashV2S : V2S -> S -> VPSlash = notYet "SlashV2S" ;

View File

@@ -27,7 +27,7 @@ lincat
lin n5 = num3_10 "خَمس" "خامِس";
lin n6 = num3_10 "سِتّ" "سادِس";
lin n7 = num3_10 "سَبع" "سابِع";
lin n8 = num3_10 "ثَمانِي" "ثامِن";
lin n8 = num3_10 "ثَمَانِي" "ثامِن";
lin n9 = num3_10 "تِسع" "تاسِع";
lin pot01 = mkNum "واحِد" "أَوَّل" "أُولى" ** { n = One } ;

View File

@@ -148,6 +148,13 @@ resource ParadigmsAra = open
= \r -> lin A (clrA r);
mkA : (root,sg,pl : Str) -> A -- adjective with broken plural
= \r,s,p -> lin A (brkA r s p) ;
mkA : A -> Str -> A = \a,s -> a ** { -- add non-inflecting component after adjective
s = table {af => a.s ! af ++ s}
} ;
mkA : Str -> A -> A = \s,a -> a ** { -- add non-inflecting component before adjective
s = table {af => s ++ a.s ! af}
}
} ;
idaafaA : N -> A -> A ; -- first argument will be in constructus but inflect in case, adjective in genitive, but inflect in gender, number and definiteness. e.g. غَيْرُ طَيِّبٍ
@@ -276,10 +283,10 @@ resource ParadigmsAra = open
-- questions, verb phrases, and adjectives.
mkV0 : V -> V0 ;
-- mkVS = overload {
-- mkVS : V -> VS ;
-- mkVS : V -> Str -> VS
-- } ;
mkVS : overload {
mkVS : V -> VS ;
mkVS : V -> Str -> VS
} ;
mkV2S : V -> Str -> V2S ;
mkVV = overload {
mkVV : V -> VV = regVV ;

View File

@@ -20,8 +20,6 @@ concrete QuestionAra of Question = CatAra ** open ResAra, ParamX, Prelude, VerbA
cl = PredVP np vp ;
in { s = \\t,p,qf => cl.s ! t ! p ! toOrder qf } ;
---- AR guessed
QuestIAdv iadv cl = {s = \\t,p,qf => iadv.s ++ cl.s ! t ! p ! toOrder qf} ;

View File

@@ -1721,8 +1721,9 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
insertObj : NP -> VPSlash -> VP = \np,vp -> vp ** {
obj = {s = vp.obj.s -- old object, if there was one
++ bindIfPron np vp -- new object, bind if pronoun and not pred
++ vp.agrObj ! np.a.pgn ; -- only used for SlashV2V
a = agrLite np.a}
++ vp.agrObj ! np.a.pgn ; -- only used for SlashV2V and Slash3V3
a = agrLite np.a} ;
agrObj = \\_ => []
} ;
bindIf : Bool -> Str = \b -> if_then_Str b BIND [] ;

View File

@@ -35,7 +35,22 @@ concrete VerbAra of Verb = CatAra ** open Prelude, ResAra, ParamX in {
} ;
SlashV2a = slashV2 ;
Slash3V3 v np = insertObj np (slashV2 v) ** {c2 = v.c3 ; agrObj = \\_ => []};
Slash2V3 v np = insertObj np (slashV2 v) ** {c2 = v.c3 ; agrObj = \\_ => []};
Slash3V3 v np =
let vp = slashV2 v ** {c2 =
v.c2 ** {
s = case np.a.isPron of {
True => case v.c2.binds of {
True => v.c2.s ; -- to make sure there's something for the object to attach to
False => v.c2.s ++ "إِيَّا" } ; -- see https://en.wiktionary.org/wiki/%D8%A5%D9%8A%D8%A7#Particle /IL
False => v.c2.s }
}
}
in vp ** {
c2 = v.c3 ;
agrObj = \\_ => bindIfPron np vp -- will be emptied when insertObj is called /IL
} ;
ComplSlash vp np = insertObj np vp ;