mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
Sort paths for cache consistency
This commit is contained in:
parent
c3b5a3cfff
commit
3d8388969e
|
@ -209,6 +209,8 @@ def walk_directory(path: Path, converter: str) -> List[Path]:
|
|||
continue
|
||||
else:
|
||||
locs.append(path)
|
||||
# It's good to sort these, in case the ordering messes up cache.
|
||||
locs.sort()
|
||||
return locs
|
||||
|
||||
|
||||
|
|
|
@ -50,6 +50,8 @@ def walk_corpus(path: Union[str, Path], file_type) -> List[Path]:
|
|||
locs.append(path)
|
||||
if len(locs) == 0:
|
||||
warnings.warn(Warnings.W090.format(path=orig_path, format=file_type))
|
||||
# It's good to sort these, in case the ordering messes up a cache.
|
||||
locs.sort()
|
||||
return locs
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user