                  del config[key]
          self.tokenizer = Language.Defaults().create_tokenizer(nlp)
  
      def __call__(self, text):
          use_jieba = self.use_jieba
          use_pkuseg = self.use_pkuseg
          if self.require_pkuseg:
              use_jieba = False
              use_pkuseg = True
          if use_jieba:
              words = list([x for x in self.jieba_seg.cut(text, cut_all=False) if x])
              (words, spaces) = util.get_words_and_spaces(words, text)
              return Doc(self.vocab, words=words, spaces=spaces)
          elif use_pkuseg:
              words = self.pkuseg_seg.cut(text)
 
</s> remove         elif use_pkuseg:
 </s> add         elif self.segmenter == "pkuseg":
            if self.pkuseg_seg is None:
                raise ValueError(Errors.E1000) </s> remove         else:
            # split into individual characters
            words = list(text)
            (words, spaces) = util.get_words_and_spaces(words, text)
            return Doc(self.vocab, words=words, spaces=spaces)
 </s> add         # warn if segmenter setting is not the only remaining option "char"
        if self.segmenter != "char":
            warn_msg = Warnings.W103.format(
                lang="Chinese",
                segmenter=self.segmenter,
                supported=", ".join([repr(s) for s in self.supported_segmenters]),
                default="'char' (character segmentation)",
            )
            warnings.warn(warn_msg)

        # split into individual characters
        words = list(text)
        (words, spaces) = util.get_words_and_spaces(words, text)
        return Doc(self.vocab, words=words, spaces=spaces) </s> remove         if self.pkuseg_seg:
 </s> add         if self.segmenter == "pkuseg": </s> remove     use_jieba = True
    use_pkuseg = False
 </s> add  </s> remove         for key in ["use_jieba", "use_pkuseg", "require_pkuseg", "pkuseg_model"]:
 </s> add         for key in ["segmenter", "pkuseg_model", "pkuseg_user_dict"]:
        if self.segmenter == "jieba":
                  del config[key]
          self.tokenizer = Language.Defaults().create_tokenizer(nlp)
  
      def __call__(self, text):
        if self.segmenter == "jieba":
        if self.segmenter == "jieba":
        if self.segmenter == "jieba":
        if self.segmenter == "jieba":
        if self.segmenter == "jieba":
        if self.segmenter == "jieba":
              words = list([x for x in self.jieba_seg.cut(text, cut_all=False) if x])
              (words, spaces) = util.get_words_and_spaces(words, text)
              return Doc(self.vocab, words=words, spaces=spaces)
          elif use_pkuseg:
              words = self.pkuseg_seg.cut(text)
keep keep keep keep replace replace 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