mirror of https://github.com/explosion/spaCy.git
Move reader
This commit is contained in:
parent
43fc7a316d
commit
4ad26f4a2f
|
@ -30,11 +30,6 @@ def create_jsonl_reader(
|
|||
return JsonlTexts(path, min_length=min_length, max_length=max_length, limit=limit)
|
||||
|
||||
|
||||
@util.registry.readers("srsly.read_json.v1")
|
||||
def _read_json(loc: Path):
|
||||
return srsly.read_json(loc)
|
||||
|
||||
|
||||
def walk_corpus(path: Union[str, Path], file_type) -> List[Path]:
|
||||
path = util.ensure_path(path)
|
||||
if not path.is_dir() and path.parts[-1].endswith(file_type):
|
||||
|
|
|
@ -97,6 +97,9 @@ class registry(thinc.registry):
|
|||
models = catalogue.create("spacy", "models", entry_points=True)
|
||||
cli = catalogue.create("spacy", "cli", entry_points=True)
|
||||
|
||||
# We want json loading in the registry, so manually register srsly.read_json.
|
||||
registry.readers("srsly.read_json.v0", srsly.read_json)
|
||||
|
||||
|
||||
class SimpleFrozenDict(dict):
|
||||
"""Simplified implementation of a frozen dict, mainly used as default
|
||||
|
|
Loading…
Reference in New Issue