class_docstr: Entity position swap with paraphrase(employee related)
class_docstr_tok: ["Entity","position","swap","with","paraphrase","(","employee","related",")"]
docstr: split sentence into 3 pieces: left, middle and right.
  
  :param list head_pos: position of subject entity
  :param list tail_pos: position of object entity
  :param list words: sentence tokens
  :return bool: whether to reverse position of subject entity and
      object entity
          list: entity placed on the left
          list: entity placed on the right
          list: token indices place between left entity and right entity
          list: token place between left entity and right entity
          list: tokens place on the left of left entity
          list: tokens place on the right of right entity
docstr_tok: ["split","sentence","into","3","pieces",":","left",",","middle","and","right",".",":","param","list","head_pos",":","position","of","subject","entity",":","param","list","tail_pos",":","position","of","object","entity",":","param","list","words",":","sentence","tokens",":","return","bool",":","whether","to","reverse","position","of","subject","entity","and","object","entity","list",":","entity","placed","on","the","left","list",":","entity","placed","on","the","right","list",":","token","indices","place","between","left","entity","and","right","entity","list",":","token","place","between","left","entity","and","right","entity","list",":","tokens","place","on","the","left","of","left","entity","list",":","tokens","place","on","the","right","of","right","entity"]
code: def split_sent(self, head_pos, tail_pos, words):
      r"""
      split sentence into 3 pieces: left, middle and right.
  
      :param list head_pos: position of subject entity
      :param list tail_pos: position of object entity
      :param list words: sentence tokens
      :return bool: whether to reverse position of subject entity and
          object entity
              list: entity placed on the left
              list: entity placed on the right
              list: token indices place between left entity and right entity
              list: token place between left entity and right entity
              list: tokens place on the left of left entity
              list: tokens place on the right of right entity
      """
  
      assert isinstance(head_pos, list), (
          f"the type of 'head_pos' "
          f"should be list, got {type(head_pos)} instead"
      )
      assert isinstance(tail_pos, list), (
          f"the type of 'tail_pos' should be list, "
          f"got {type(tail_pos)} instead"
      )
      assert isinstance(words, list), (
          f"the type of 'words' should be list, "
          f"got {type(words)} instead"
      )
      assert len(head_pos) == 2 and len(tail_pos) == 2, (
          f"the length of pos should be 2, "
          f"got input length of {len(head_pos)} or {len(tail_pos)} instead"
      )
      assert (
          head_pos[0] <= head_pos[1] and tail_pos[0] <= tail_pos[1]
      ), (
          f"start index of entity should not be greater "
          f"than end index, got {head_pos[0]}>{head_pos[1]} "
          f"or {tail_pos[0]}>{tail_pos[1]} instead"
      )
      assert (
          head_pos[0] >= 0 and tail_pos[0] >= 0
      ), f"start index of entity should be greater than 0, got \
              {head_pos[0]}<0 or {tail_pos[0]}<0 instead"
      assert head_pos[1] < len(words) and tail_pos[1] < len(words), (
          f"end index of entity should not be greater "
          f"than the length of words, got \
              {head_pos[1]}>={len(words)} or {tail_pos[1]}>={len(words)} instead"
      )
  
      if head_pos[-1] < tail_pos[0]:
          pre = head_pos
          post = tail_pos
          reverse = False
      elif tail_pos[-1] < head_pos[0]:
          reverse = True
          pre = tail_pos
          post = head_pos
      else:
          return None
  
      left = words[pre[0] : pre[1] + 1]
      right = words[post[0] : post[1] + 1]
      middle_pos = [pre[-1] + 1, post[0]]
      middle_words = words[pre[-1] + 1 : post[0]]
      left_words = words[: pre[0]]
      right_words = words[post[1] + 1 :]
  
      return (
          reverse,
          left,
          right,
          middle_pos,
          middle_words,
          left_words,
          right_words,
      )
  
file_path: textflint/textflint/generation/transformation/RE/swap_employee.py
imports: from ...transformation import Transformation
  from ....common.settings import TITLE
  from ....common.utils.install import download_if_needed
  from ....common.utils.load import json_loader
  from ....input.component.sample.re_sample import RESample
label_desc: Use image node_id 3 for calling the SwapEmployee obj's underlying member method code with example usage: obj.split_sent(head_pos, tail_pos, words) and returns: reverse,  left,  right,  middle_pos,  middle_words,  left_words,  right_words, None