Adjust message [ci skip]

This commit is contained in:
Ines Montani 2020-10-05 21:38:23 +02:00
parent 4cf73d85bc
commit 2d0c0134bc

View File

@ -206,7 +206,7 @@ class ChineseTokenizer(DummyTokenizer):
import spacy_pkuseg import spacy_pkuseg
except ImportError: except ImportError:
raise ImportError( raise ImportError(
"spacy_pkuseg not installed. To use this model, " "spacy-pkuseg not installed. To use this model, "
+ _PKUSEG_INSTALL_MSG + _PKUSEG_INSTALL_MSG
) from None ) from None
self.pkuseg_seg = spacy_pkuseg.pkuseg(str(tempdir)) self.pkuseg_seg = spacy_pkuseg.pkuseg(str(tempdir))
@ -256,7 +256,7 @@ class ChineseTokenizer(DummyTokenizer):
except ImportError: except ImportError:
if self.segmenter == Segmenter.pkuseg: if self.segmenter == Segmenter.pkuseg:
raise ImportError( raise ImportError(
"spacy_pkuseg not installed. To use this model, " "spacy-pkuseg not installed. To use this model, "
+ _PKUSEG_INSTALL_MSG + _PKUSEG_INSTALL_MSG
) from None ) from None
if path.exists(): if path.exists():
@ -317,7 +317,7 @@ def try_pkuseg_import(pkuseg_model: str, pkuseg_user_dict: str) -> None:
import spacy_pkuseg import spacy_pkuseg
except ImportError: except ImportError:
msg = "spacy_pkuseg not installed. To use pkuseg, " + _PKUSEG_INSTALL_MSG msg = "spacy-pkuseg not installed. To use pkuseg, " + _PKUSEG_INSTALL_MSG
raise ImportError(msg) from None raise ImportError(msg) from None
try: try:
return spacy_pkuseg.pkuseg(pkuseg_model, pkuseg_user_dict) return spacy_pkuseg.pkuseg(pkuseg_model, pkuseg_user_dict)