From d866b8fbb2628fbaaeae90220d33e7767833024f Mon Sep 17 00:00:00 2001 From: Klemek Date: Tue, 16 Jun 2026 11:31:50 +0200 Subject: [PATCH] fix: invalid chars in french.txt --- cool_domain/word_list.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cool_domain/word_list.py b/cool_domain/word_list.py index 39702b3..9194748 100644 --- a/cool_domain/word_list.py +++ b/cool_domain/word_list.py @@ -1,5 +1,6 @@ import logging import pathlib +import re import typing import unidecode @@ -22,10 +23,7 @@ class WordList: self.logger.info("[%s] Loaded %d words", self.__name, len(self.words)) def __escape_word(self, word: str) -> str: - word = unidecode.unidecode(word.strip()).lower() - if " " in word: - return "" - return word + return re.sub(r"[^a-z0-9-]", "", unidecode.unidecode(word.strip()).lower()) def close(self) -> None: pass