'Splits a long text into words, eliminates the stopwords.
Parameters
text : string
The text to be processed.
Returns
words : dict (string, int)
Word tokens with associated frequency.
..versionchanged:: 1.2.2
Changed return type from list of tuples to dict.
Notes
There are better ways to do word tokenization, but I don\'t want to
include all those things.'

def process_text(self, text):

    stopwords = set([i.lower() for i in self.stopwords])
    flags = (re.UNICODE if ((sys.version < '3') and (type(text) is unicode)) else 0)
    regexp = (self.regexp if (self.regexp is not None) else "\\w[\\w']+")
    words = re.findall(regexp, text, flags)
    words = [word for word in words if (word.lower() not in stopwords)]
    words = [(word[:(-2)] if word.lower().endswith("'s") else word) for word in words]
    words = [word for word in words if (not word.isdigit())]
    if self.collocations:
        word_counts = unigrams_and_bigrams(words, self.normalize_plurals)
    else:
        (word_counts, _) = process_tokens(words, self.normalize_plurals)
    return word_counts
