Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
10daddb54c | ||
|
|
d866b8fbb2 |
@@ -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
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "cool-domain"
|
name = "cool-domain"
|
||||||
version = "1.4.1"
|
version = "1.4.2"
|
||||||
description = "Add your description here"
|
description = "Add your description here"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.12"
|
requires-python = ">=3.12"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ requires-python = ">=3.12"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cool-domain"
|
name = "cool-domain"
|
||||||
version = "1.4.1"
|
version = "1.4.2"
|
||||||
source = { editable = "." }
|
source = { editable = "." }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "unidecode" },
|
{ name = "unidecode" },
|
||||||
|
|||||||
Reference in New Issue
Block a user