fix: invalid chars in french.txt

This commit is contained in:
2026-06-16 11:31:50 +02:00
parent 61086e0b9b
commit d866b8fbb2
+2 -4
View File
@@ -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