mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 01:46:28 +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
|
continue
|
||||||
else:
|
else:
|
||||||
locs.append(path)
|
locs.append(path)
|
||||||
|
# It's good to sort these, in case the ordering messes up cache.
|
||||||
|
locs.sort()
|
||||||
return locs
|
return locs
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,8 @@ def walk_corpus(path: Union[str, Path], file_type) -> List[Path]:
|
||||||
locs.append(path)
|
locs.append(path)
|
||||||
if len(locs) == 0:
|
if len(locs) == 0:
|
||||||
warnings.warn(Warnings.W090.format(path=orig_path, format=file_type))
|
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
|
return locs
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user