INNER CODE UNIT · Python

__repr__

wyounas/homer · homer/analyzer.py:58

    def __repr__(self):
        return 'Word(%r)' % self.word

    def __str__(self):
        return self.word


@lru_cache(maxsize=256)
def get_word(word):
    return Word(word)


class Sentence(object):
    """
    An abstraction that represents a sentence and gives various stats.
    """
    def __init__(self, sentence):
        self.sentence = sentence

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…