Module maleo.stopword_remover.Remover

Expand source code Browse git
class Remover(object):

    def __init__(self, dictionary):
        self.dictionary = dictionary

    def get_dictionary(self):
        return self.dictionary

    def remove(self, text):
        """Remove stop words."""
        words = text.split(' ')
        stopped_words = [
            word for word in words if not self.dictionary.contains(word)]
        return ' '.join(stopped_words)

Classes

class Remover (dictionary)
Expand source code Browse git
class Remover(object):

    def __init__(self, dictionary):
        self.dictionary = dictionary

    def get_dictionary(self):
        return self.dictionary

    def remove(self, text):
        """Remove stop words."""
        words = text.split(' ')
        stopped_words = [
            word for word in words if not self.dictionary.contains(word)]
        return ' '.join(stopped_words)

Methods

def get_dictionary(self)
Expand source code Browse git
def get_dictionary(self):
    return self.dictionary
def remove(self, text)

Remove stop words.

Expand source code Browse git
def remove(self, text):
    """Remove stop words."""
    words = text.split(' ')
    stopped_words = [
        word for word in words if not self.dictionary.contains(word)]
    return ' '.join(stopped_words)