From ef80cfde6f5ffc6cb7be4b686c934a2ecf5c8ae6 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Mon, 11 Mar 2019 13:34:23 +0100 Subject: [PATCH] Fix pickling of Japanese (closes #3191) --- spacy/lang/ja/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spacy/lang/ja/__init__.py b/spacy/lang/ja/__init__.py index 39a3a3385..daea9b8d6 100644 --- a/spacy/lang/ja/__init__.py +++ b/spacy/lang/ja/__init__.py @@ -9,6 +9,7 @@ from .tag_map import TAG_MAP from ...attrs import LANG from ...language import Language from ...tokens import Doc, Token +from ...compat import copy_reg from ...util import DummyTokenizer @@ -107,4 +108,11 @@ class Japanese(Language): return self.tokenizer(text) +def pickle_japanese(instance): + return Japanese, tuple() + + +copy_reg.pickle(Japanese, pickle_japanese) + + __all__ = ["Japanese"]