nltk.stem.ISRIStemmer

class nltk.stem.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]
stem(token)[source]

Stemming a word token using the ISRI stemmer.

norm(word, num=3)[source]

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

pre32(word)[source]

remove length three and length two prefixes in this order

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 ‘و’

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

end_w5(word)[source]

ending step (word of length five)

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

end_w6(word)[source]

ending step (word of length six)

suf1(word)[source]

normalize short sufix

pre1(word)[source]

normalize short prefix