class_docstr: Apply the jieba tokenizer to tokenize Chinese sentences.
  
  For more details, you may refer to [jieba](https://github.com/fxsjy/jieba)
class_docstr_tok: ["Apply","the","jieba","tokenizer","to","tokenize","Chinese","sentences",".","For","more","details",",","you","may","refer","to","[","jieba","]","(","https",":","\/\/github.com\/fxsjy\/jieba",")"]
code: def encode(self, sentences, output_type=str):
      if output_type is str:
          if isinstance(sentences, list):
              return [
                  list(self._tokenizer.cut(sentence))
                  for sentence in sentences
              ]
          else:
              return list(self._tokenizer.cut(sentences))
      elif output_type is int or output_type == "id":
          if self._vocab is None:
              raise TokenizerEncodeWithoutVocabError
          if isinstance(sentences, list):
              return [
                  [
                      self._vocab[ele]
                      for ele in self._tokenizer.cut(sentence)
                  ]
                  for sentence in sentences
              ]
          else:
              return [
                  self._vocab[ele]
                  for ele in self._tokenizer.cut(sentences)
              ]
      else:
          raise TokenTypeNotSupportedError(output_type)
  
file_path: gluon-nlp/src/gluonnlp/data/tokenizers/jieba.py
imports: from typing import Optional
  from .base import *
  from ..vocab import Vocab
  from ...utils.lazy_imports import try_import_jieba
label_desc: Use image node_id 2 for calling the JiebaTokenizer obj's underlying member method code with example usage: obj.encode(sentences, output_type) and returns: unknown, list, unknown, unknown