mirror of https://github.com/explosion/spaCy.git
Fix #617: Vocab.load() required Path. Should work with string as well.
This commit is contained in:
parent
e86f440ca6
commit
f123f92e0c
|
@ -6,8 +6,8 @@ from libc.stdint cimport int32_t
|
||||||
from libc.stdint cimport uint64_t
|
from libc.stdint cimport uint64_t
|
||||||
from libc.math cimport sqrt
|
from libc.math cimport sqrt
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
import bz2
|
import bz2
|
||||||
from os import path
|
|
||||||
import io
|
import io
|
||||||
import math
|
import math
|
||||||
import ujson as json
|
import ujson as json
|
||||||
|
@ -71,6 +71,8 @@ cdef class Vocab:
|
||||||
Returns:
|
Returns:
|
||||||
Vocab: The newly constructed vocab object.
|
Vocab: The newly constructed vocab object.
|
||||||
"""
|
"""
|
||||||
|
if isinstance(path, basestring):
|
||||||
|
path = Path(path)
|
||||||
util.check_renamed_kwargs({'get_lex_attr': 'lex_attr_getters'}, deprecated_kwargs)
|
util.check_renamed_kwargs({'get_lex_attr': 'lex_attr_getters'}, deprecated_kwargs)
|
||||||
if 'vectors' in deprecated_kwargs:
|
if 'vectors' in deprecated_kwargs:
|
||||||
raise AttributeError(
|
raise AttributeError(
|
||||||
|
|
Loading…
Reference in New Issue