# Buggy code
def __Suffix_Verb_Step2a(self, token):
    for suffix in self.__suffix_verb_step2a:
        if token.endswith(suffix):
            if suffix == "\u062a" and len(token) >= 4:
                token = token[:-1]
                self.suffix_verb_step2a_success = True
                break

            if suffix in self.__conjugation_suffix_verb_4 and len(token) >= 4:
                token = token[:-1]
                self.suffix_verb_step2a_success = True
                break

            if suffix in self.__conjugation_suffix_verb_past and len(token) >= 5:
                token = token[:-2]  # past
                self.suffix_verb_step2a_success = True
                break

            if suffix in self.__conjugation_suffix_verb_present and len(token) > 5:
                token = token[:-2]  # present
                self.suffix_verb_step2a_success = True
                break

            if suffix == "\u062a\u0645\u0627" and len(token) >= 6:
                token = token[:-3]
                self.suffix_verb_step2a_success = True
                break
    return token


# Traceback (AttributeError)
(anaconda2-4.4.0) richard-balmer-macbook:~ richardbalmer$ pip freeze | grep nltk
nltk==3.2.5
(anaconda2-4.4.0) richard-balmer-macbook:~ richardbalmer$ ipython
Python 2.7.13 |Anaconda custom (x86_64)| (default, Dec 20 2016, 23:05:08)
Type "copyright", "credits" or "license" for more information.

IPython 5.3.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: from nltk.stem.snowball import SnowballStemmer

In [2]: stemmer = SnowballStemmer('arabic')

In [3]: stemmer.stem(u'تسدد')
Out[3]: u'\u062a\u0633\u062f\u062f'

In [4]: stemmer.stem(u'من')
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-4-ffa733106049> in <module>()
----> 1 stemmer.stem(u'من')

/Users/richardbalmer/.pyenv/versions/anaconda2-4.4.0/lib/python2.7/site-packages/nltk/stem/snowball.pyc in stem(self, word)
762                 modified_word = self.__Suffix_Verb_Step2b(modified_word)
763                 if not self.suffix_verb_step2b_success:
--> 764                     modified_word = self.__Suffix_Verb_Step2a(modified_word)
765         if self.is_noun:
766             modified_word = self.__Suffix_Noun_Step2c2(modified_word)

/Users/richardbalmer/.pyenv/versions/anaconda2-4.4.0/lib/python2.7/site-packages/nltk/stem/snowball.pyc in __Suffix_Verb_Step2a(self, token)
533                     break
534
--> 535                 if suffix in self.__conjugation_suffix_verb_present and len(token) > 5:
536                     token = token[:-2]  # present
537                     self.suffix_verb_step2a_success = True

AttributeError: 'ArabicStemmer' object has no attribute '_ArabicStemmer__conjugation_suffix_verb_present'

# Fixed code
def __Suffix_Verb_Step2a(self, token):
    for suffix in self.__suffix_verb_step2a:
        if token.endswith(suffix) and len(token) > 3:
            if suffix == "\u062a" and len(token) >= 4:
                token = token[:-1]
                self.suffix_verb_step2a_success = True
                break

            if suffix in self.__conjugation_suffix_verb_4 and len(token) >= 4:
                token = token[:-1]
                self.suffix_verb_step2a_success = True
                break

            if suffix in self.__conjugation_suffix_verb_past and len(token) >= 5:
                token = token[:-2]  # past
                self.suffix_verb_step2a_success = True
                break

            if suffix in self.__conjugation_suffix_verb_present and len(token) > 5:
                token = token[:-2]  # present
                self.suffix_verb_step2a_success = True
                break

            if suffix == "\u062a\u0645\u0627" and len(token) >= 6:
                token = token[:-3]
                self.suffix_verb_step2a_success = True
                break
    return token