          return jieba
      except ImportError:
          if use_jieba:
              msg = (
                  "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"
              )
              raise ImportError(msg)
  
  
  def try_pkuseg_import(use_pkuseg, pkuseg_model, pkuseg_user_dict):
 
</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 def try_pkuseg_import(use_pkuseg, pkuseg_model, pkuseg_user_dict):
 </s> add def try_pkuseg_import(segmenter, pkuseg_model, pkuseg_user_dict): </s> remove                 '`Chinese(meta={"tokenizer": {"config": {"pkuseg_model": name_or_path}}}).'
 </s> add                 '`cfg = {"segmenter": "pkuseg", "pkuseg_model": name_or_path}; '
                'nlp = Chinese(meta={"tokenizer": {"config": cfg}})`' </s> remove                     if self.use_pkuseg:
 </s> add                     if self.segmenter == "pkuseg": </s> remove                 "Chinese.use_pkuseg is True but no pkuseg model was specified. "
                "Please provide the name of a pretrained model "
 </s> add                 "The Chinese word segmenter is 'pkuseg' but no pkuseg model "
                "was specified. Please provide the name of a pretrained model "
                "Jieba not installed. To use jieba, install it with `pip "
                " install jieba` or from https://github.com/fxsjy/jieba"
          return jieba
      except ImportError:
          if use_jieba:
              msg = (
                "Jieba not installed. To use jieba, install it with `pip "
                " install jieba` or from https://github.com/fxsjy/jieba"
                "Jieba not installed. To use jieba, install it with `pip "
                " install jieba` or from https://github.com/fxsjy/jieba"
                "Jieba not installed. To use jieba, install it with `pip "
                " install jieba` or from https://github.com/fxsjy/jieba"
                "Jieba not installed. To use jieba, install it with `pip "
                " install jieba` or from https://github.com/fxsjy/jieba"
              )
              raise ImportError(msg)
  
  
  def try_pkuseg_import(use_pkuseg, pkuseg_model, pkuseg_user_dict):
keep keep keep keep replace replace replace 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