Skip to content

Commit ffd3f4e

Browse files
committed
version bump
1 parent 0b47329 commit ffd3f4e

File tree

5 files changed

+23
-24
lines changed

5 files changed

+23
-24
lines changed

.github/workflows/python-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
14+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
1515

1616
steps:
1717
- uses: actions/checkout@v3

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# pyspellchecker
22

3-
## Version 0.7.4
3+
## Version 0.8.0
44

55
* Leveraged the dictionary files from [levidromelist](https://www.levidromelist.com/levidrome-list/dictionary) to attempt to clean up the `en`, `es`, `fr`, `pt`, `'de`, and `nl`dictionaries; Attempts to resolve issues #164, #155, #150, #140, #115, and #107; see [issue #126](https://github.com/barrust/pyspellchecker/issues/126)
66
* Added `Italian` language support; see [#167](https://github.com/barrust/pyspellchecker/pull/167)

pyproject.toml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[project]
22
name = "pyspellchecker"
33
dynamic = ["version"]
4-
authors = [{name = "Tyler Barrus", email = "barrust@gmail.com"}]
5-
license = {text = "MIT"}
4+
authors = [{ name = "Tyler Barrus", email = "barrust@gmail.com" }]
5+
license = { text = "MIT" }
66
description = "Pure python spell checker based on work by Peter Norvig"
77
keywords = [
88
"python",
@@ -30,12 +30,13 @@ classifiers = [
3030
"Programming Language :: Python :: 3.9",
3131
"Programming Language :: Python :: 3.10",
3232
"Programming Language :: Python :: 3.11",
33+
"Programming Language :: Python :: 3.12",
3334
]
3435
requires-python = ">=3.6"
3536

3637

3738
[tool.setuptools.dynamic]
38-
version = {attr = "spellchecker.__version__"}
39+
version = { attr = "spellchecker.__version__" }
3940

4041

4142
[project.urls]
@@ -45,16 +46,14 @@ documentation = "https://pyspellchecker.readthedocs.io/"
4546

4647

4748
[tool.poetry]
48-
packages = [
49-
{include = "spellchecker"},
50-
]
49+
packages = [{ include = "spellchecker" }]
5150

5251
[tool.poetry.dev-dependencies]
53-
pre-commit = {version = ">=2.18.1", python = "^3.6.1"}
54-
black = {version = "^20.8b1", python = "^3.6"}
55-
isort = {version = "^5.6.4", python = "^3.6"}
56-
pytest = {version = "^6.1.1", python = "^3.6"}
57-
flake8 = {version = "^3.6.0", python = "^3.6"}
52+
pre-commit = { version = ">=2.18.1", python = "^3.6.1" }
53+
black = { version = "^20.8b1", python = "^3.6" }
54+
isort = { version = "^5.6.4", python = "^3.6" }
55+
pytest = { version = "^6.1.1", python = "^3.6" }
56+
flake8 = { version = "^3.6.0", python = "^3.6" }
5857

5958
[tool.setuptools.packages.find]
6059
include = ["spellchecker", "spellchecker.*"]
@@ -89,5 +88,3 @@ max-args = 6
8988
[build-system]
9089
requires = ["setuptools>=61.2.0", "wheel"]
9190
build-backend = "setuptools.build_meta"
92-
93-

spellchecker/info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
__maintainer__ = "Tyler Barrus"
66
__email__ = "barrust@gmail.com"
77
__license__ = "MIT"
8-
__version__ = "0.7.3"
8+
__version__ = "0.8.0"
99
__credits__ = ["Peter Norvig"]
1010
__url__ = "https://github.com/barrust/pyspellchecker"
1111
__bugtrack_url__ = f"{__url__}/issues"

spellchecker/spellchecker.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -286,16 +286,16 @@ def __init__(
286286
tokenizer: typing.Optional[typing.Callable[[str], typing.Iterable[str]]] = None,
287287
case_sensitive: bool = False,
288288
) -> None:
289-
self._dictionary = Counter()
289+
self._dictionary: typing.Counter = Counter()
290290
self._total_words = 0
291291
self._unique_words = 0
292-
self._letters = set()
292+
self._letters: typing.Set[str] = set()
293293
self._case_sensitive = case_sensitive
294294
self._longest_word_length = 0
295295

296296
self._tokenizer = _parse_into_words
297297
if tokenizer is not None:
298-
self._tokenizer = tokenizer
298+
self._tokenizer = tokenizer # type: ignore
299299

300300
def __contains__(self, key: KeyT) -> bool:
301301
"""turn on contains"""
@@ -313,13 +313,15 @@ def __iter__(self) -> typing.Generator[str, None, None]:
313313
"""turn on iter support"""
314314
yield from self._dictionary
315315

316-
def pop(self, key: KeyT, default: typing.Optional[int] = None) -> int:
316+
def pop(self, key: KeyT, default: typing.Optional[int] = None) -> typing.Optional[int]:
317317
"""Remove the key and return the associated value or default if not
318318
found
319319
320320
Args:
321321
key (str): The key to remove
322-
default (obj): The value to return if key is not present"""
322+
default (obj): The value to return if key is not present
323+
Returns:
324+
int | None: Returns the number of instances of key, or None if not in the dictionary"""
323325
key = ensure_unicode(key)
324326
return self._dictionary.pop(key if self._case_sensitive else key.lower(), default)
325327

@@ -364,7 +366,7 @@ def longest_word_length(self) -> int:
364366
Not settable"""
365367
return self._longest_word_length
366368

367-
def tokenize(self, text: KeyT) -> typing.Generator[str, None, None]:
369+
def tokenize(self, text: KeyT) -> typing.Iterator[str]:
368370
"""Tokenize the provided string object into individual words
369371
370372
Args:
@@ -377,7 +379,7 @@ def tokenize(self, text: KeyT) -> typing.Generator[str, None, None]:
377379
for word in self._tokenizer(tmp_text):
378380
yield word if self._case_sensitive else word.lower()
379381

380-
def keys(self) -> typing.Generator[str, None, None]:
382+
def keys(self) -> typing.Iterator[str]:
381383
"""Iterator over the key of the dictionary
382384
383385
Yields:
@@ -386,7 +388,7 @@ def keys(self) -> typing.Generator[str, None, None]:
386388
This is the same as `spellchecker.words()`"""
387389
yield from self._dictionary.keys()
388390

389-
def words(self) -> typing.Generator[str, None, None]:
391+
def words(self) -> typing.Iterator[str]:
390392
"""Iterator over the words in the dictionary
391393
392394
Yields:

0 commit comments

Comments
 (0)