Skip to content

Commit

Permalink
remove encoding from json.loads call (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
barrust authored Aug 15, 2020
1 parent 3866d7c commit 4ff68f7
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 11 deletions.
25 changes: 18 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
language: python
matrix:
jobs:
include:
- python: 2.7
- python: 3.4
- python: 3.5
- python: 3.6
- python: 3.7
- os: linux
dist: bionic
python: 2.7
- os: linux
dist: xenial
sudo: true
python: 3.4
- os: linux
dist: xenial
python: 3.5
- os: linux
dist: bionic
python: 3.6
- os: linux
dist: bionic
python: 3.7
- os: linux
dist: bionic
python: 3.8

install:
- pip install -r requirements/requirements-dev.txt
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# pyspellchecker

## Version 0.5.5
* Remove `encode` from the call to `json.loads()`

## Version 0.5.4
* Reduce words in __edit_distance_alt to improve memory performance; thanks [blayzen-w](https://github.com/blayzen-w)

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def read_file(filepath):
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7'
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8'
],
test_suite = 'tests'
)
2 changes: 1 addition & 1 deletion spellchecker/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
__maintainer__ = "Tyler Barrus"
__email__ = "[email protected]"
__license__ = "MIT"
__version__ = "0.5.4"
__version__ = "0.5.5"
__credits__ = ["Peter Norvig"]
__url__ = "https://github.com/barrust/pyspellchecker"
__bugtrack_url__ = "{0}/issues".format(__url__)
4 changes: 2 additions & 2 deletions spellchecker/spellchecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class SpellChecker(object):
Args:
language (str): The language of the dictionary to load or None \
for no dictionary. Supported languages are `en`, `es`, `de`, fr` \
for no dictionary. Supported languages are `en`, `es`, `de`, `fr` \
and `pt`. Defaults to `en`
local_dictionary (str): The path to a locally stored word \
frequency dictionary; if provided, no language will be loaded
Expand Down Expand Up @@ -419,7 +419,7 @@ def load_dictionary(self, filename, encoding="utf-8"):
encoding (str): The encoding of the dictionary """
with load_file(filename, encoding) as data:
data = data if self._case_sensitive else data.lower()
self._dictionary.update(json.loads(data, encoding=encoding))
self._dictionary.update(json.loads(data))
self._update_dictionary()

def load_text_file(self, filename, encoding="utf-8", tokenizer=None):
Expand Down

0 comments on commit 4ff68f7

Please sign in to comment.