import os
from abc import ABC

from utils import get_root_dir


class UseAnagramIndexFileMixin(ABC):
    JSON_DIR = os.path.join(get_root_dir(), 'json')
    DEFAULT_ANAGRAM_INDEX_FILE = 'anagram_index.json'

    def __init__(self, filename: str = DEFAULT_ANAGRAM_INDEX_FILE):
        """
        :param filename: Filename of the anagram index
                         Rationale: you might want to use different files for different word lists
        """

        self.filename = filename

    @property
    def anagram_index_file(self) -> str:
        """
        Full path to the anagram index file
        """

        return os.path.join(self.JSON_DIR, self.filename)

import os
from abc import ABC

from utils import get_root_dir


class UseAnagramIndexFileMixin(ABC):
    JSON_DIR = os.path.join(get_root_dir(), 'json')
    DEFAULT_ANAGRAM_INDEX_FILE = 'anagram_index.json'

    def __init__(self, filename: str = DEFAULT_ANAGRAM_INDEX_FILE):
        """
        :param filename: Filename of the anagram index
                         Rationale: you might want to use different files for different word lists
        """

        self.filename = filename

    @property
    def anagram_index_file(self) -> str:
        """
        Full path to the anagram index file
        """

        return os.path.join(self.JSON_DIR, self.filename)

:param filename: Filename of the anagram index                          Rationale: you might want to use different files for different word lists Full path to the anagram index file