import codecs


def _words_from_text(filename) -> list:
    """
    Loads a list of words from a text file.
    """
    wordList = []

    with codecs.open(filename, 'r', 'utf-8') as words:
        for line in list(words):
            word = line.strip()
            if (len(word) > 0 and not word.startswith("#")):
                wordList.append(word.split(" ")[0])

    return wordList