from pathlib import Path


def _load(exclude_past_answers=False):
    """
    Load the full corpus from file,
    """
    pkg = Path(__name__).resolve()
    path_data = pkg.parent / "mordle" / "data" / "wordle-corpus.txt"
    with open(path_data, "r") as f:
        lines = f.readlines()

    result = [line.strip() for line in lines]
    if not exclude_past_answers:
        return result

    path_answers = pkg.parent / "mordle" / "data" / "past-answers.txt"
    with open(path_answers, "r") as f:
        past = f.readlines()

    for word in past:
        result.remove(word.strip())

    return result