INNER CODE UNIT · Python
apply
vgrabovets/multi_rake · multi_rake/algorithm.py:53
def apply(self, text, text_for_stopwords=None):
text = text.lower()
max_words = self.max_words
if self.stopwords:
stop_words = self.stopwords
else:
language_code = detect_language(text, self.lang_detect_threshold)
if language_code is not None and language_code in STOPWORDS:
stop_words = STOPWORDS[language_code]
else:
if text_for_stopwords:
text_for_stopwords = text_for_stopwords.lower()
text_for_stopwords = ' '.join([text, text_for_stopwords])