          def load_pkuseg_model(path):
              try:
                  import pkuseg
              except ImportError:
                  if self.use_pkuseg:
                      raise ImportError(
                          "pkuseg not installed. To use this model, "
                          + _PKUSEG_INSTALL_MSG
                      )
              if path.exists():
 
</s> remove         if use_pkuseg:
            msg = (
                "pkuseg not installed. Either set Chinese.use_pkuseg = False, "
                "or " + _PKUSEG_INSTALL_MSG
            )
 </s> add         if segmenter == "pkuseg":
            msg = "pkuseg not installed. To use pkuseg, " + _PKUSEG_INSTALL_MSG </s> remove                     if self.use_pkuseg:
 </s> add                     if self.segmenter == "pkuseg": </s> remove                 "Jieba not installed. Either set the default to False with "
                "`from spacy.lang.zh import ChineseDefaults; ChineseDefaults.use_jieba = False`, "
                "or install it with `pip install jieba` or from "
                "https://github.com/fxsjy/jieba"
 </s> add                 "Jieba not installed. To use jieba, install it with `pip "
                " install jieba` or from https://github.com/fxsjy/jieba" </s> remove                 if self.use_pkuseg:
 </s> add                 if self.segmenter == "pkuseg": </s> remove         if use_pkuseg:
 </s> add         if segmenter == "pkuseg":
                if self.segmenter == "pkuseg":
          def load_pkuseg_model(path):
              try:
                  import pkuseg
              except ImportError:
                if self.segmenter == "pkuseg":
                      raise ImportError(
                          "pkuseg not installed. To use this model, "
                          + _PKUSEG_INSTALL_MSG
                      )
              if path.exists():
keep keep keep keep replace keep keep keep keep keep
 Refactor Chinese tokenizer configuration (#5736)

* Refactor Chinese tokenizer configuration

Refactor `ChineseTokenizer` configuration so that it uses a single
`segmenter` setting to choose between character segmentation, jieba, and
pkuseg.

* replace `use_jieba`, `use_pkuseg`, `require_pkuseg` with the setting
`segmenter` with the supported values: `char`, `jieba`, `pkuseg`
* make the default segmenter plain character segmentation `char` (no
additional libraries required)

* Fix Chinese serialization test to use char default

* Warn if attempting to customize other segmenter

Add a warning if `Chinese.pkuseg_update_user_dict` is called when
another segmenter is selected. 
spacy/lang/zh/__init__.py