feat: custom word list

This commit is contained in:
2026-06-15 15:09:27 +02:00
parent f91384173b
commit 85a1c47c8c
6 changed files with 31 additions and 15 deletions
+5 -1
View File
@@ -1,6 +1,8 @@
import logging
import sys
from cool_domain.word_list import WordList
from . import PKG_NAME, PKG_VERSION
from .cache import Cache
from .constants import LANGS
@@ -14,10 +16,12 @@ def main() -> int:
params = parse_parameters(sys.argv[1:])
setup_logs(params)
logging.getLogger().info("%s %s", PKG_NAME, PKG_VERSION)
langs = LANGS
langs["custom"] = WordList("custom", params.custom_words)
with (
Cache(filepath=params.cache_file, no_load=params.cache) as cache,
TLDList(cache=cache, remote_uri=params.tld_list_uri) as tld_list,
LANGS[params.lang] as word_list,
langs[params.lang] as word_list,
):
factory = Factory(tld_list=tld_list, word_list=word_list, words=params.words)
logging.getLogger().info(