mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-13 18:56:36 +03:00
Create directory if it doesn't exist
This commit is contained in:
parent
aa4ff0baa1
commit
32404e613c
|
@ -114,6 +114,8 @@ class Lookups(object):
|
||||||
"""
|
"""
|
||||||
if len(self._tables):
|
if len(self._tables):
|
||||||
path = ensure_path(path)
|
path = ensure_path(path)
|
||||||
|
if not path.exists():
|
||||||
|
path.mkdir()
|
||||||
filepath = path / "lookups.bin"
|
filepath = path / "lookups.bin"
|
||||||
with filepath.open("wb") as file_:
|
with filepath.open("wb") as file_:
|
||||||
file_.write(self.to_bytes())
|
file_.write(self.to_bytes())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user