Skip to content

Commit 3263752

Browse files
committed
docs: note hunspell requirement
1 parent 637a729 commit 3263752

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ You cand find it here https://github.com/xfenix/spellcheck-microservice/releases
6565
### Quickstart
6666
* Clone this repo
6767
* For MacOS X `brew install enchant`
68+
* For Debian/Ubuntu `apt-get install -y enchant-2 hunspell-ru`
6869
* `uv sync --group dev`
6970
* `source .venv/bin/activate`
7071
* Run `touch .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit`

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies = [
1111
"uvicorn",
1212
"pyenchant",
1313
"toml",
14-
"pylru",
14+
"cachebox",
1515
"anyio>=4",
1616
"sentry-sdk",
1717
"pydantic-settings",

uv.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

whole_app/spell.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
import re
22
import typing
33

4-
import pylru
4+
import cachebox
55
import urlextract
66
from enchant.checker import SpellChecker
77

88
from . import models
99
from .settings import SETTINGS
1010

1111

12-
_MISSPELED_CACHE: typing.Final[dict[str, list[str]]] = (
13-
pylru.lrucache(SETTINGS.cache_size) if SETTINGS.cache_size > 0 else {}
12+
_MISSPELED_CACHE: typing.Final[
13+
cachebox.LRUCache[str, list[str]] | dict[str, list[str]]
14+
] = (
15+
cachebox.LRUCache[str, list[str]](SETTINGS.cache_size)
16+
if SETTINGS.cache_size > 0
17+
else typing.cast("dict[str, list[str]]", {})
1418
)
1519

1620
SEPARATORS_TO_SPLIT_URL_BY_WORDS: typing.Final[re.Pattern[str]] = re.compile(r"\.|\:|\/\/|\/|\?|\&|\=|\+|\#|\-")

0 commit comments

Comments
 (0)