      tokens = [token.text for token in zh_tokenizer_pkuseg(text)]
      assert tokens == expected_tokens
  
  
  def test_zh_tokenizer_pkuseg_user_dict(zh_tokenizer_pkuseg):
      user_dict = _get_pkuseg_trie_data(zh_tokenizer_pkuseg.pkuseg_seg.preprocesser.trie)
      zh_tokenizer_pkuseg.pkuseg_update_user_dict(["nonsense_asdf"])
      updated_user_dict = _get_pkuseg_trie_data(
          zh_tokenizer_pkuseg.pkuseg_seg.preprocesser.trie
      )
 
</s> remove def test_extra_spaces(zh_tokenizer_char):
 </s> add def test_zh_extra_spaces(zh_tokenizer_char): </s> remove         config = OrderedDict(
            (
                ("use_jieba", self.use_jieba),
                ("use_pkuseg", self.use_pkuseg),
                ("require_pkuseg", self.require_pkuseg),
            )
        )
 </s> add         config = OrderedDict((("segmenter", self.segmenter),)) </s> remove     nlp = Chinese(meta={"tokenizer": {"config": {"use_jieba": False}}})
 </s> add     nlp = Chinese()
def test_zh_tokenizer_pkuseg_user_dict(zh_tokenizer_pkuseg, zh_tokenizer_char):
      tokens = [token.text for token in zh_tokenizer_pkuseg(text)]
      assert tokens == expected_tokens
  
  
def test_zh_tokenizer_pkuseg_user_dict(zh_tokenizer_pkuseg, zh_tokenizer_char):
      user_dict = _get_pkuseg_trie_data(zh_tokenizer_pkuseg.pkuseg_seg.preprocesser.trie)
      zh_tokenizer_pkuseg.pkuseg_update_user_dict(["nonsense_asdf"])
      updated_user_dict = _get_pkuseg_trie_data(
          zh_tokenizer_pkuseg.pkuseg_seg.preprocesser.trie
      )
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_tokenizer.py