if self.dict_name is None:
self.dict_name = args[0] if args else kwargs.get("dictionary_name", "dictionary")
data_dir = os.path.join(data_dir, self.dict_name)
alphabet_path = os.path.join(data_dir, "alphabet.pkl")
words_path = os.path.join(data_dir, "words.pkl")
words_trie_path = os.path.join(data_dir, "words_trie.pkl")
if not is_done(data_dir):
print("Trying to build a dictionary in {}".format(data_dir))
After Change
def __init__(self, data_dir=None, *args, **kwargs):
if data_dir is None:
data_dir = paths.USR_PATH
data_dir = Path(data_dir)
if self.dict_name is None:
self.dict_name = args[0] if args else kwargs.get("dictionary_name", "dictionary")
data_dir = data_dir / self.dict_name
alphabet_path = data_dir / "alphabet.pkl"
words_path = data_dir / "words.pkl"
words_trie_path = data_dir / "words_trie.pkl"
if not is_done(data_dir):
print("Trying to build a dictionary in {}".format(data_dir))
if data_dir.is_dir():