  
      with make_tempdir() as d:
          file_path = d / "tokenizer"
          zh_tokenizer.to_disk(file_path)
          nlp = Chinese(meta={"tokenizer": {"config": {"use_jieba": False}}})
          nlp.tokenizer.from_disk(file_path)
          assert tokenizer_bytes == nlp.tokenizer.to_bytes()
  
  
  def test_zh_tokenizer_serialize_char(zh_tokenizer_char):
 
</s> remove     nlp = Chinese(meta={"tokenizer": {"config": {"use_jieba": False}}})
 </s> add     nlp = Chinese() </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 def test_extra_spaces(zh_tokenizer_char):
 </s> add def test_zh_extra_spaces(zh_tokenizer_char): </s> remove def test_zh_tokenizer_pkuseg_user_dict(zh_tokenizer_pkuseg):
 </s> add def test_zh_tokenizer_pkuseg_user_dict(zh_tokenizer_pkuseg, zh_tokenizer_char):
        nlp = Chinese()
  
      with make_tempdir() as d:
          file_path = d / "tokenizer"
          zh_tokenizer.to_disk(file_path)
        nlp = Chinese()
          nlp.tokenizer.from_disk(file_path)
          assert tokenizer_bytes == nlp.tokenizer.to_bytes()
  
  
  def test_zh_tokenizer_serialize_char(zh_tokenizer_char):
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/tests/lang/zh/test_serialize.py