fix: invalid chars in french.txt
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import logging
|
import logging
|
||||||
import pathlib
|
import pathlib
|
||||||
|
import re
|
||||||
import typing
|
import typing
|
||||||
|
|
||||||
import unidecode
|
import unidecode
|
||||||
@@ -22,10 +23,7 @@ class WordList:
|
|||||||
self.logger.info("[%s] Loaded %d words", self.__name, len(self.words))
|
self.logger.info("[%s] Loaded %d words", self.__name, len(self.words))
|
||||||
|
|
||||||
def __escape_word(self, word: str) -> str:
|
def __escape_word(self, word: str) -> str:
|
||||||
word = unidecode.unidecode(word.strip()).lower()
|
return re.sub(r"[^a-z0-9-]", "", unidecode.unidecode(word.strip()).lower())
|
||||||
if " " in word:
|
|
||||||
return ""
|
|
||||||
return word
|
|
||||||
|
|
||||||
def close(self) -> None:
|
def close(self) -> None:
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user