Package aranalex :: Module arabicdictionary :: Class arabicDictionary
[hide private]
[frames] | no frames]

Class arabicDictionary

source code


Arabic dictionary Class
        Used to allow abstract acces to lexicon of arabic language,
        can get indexed and hashed entries from the  basic lexicon
        add also, support to extract attributtes from entries

Instance Methods [hide private]
 
__init__(self, tableName, attribIndex, keyAttribute='vocalized')
initialisation of dictionary from a data dictionary, create indexes to speed up the access.
source code
dict
getEntryById(self, id)
Get dictionary entry by id from the dictionary @param id word identifier
source code
mix.
getAttribById(self, id, attribute)
Get attribute value by id from the dictionary @param id word identifier
source code
list.
lookup(self, normalized, has_plural_suffix=False)
look up for all word forms in the dictionary @param normalized the normalized word.
source code
Boolean.
existsAsStamp(self, word)
look up for word if exists by using the stamp index, the input word is stamped by removing infixes letters like alef, teh the stamped word is looked up in the stamp index @param word to look for.
source code
list.
lookupByStamp(self, word)
look up for word if exists by using the stamp index, the input word is stamped by removing infixes letters like alef, teh the stamped word is looked up in the stamp index @param word to look for.
source code
 
wordStamp(self, word)
generate a stamp for a word,...
source code
Method Details [hide private]

getEntryById(self, id)

source code 

Get dictionary entry by id from the dictionary @param id word identifier

Parameters:
  • attribute (unicode)
  • id (integer @param attribute the attribute name)
Returns: dict
all attributes

getAttribById(self, id, attribute)

source code 

Get attribute value by id from the dictionary @param id word identifier

Parameters:
  • attribute (unicode)
  • id (integer @param attribute the attribute name)
Returns: mix.
The attribute value

lookup(self, normalized, has_plural_suffix=False)

source code 

look up for all word forms in the dictionary @param normalized the normalized word.

Parameters:
  • text (unicode.)
Returns: list.
list of dictionary entries IDs.

existsAsStamp(self, word)

source code 

look up for word if exists by using the stamp index, the input word is stamped by removing infixes letters like alef, teh the stamped word is looked up in the stamp index @param word to look for.

Parameters:
  • text (unicode.)
Returns: Boolean.
True if exists.

lookupByStamp(self, word)

source code 

look up for word if exists by using the stamp index, the input word is stamped by removing infixes letters like alef, teh the stamped word is looked up in the stamp index @param word to look for.

Parameters:
  • text (unicode.)
Returns: list.
list of dictionary entries IDs.

wordStamp(self, word)

source code 

generate a stamp for a word,
remove all letters which can change form in the word :
- ALEF,
- HAMZA,
- YEH,
- WAW,
- ALEF_MAKSURA
- SHADDA
@return: stamped word