@classmethod
def load(cls, filename):
    """
        Loads a WordDictionary object from a vocabulary file.
        """
    words = []
    with open(filename, 'rb') as f:
        for word in f:
            word = word.decode('utf-8').strip()
            if word:
                words.append(word)
    return cls.init_from_wordlist(words)
