nltk.stem.isri module

ISRI Arabic Stemmer

The algorithm for this stemmer is described in:

Taghva, K., Elkoury, R., and Coombs, J. 2005. Arabic Stemming without a root dictionary. Information Science Research Institute. University of Nevada, Las Vegas, USA.

The Information Science Research Institute’s (ISRI) Arabic stemmer shares many features with the Khoja stemmer. However, the main difference is that ISRI stemmer does not use root dictionary. Also, if a root is not found, ISRI stemmer returned normalized form, rather than returning the original unmodified word.

Additional adjustments were made to improve the algorithm:

1- Adding 60 stop words. 2- Adding the pattern (تفاعيل) to ISRI pattern set. 3- The step 2 in the original algorithm was normalizing all hamza. This step is discarded because it increases the word ambiguities and changes the original root.

class nltk.stem.isri.ISRIStemmer[source]

Bases: StemmerI

ISRI Arabic stemmer based on algorithm: Arabic Stemming without a root dictionary. Information Science Research Institute. University of Nevada, Las Vegas, USA.

A few minor modifications have been made to ISRI basic algorithm. See the source code of this module for more information.

isri.stem(token) returns Arabic root for the given token.

The ISRI Stemmer requires that all tokens have Unicode string types. If you use Python IDLE on Arabic Windows you have to decode text first using Arabic ‘1256’ coding.

__init__()[source]
end_w5(word)[source]

ending step (word of length five)

end_w6(word)[source]

ending step (word of length six)

norm(word, num=3)[source]

normalization: num=1 normalize diacritics num=2 normalize initial hamza num=3 both 1&2

pre1(word)[source]

normalize short prefix

pre32(word)[source]

remove length three and length two prefixes in this order

pro_w4(word)[source]

process length four patterns and extract length three roots

pro_w53(word)[source]

process length five patterns and extract length three roots

pro_w54(word)[source]

process length five patterns and extract length four roots

pro_w6(word)[source]

process length six patterns and extract length three roots

pro_w64(word)[source]

process length six patterns and extract length four roots

stem(token)[source]

Stemming a word token using the ISRI stemmer.

suf1(word)[source]

normalize short sufix

suf32(word)[source]

remove length three and length two suffixes in this order

waw(word)[source]

remove connective ‘و’ if it precedes a word beginning with ‘و’