class_docstr: Chinese Text Processor class
class_docstr_tok: ["Chinese","Text","Processor","class"]
docstr: pos tag function.
  :param str sentence: the sentence need to be ner
  :return: the triple form (tags,start,end)
docstr_tok: ["pos","tag","function",".",":","param","str","sentence",":","the","sentence","need","to","be","ner",":","return",":","the","triple","form","(","tags",",","start",",","end",")"]
code: def get_pos_tag(self, sentence):
      r"""
      pos tag function.
      :param str sentence: the sentence need to be ner
      :return: the triple form (tags,start,end)
      """
  
      assert isinstance(sentence, (list, str))
      from ltp import LTP
  
      if isinstance(sentence, list):
          # Turn the list into sentence
          tmp = ""
          for word in sentence:
              tmp += word
          sentence = tmp
  
      if not sentence:
          return []
  
      if self.__pos is None:
          # get pos tag
          self.__pos = LTP()
      seg, hidden = self.__pos.seg([sentence])
      pos = self.__pos.pos(hidden)
      seg = seg[0]
      pos = pos[0]
      pos_tag = []
      cnt = 0
      for tag in range(len(pos)):
          pos_tag.append([pos[tag], cnt, cnt + len(seg[tag]) - 1])
          cnt += len(seg[tag])
  
      return pos_tag
  
file_path: textflint/textflint/common/preprocess/cn_processor.py
imports: import threading
  from ..settings import CN_SYNONYM_PATH, CN_ANTONYM_PATH
  from ..utils.install import download_if_needed
label_desc: Use image node_id 5 for calling the CnProcessor obj's underlying member method code with example usage: obj.get_pos_tag(sentence) and returns: pos_tag, list