docstr: Tokenize a document with the Jieba tokenizer and wrap the results into a Doc object.
          
docstr_tok: ["Tokenize","a","document","with","the","Jieba","tokenizer","and","wrap","the","results","into","a","Doc","object","."]
code: def process(self, document):
      """Tokenize a document with the Jieba tokenizer and wrap the results into a Doc object."""
      if isinstance(document, doc.Document):
          text = document.text
      else:
          text = document
      if not isinstance(text, str):
          raise Exception(
              "Must supply a string or Stanza Document object to the Jieba tokenizer."
          )
      tokens = self.nlp.cut(text, cut_all=False)
  
      sentences = []
      current_sentence = []
      offset = 0
      for token in tokens:
          if re.match(r"\s+", token):
              offset += len(token)
              continue
  
          token_entry = {
              doc.TEXT: token,
              doc.MISC: f"{doc.START_CHAR}={offset}|{doc.END_CHAR}={offset+len(token)}",
          }
          current_sentence.append(token_entry)
          offset += len(token)
  
          if not self.no_ssplit and token in ["。", "！", "？", "!", "?"]:
              sentences.append(current_sentence)
              current_sentence = []
  
      if len(current_sentence) > 0:
          sentences.append(current_sentence)
  
      return doc.Document(sentences, text)
  
file_path: stanza/stanza/pipeline/external/jieba.py
imports: import re
  from stanza.models.common import doc
  from stanza.pipeline._constants import TOKENIZE
  from stanza.pipeline.processor import ProcessorVariant, register_processor_variant
label_desc: Use image node_id 2 for calling the JiebaTokenizer obj's underlying member method code with example usage: obj.process(document) and returns: doc