Author SHA1 Message Date
klemek 10daddb54c chore: 1.4.2
Python Lint CI / ruff (push) Successful in 13m4s
Python Lint CI / ruff-format-check (push) Successful in 13m9s
Python Lint CI / ty (push) Successful in 12m32s
2026-06-16 11:31:53 +02:00
klemek d866b8fbb2 fix: invalid chars in french.txt 2026-06-16 11:31:50 +02:00
klemek 61086e0b9b chore: 1.4.1
Python Lint CI / ty (push) Successful in 1m59s
Python Lint CI / ruff-format-check (push) Successful in 1m59s
Python Lint CI / ruff (push) Successful in 7m18s
2026-06-16 11:09:29 +02:00
klemek ce53920340 fix: use symlink for txt files
Python Lint CI / ruff-format-check (push) Has been cancelled
Python Lint CI / ty (push) Has been cancelled
Python Lint CI / ruff (push) Has been cancelled
2026-06-16 11:08:33 +02:00
6 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
from cool_domain.word_list import WordList from cool_domain.word_list import WordList
LANGS: dict[str, WordList] = { LANGS: dict[str, WordList] = {
"english": WordList("english", "english/words_alpha.txt"), "english": WordList("english", "english.txt"),
"french": WordList("french", "french/francais.txt"), "french": WordList("french", "french.txt"),
} }
+1
View File
@@ -0,0 +1 @@
../english/words_alpha.txt
+1
View File
@@ -0,0 +1 @@
../french/francais.txt
+3 -5
View File
@@ -1,5 +1,6 @@
import logging import logging
import pathlib import pathlib
import re
import typing import typing
import unidecode import unidecode
@@ -11,7 +12,7 @@ class WordList:
def __init__(self, name: str, path: str) -> None: def __init__(self, name: str, path: str) -> None:
self.logger: logging.Logger = logging.getLogger(self.__class__.__name__) self.logger: logging.Logger = logging.getLogger(self.__class__.__name__)
self.__name = name self.__name = name
self.__filepath = pathlib.Path(__file__).parent / ".." / path self.__filepath = pathlib.Path(__file__).parent / path
self.words: list[str] = [] self.words: list[str] = []
def open(self) -> None: def open(self) -> None:
@@ -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
View File
@@ -1,6 +1,6 @@
[project] [project]
name = "cool-domain" name = "cool-domain"
version = "1.4.0" 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"
Generated
+1 -1
View File
@@ -4,7 +4,7 @@ requires-python = ">=3.12"
[[package]] [[package]]
name = "cool-domain" name = "cool-domain"
version = "1.4.0" version = "1.4.2"
source = { editable = "." } source = { editable = "." }
dependencies = [ dependencies = [
{ name = "unidecode" }, { name = "unidecode" },