mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 09:56:28 +03:00
Ensure path on read_json
This commit is contained in:
parent
e1e73936b1
commit
070e026ed9
|
@ -417,6 +417,7 @@ def read_json(location):
|
||||||
location (Path): Path to JSON file.
|
location (Path): Path to JSON file.
|
||||||
RETURNS (dict): Loaded JSON content.
|
RETURNS (dict): Loaded JSON content.
|
||||||
"""
|
"""
|
||||||
|
location = ensure_path(location)
|
||||||
with location.open('r', encoding='utf8') as f:
|
with location.open('r', encoding='utf8') as f:
|
||||||
return ujson.load(f)
|
return ujson.load(f)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user