Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
# Table of irregular verbs
# irregular verbs have common forms
# جدول الأفعال عربية الشاذة،
# مثل الفعل رأى، أرى، أخذ أكل، سأل
#الأفعال المثال
# كل سطر يحتوي على جذوع تصريف الفعل
# في زمن معين
IRREGULAR_VERB_CONJUG = {}
CONJUG_BAB = u"باب التصريف"
# في الحركات، الحركة الأولى هي لحركة حرف المضارعة
IRREGULAR_VERB_CONJUG[u"رءى"+FATHA+FATHA] = {
CONJUG_BAB:(FATHA, FATHA),
TenseFuture:(u"رى", FATHA+FATHA+FATHA),
TensePassiveFuture:(u"رى", DAMMA+FATHA+FATHA),
TenseImperative:(u"رى", FATHA+FATHA),
}
IRREGULAR_VERB_CONJUG[u"ءري"+FATHA+FATHA] = {
CONJUG_BAB:(FATHA, FATHA),
TenseFuture:(u"ري", DAMMA+KASRA+FATHA),
TensePassiveFuture:(u"ري", DAMMA+FATHA+FATHA),
TenseImperative:(u"ءري", FATHA+KASRA+FATHA),
}
#~ ان يتصرف من باب (عَلِمَ يَعْلَمُ)،
#~ لا تحذف واوه؛ نحو: وَجِلَ، يَوْجَلُ،
#~ عدا ثلاثة أفعال هي: (وذر), و(وسع)، و(وطأ)،
#~ تحذف واوها؛ فنقول: وَذِرَ، يَذَرُ،
# ونقول: وَسِعَ، يَسَعُ، ونقول: وَطِئَ، يَطَأُ.
#إذا ك# الفعل وذر يذر
def get_form(self, word, proc, pref, suff, enc):
""" generate the possible affixes"""
# get procletics
#~ word = u"قصد"
list_word = []
newword = u""
transitive = True
future_type= ar.FATHA
vbc = libqutrub.classverb.VerbClass(word, transitive,future_type)
if self.is_valid_affix(pref, suff):
affix = pref+'-'+suff
if self.check_clitic_affix(proc, enc, affix):
#~ print(arepr(element))
if affix in SVC.TABLE_AFFIX:
for pair in SVC.TABLE_AFFIX[affix]:
tense = pair[0]
pronoun = pair[1]
test = check_clitic_tense(proc, enc,
tense, pronoun, transitive)
if test:
conj_verb = vbc.conjugate_tense_for_pronoun(tense, pronoun)
newword_list = self.vocalize(conj_verb, proc, enc)
list_word.extend(newword_list)
return list_word
self.conj_display.add(tense, vconst.PronounHya, conj_hya)
self.conj_display.add(tense, vconst.PronounHuma_f,
conj_hya[:-1]+FATHA+ALEF)
elif tense == vconst.TensePassivePast:
conj_ana = self.conjugate_tense_pronoun(tense,
vconst.PronounAna)
self.conj_display.add(tense, vconst.PronounAna, conj_ana)
conj_ana_without_last_mark = conj_ana[:-1]
self.conj_display.add(tense, vconst.PronounAnta,
conj_ana_without_last_mark+FATHA)
self.conj_display.add(tense, vconst.PronounAnti,
conj_ana_without_last_mark+KASRA)
self.conj_display.add(tense, vconst.PronounAntuma,
conj_ana+MEEM+FATHA+ALEF)
self.conj_display.add(tense, vconst.PronounAntuma_f,
conj_ana+MEEM+FATHA+ALEF)
self.conj_display.add(tense, vconst.PronounAntum,
conj_ana+MEEM)
self.conj_display.add(tense, vconst.PronounAntunna,
conj_ana+NOON+SHADDA+FATHA)
self.conj_display.add(tense, vconst.PronounAna, conj_ana)
conj_nahnu = self.conjugate_tense_pronoun(tense,
vconst.PronounNahnu)
self.conj_display.add(tense, vconst.PronounNahnu,
conj_nahnu)
conj_hunna = self.conjugate_tense_pronoun(tense,
vconst.PronounHunna)
self.conj_display.add(tense, vconst.PronounHunna,
conj_hunna)
def __init__(self, verb, transitive, future_type=FATHA):
"""
init method
@param verb: the given verb
@type verb: unicode.
@param transitive: the verb is transitive or not
@type transitive: Boolean.
@param future_type: The mark of the third radical letter in the verb,
used for triletiral verb only. Default value is Fatha;
@type future_type: unicode; one arabic letter (Fatha, Damma, Kasra).
"""
self.verb = verb
# this cache is used to avoid duplicated operatioon in standardisation,
# treat_sukun, and uniformate suffix
self.cache_standard = cache_standard
self.internal_verb = ar_verb.normalize(verb)
self.future_type = ar_verb.get_future_type_by_name(future_type)
, u"هما" : [u"ي", FATHA+ALEF+NOON+SHADDA+KASRA]
, u"هما مؤ" : [u"ت", FATHA+ALEF+NOON+SHADDA+KASRA]
, u"هن" : [u"ي", SUKUN+NOON+FATHA+ALEF+NOON+SHADDA+KASRA]
, u"هو" : [u"ي", FATHA+NOON+SHADDA+FATHA]
, u"هي" : [u"ت", FATHA+NOON+SHADDA+FATHA]
}
imperative = {
u"أنت" : [u"", u"ْ"]
, u"أنتِ" : [u"", u"ِي"]
, u"أنتم" : [u"", DAMMA+WAW+ALEF_WASLA]
, u"أنتما" : [u"", u"َا"]
, u"أنتما مؤ" : [u"", u"َا"]
, u"أنتن" : [u"", u"ْنَ"]
}
imperative_confirmed = {
u"أنت" : [u"", FATHA+NOON+SHADDA+FATHA]
, u"أنتِ" : [u"", KASRA+NOON+SHADDA+FATHA]
, u"أنتم" : [u"", DAMMA+NOON+SHADDA+FATHA]
, u"أنتما" : [u"", FATHA+ALEF+NOON+SHADDA+KASRA]
, u"أنتما مؤ" : [u"", FATHA+ALEF+NOON+SHADDA+KASRA]
, u"أنتن" : [u"", SUKUN+NOON+FATHA+ALEF+NOON+SHADDA+KASRA]
}
TableTensePronoun = {}
TableTensePronoun[TensePast] = past
TableTensePronoun[TenseFuture] = future
TableTensePronoun[TenseImperative] = imperative
TableTensePronoun[TenseJussiveFuture] = future_majzoom
TableTensePronoun[TenseSubjunctiveFuture] = future_mansoub
TableTensePronoun[TenseConfirmedFuture] = future_confirmed
TableTensePronoun[TenseConfirmedImperative] = imperative_confirmed
CONJUG_BAB:(FATHA, FATHA),
TenseFuture:(u"وبء", FATHA+SUKUN+FATHA+DAMMA),
TensePassiveFuture:(u"وبء", DAMMA+SUKUN+FATHA+DAMMA),
TenseImperative:(u"وبء", SUKUN+FATHA+SUKUN),
}
# الفعل وبه يوبه
#FATHA FATHA
IRREGULAR_VERB_CONJUG[u"وبه"+FATHA+FATHA] = {
CONJUG_BAB:(FATHA, FATHA),
TenseFuture:(u"وبه", FATHA+SUKUN+FATHA+DAMMA),
TensePassiveFuture:(u"وبه", DAMMA+SUKUN+FATHA+DAMMA),
TenseImperative:(u"وبه", SUKUN+FATHA+SUKUN),
}
# الفعل وجع يوجع
#FATHA FATHA
IRREGULAR_VERB_CONJUG[u"وجع"+FATHA+FATHA] = {
CONJUG_BAB: (FATHA, FATHA),
TenseFuture: (u"وجع", FATHA+SUKUN+FATHA+DAMMA),
TensePassiveFuture: (u"وجع", DAMMA+SUKUN+FATHA+DAMMA),
TenseImperative: (u"وجع", SUKUN+FATHA+SUKUN),
}
#الفعل وسع يوسع
#FATHA FATHA
IRREGULAR_VERB_CONJUG[u"وسع"+FATHA+FATHA] = {
CONJUG_BAB: (FATHA, FATHA),
TenseFuture: (u"وسع", FATHA+SUKUN+FATHA+DAMMA),
TensePassiveFuture: (u"وسع", DAMMA+SUKUN+FATHA+DAMMA),
TenseImperative: (u"وسع", SUKUN+FATHA+SUKUN),
}
# الفعل وهل يوهل
#FATHA FATHA
def find_alltriverb(triverb, givenharaka = araby.FATHA,
vocalised_entree = False):
"""
Find the triliteral verb in the dictionary (TriVerbTable)
return a list of possible verb forms
each item contains:
- 'root':
- 'haraka:
- 'bab':
- 'transitive':
@param triverb: given verb.
@type triverb: unicode.
@param givenharaka: given haraka of tuture type of the verb,
default(FATHA).
@type givenharaka: unicode.
@param VocalisedEntree: True if the given verb is vocalized,
default False.
- vconst.TenseJussiveFuture : تصريف الفعل المضارع المجزوم
- vconst.TenseSubjunctiveFuture : تصريف الفعل المضارع المنصوب
- vconst.TenseConfirmedFuture: المضارع المؤكد الثقيل
- vconst.TensePassiveFuture :تصريف الفعل المضارع المبني للمجهول
- vconst.TensePassiveJussiveFuture: تصريف الفعل المضارع المجزوم المني للمجهول
- vconst.TensePassiveSubjunctiveFuture:تصريف الفعل المضارع المنصوب
- vconst.TensePassiveConfirmedFuture:المضارع المؤكد الثقيل المنبي للمجهول
- vconst.TenseImperative:الفعل الامر
- vconst.TenseConfirmedImperative: الفعل الامر المؤكد.
"""
letters = self.word_letters
marks = self.word_marks
future_letters = letters
# حالة الفعل الثلاثي
if self.vlength == 3:
first_future_mark = FATHA
first_passive_future_mark = DAMMA
future_marks = SUKUN + self.future_type + FATHA
passive_future_marks = SUKUN + FATHA + FATHA
# معالجة الفعل المثال الواوي
#ToDO
# الفعل الرباعي
elif self.vlength == 4:
first_future_mark = DAMMA
first_passive_future_mark = DAMMA
future_marks = FATHA + SUKUN + KASRA + DAMMA
passive_future_marks = FATHA + SUKUN + FATHA + DAMMA
# الفعل الخماسي
elif self.vlength == 5:
first_future_mark = FATHA
first_passive_future_mark = DAMMA