mirror of
https://github.com/explosion/spaCy.git
synced 2025-04-30 13:53:45 +03:00
Fix iteration order
This commit is contained in:
parent
3d8388969e
commit
26afd3bd90
|
@ -62,7 +62,7 @@ def read_json_file(loc, docs_filter=None, limit=None):
|
||||||
"""Read Example dictionaries from a json file or directory."""
|
"""Read Example dictionaries from a json file or directory."""
|
||||||
loc = util.ensure_path(loc)
|
loc = util.ensure_path(loc)
|
||||||
if loc.is_dir():
|
if loc.is_dir():
|
||||||
for filename in loc.iterdir():
|
for filename in sorted(loc.iterdir()):
|
||||||
yield from read_json_file(loc / filename, limit=limit)
|
yield from read_json_file(loc / filename, limit=limit)
|
||||||
else:
|
else:
|
||||||
with loc.open("rb") as file_:
|
with loc.open("rb") as file_:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user