Fix iteration order

This commit is contained in:
Matthew Honnibal 2020-09-25 21:47:22 +02:00
parent 3d8388969e
commit 26afd3bd90

View File

@ -62,7 +62,7 @@ def read_json_file(loc, docs_filter=None, limit=None):
"""Read Example dictionaries from a json file or directory."""
loc = util.ensure_path(loc)
if loc.is_dir():
for filename in loc.iterdir():
for filename in sorted(loc.iterdir()):
yield from read_json_file(loc / filename, limit=limit)
else:
with loc.open("rb") as file_: