diff --git a/spacy/ja/__init__.py b/spacy/ja/__init__.py index f9ab7b560..2915d6330 100644 --- a/spacy/ja/__init__.py +++ b/spacy/ja/__init__.py @@ -14,6 +14,9 @@ class Japanese(Language): lang = 'ja' def make_doc(self, text): - from janome.tokenizer import Tokenizer + try: + from janome.tokenizer import Tokenizer + except ImportError: + raise ImportError("The Japanese tokenizer requires the Janome library: https://github.com/mocobeta/janome") words = [x.surface for x in Tokenizer().tokenize(text)] return Doc(self.vocab, words=words, spaces=[False]*len(words))