  import tempfile
  import srsly
  from pathlib import Path
  from collections import OrderedDict
  from ...attrs import LANG
  from ...errors import Warnings, Errors
  from ...language import Language
 
</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 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         for key in ["use_jieba", "use_pkuseg", "require_pkuseg", "pkuseg_model"]:
 </s> add         for key in ["segmenter", "pkuseg_model", "pkuseg_user_dict"]: </s> remove         if self.pkuseg_seg:
 </s> add         if self.segmenter == "pkuseg":
import warnings
  import tempfile
  import srsly
import warnings
  from pathlib import Path
  from collections import OrderedDict
  from ...attrs import LANG
  from ...errors import Warnings, Errors
  from ...language import Language
keep add 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