Package qutrub :: Package libqutrub :: Module classverb :: Class verbclass
[hide private]
[frames] | no frames]

Class verbclass

source code

Verb Class: represent a verb, prepare it to be conjugated and store the conjugation result

Instance Methods [hide private]
 
__init__(self, verb, transitive, future_type=u'َ')
init method
source code
    Attributes functions
 
set_display(self, mode='Text')
Set the display mode as:
source code
conjugatedisplay class;
get_conj_display(self)
Get The conjugation display class with result.
source code
    Extract information from verb functions
boolean;
is_hamza_zaida(self, verb_normalized_unvocalized)
Function to determine if the first HAMZA in the verb is not original ترجع إذا كانت الهمزة الأولى في الفعل غير أصليةDetermine if the verb starts with Hamza and the Teh is not original like أضرب
source code
unicode.
homogenize_harakat(self, original_harakat, applied_harakat)
Treat Harakat to be homogenized with letters in conjugation.
source code
    Preparing conjugation stems for every tense functions
 
prepare_future_and_imperative_stem(self)
Prepare the conjugation stems for future tenses (future, jussive, subjective) and imperative tense.
source code
 
prepare_past_stem(self)
Prepare the conjugation stems for past tense.
source code
 
prepare_passive_past_stem(self)
Prepare the conjugation stems for past tense.
source code
unicode;
conjugate_tense_pronoun(self, tense, pronoun)
Conjugate a verb in a given tense with a pronoun.
source code
the type is given according to the display mode;
conjugate_all_tenses(self, listtense=[u'الماضي المعلوم', u'المضارع المعلوم', u'المضارع المجزوم', u'...)
Conjugate a verb with a list of tenses.
source code
    Irregular verbs functions
Boolean;
is_irregular_verb(self)
Return True if the verb is irregular, founded in the irregular verb table إرجاع إّذا كان الفعل ضاذا.
source code
unicode;
get_irregular_future_stem(self)
Get the future stem for irregular verb.
source code
unicode;
get_irregular_passivefuture_stem(self)
Get the passive future stem for irregular verb.
source code
unicode;
get_irregular_imperative_stem(self)
Get the imperative stem for irregular verb.
source code
 
prepare_irregular_future_and_imperative_stem(self)
Prepare the conjugation stems for future tenses (future, jussive, subjective) and imperative tense.
source code
Class Variables [hide private]
  verb = u''
  internal_verb = u''
  word_letters = u''
  word_marks = u''
  unvocalized = u''
  vlength = 0
  vtype = u''
  future_type = u''
  transitive = u''
  hamza_zaida = False
  future_form = u''
  conj_display = None
  tab_conjug_stem = None
Method Details [hide private]

__init__(self, verb, transitive, future_type=u'َ')
(Constructor)

source code 

init method

Parameters:
  • verb (unicode.) - the given verb;
  • transitive (Boolean.) - the verb is transitive or not;
  • future_type (unicode; one arabic letter (Fatha, Damma, Kasra).) - The mark of the third radical letter in the verb, used for triletiral verb only. Default value is Fatha;

set_display(self, mode='Text')

source code 

Set the display mode as:

  • 'Text':
  • 'HTML':
  • 'HTMLColoredDiacritics':
  • 'DICT':
  • 'CSV':
  • 'GUI':
  • 'TABLE':
  • 'XML':
  • 'TeX':
  • 'ROWS':
Parameters:
  • mode - the given mode to display result;

get_conj_display(self)

source code 

Get The conjugation display class with result.

Returns: conjugatedisplay class;
an object with result.

is_hamza_zaida(self, verb_normalized_unvocalized)

source code 

Function to determine if the first HAMZA in the verb is not original ترجع إذا كانت الهمزة الأولى في الفعل غير أصليةDetermine if the verb starts with Hamza and the Teh is not original like أضرب

Parameters:
  • verb_normalized_unvocalized (unicde;) - the unvovalized form f the verb.
Returns: boolean;
return True if the start Teh is not original

homogenize_harakat(self, original_harakat, applied_harakat)

source code 

Treat Harakat to be homogenized with letters in conjugation. إذا كان طول الحركات ألأصلية للفعل أقل من طول حركات الماضي المبني للمجهول هذا يعني وجود حركة طويلة نقوم بتحويل الحركة الطويلة إلى ما يوافقها

Parameters:
  • original_harakat (unicode.) - given original harakatof the verb.
  • applied_harakat (unicode.) - given harakat to be applied to verb.
Returns: unicode.
nesw harakat to be applied to the verb.

prepare_future_and_imperative_stem(self)

source code 

Prepare the conjugation stems for future tenses (future, jussive, subjective) and imperative tense. Those stems will be concatenated with conjugation affixes. This function store results in self.tab_conjug_stem. This function prepare conjugation stems for the following tenses:

  • TenseFuture : تصريف الفعل المضارع
  • TenseJussiveFuture : تصريف الفعل المضارع المجزوم
  • TenseSubjunctiveFuture : تصريف الفعل المضارع المنصوب
  • TenseConfirmedFuture: المضارع المؤكد الثقيل
  • TensePassiveFuture :تصريف الفعل المضارع المبني للمجهول
  • TensePassiveJussiveFuture: تصريف الفعل المضارع المجزوم المني للمجهول
  • TensePassiveSubjunctiveFuture:تصريف الفعل المضارع المنصوب
  • TensePassiveConfirmedFuture:المضارع المؤكد الثقيل المنبي للمجهول
  • TenseImperative:الفعل الامر
  • TenseConfirmedImperative: الفعل الامر المؤكد.

prepare_past_stem(self)

source code 

Prepare the conjugation stems for past tense. Those stems will be concatenated with conjugation affixes. This function store results in self.tab_conjug_stem. This function prepare conjugation stems for the following tenses:

  • TensePast: الفعل الماضي.

prepare_passive_past_stem(self)

source code 

Prepare the conjugation stems for past tense. Those stems will be concatenated with conjugation affixes. This function store results in self.tab_conjug_stem. This function prepare conjugation stems for the following tenses:

  • TensePast: الفعل الماضي

conjugate_tense_pronoun(self, tense, pronoun)

source code 

Conjugate a verb in a given tense with a pronoun.

Parameters:
  • tense (unicode name of the tense;) - given tense;
  • pronoun (unicode name of the pronoun;) - given pronoun;
Returns: unicode;
conjugated verb;

conjugate_all_tenses(self, listtense=[u'الماضي المعلوم', u'المضارع المعلوم', u'المضارع المجزوم', u'...)

source code 

Conjugate a verb with a list of tenses.

Parameters:
  • listtense (list of unicode;) - given tense;
Returns: the type is given according to the display mode;
conjugated verb ;

is_irregular_verb(self)

source code 

Return True if the verb is irregular, founded in the irregular verb table إرجاع إّذا كان الفعل ضاذا. الأفعال العربية الخاصة هي رأى، أكل أمر سأل، ج- إذا كان يتصرف من باب (مَنَعَ يَمْنَعُ)، تحذف واوه, نحو: وَضَعَ، يَضَعُ، وَجَأَ يَجَأُ، وَدَعَ يَدَعُ، وَزَعَ يَزَعُ، وَضَأَ يَضَأُ، وَطَأَ يَطَأُ، وَقَعَ يَقَعُ، وَلَغَ يَلَغُ، وَهَبَ يَهَبُ، عدا خمسة أفعال هي: (وَبَأ)، و(وَبَهَ)، و(وَجَعَ)، و(وَسَعَ)، و(وَهَلَ)، فلا تحذف منها الواو؛ فنقول: يَوْبَأُ، يَوْبَهُ، يَوْجَعُ، يَوْسَعُ، يَوْهَلُ. الأفعال (وَبَأ)، و(وَبَهَ)، و(وَجَعَ)، و(وَسَعَ)، و(وَهَلَ)، الفعل وبَأ يوبأ

Returns: Boolean;
True if irregular;

get_irregular_future_stem(self)

source code 

Get the future stem for irregular verb.

Returns: unicode;
the future conjuagtion stem;

get_irregular_passivefuture_stem(self)

source code 

Get the passive future stem for irregular verb.

Returns: unicode;
the passive future conjuagtion stem;

get_irregular_imperative_stem(self)

source code 

Get the imperative stem for irregular verb.

Returns: unicode;
the passive imperative conjuagtion stem;

prepare_irregular_future_and_imperative_stem(self)

source code 

Prepare the conjugation stems for future tenses (future, jussive, subjective) and imperative tense. Those stems will be concatenated with conjugation affixes.