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 bool reverse: if the position of head and tail entity is reversed
  :param list left: entity placed on the left
  :param list right: entity placed on the right
  :param list left_words: tokens place on the left of left entity
  :param list right_words: tokens place on the right of right entity
  :param list middle_words: token place between left entity
      and right entity
  :param list title_pos: the position of TITLE
  : return list: new list of words
           list: the position of subject entity
           list: the position of object entity
docstr_tok: ["split","sentence","into","3","pieces",":","left",",","middle","and","right",".",":","param","bool","reverse",":","if","the","position","of","head","and","tail","entity","is","reversed",":","param","list","left",":","entity","placed","on","the","left",":","param","list","right",":","entity","placed","on","the","right",":","param","list","left_words",":","tokens","place","on","the","left","of","left","entity",":","param","list","right_words",":","tokens","place","on","the","right","of","right","entity",":","param","list","middle_words",":","token","place","between","left","entity","and","right","entity",":","param","list","title_pos",":","the","position","of","TITLE",":","return","list",":","new","list","of","words","list",":","the","position","of","subject","entity","list",":","the","position","of","object","entity"]
code: def generate_new_item(
      self,
      reverse,
      left,
      right,
      left_words,
      right_words,
      middle_words,
      title_pos,
  ):
      r"""
      split sentence into 3 pieces: left, middle and right.
  
      :param bool reverse: if the position of head and tail entity is reversed
      :param list left: entity placed on the left
      :param list right: entity placed on the right
      :param list left_words: tokens place on the left of left entity
      :param list right_words: tokens place on the right of right entity
      :param list middle_words: token place between left entity
          and right entity
      :param list title_pos: the position of TITLE
      : return list: new list of words
               list: the position of subject entity
               list: the position of object entity
  
      """
      assert isinstance(left_words, list), (
          f"the type of 'left_words' should be list, "
          f"got {type(left_words)} instead"
      )
      assert isinstance(right_words, list), (
          f"the type of 'right_words' should be list, "
          f"got {type(right_words)} instead"
      )
      assert isinstance(left, list), (
          f"the type of 'left_words' should be list, "
          f"got {type(left)} instead"
      )
      assert isinstance(right, list), (
          f"the type of 'right_words' should be list, "
          f"got {type(right)} instead"
      )
      assert isinstance(middle_words, list), (
          f"the type of 'right_words' should be list, "
          f"got {type(middle_words)} instead"
      )
      assert isinstance(title_pos, list), (
          f"the type of 'title_pos' should be list, "
          f"got {type(title_pos)} instead"
      )
      assert isinstance(reverse, bool), (
          f"the type of 'reverse' should be bool, "
          f"got {type(reverse)} instead"
      )
      assert title_pos[1] <= len(middle_words), (
          f"the end of 'title_pos' should not be larger than "
          f"the length of 'middle_words', "
          f"got {title_pos[1]}>{len(middle_words)} instead"
      )
  
      new_middle_words = list(middle_words[title_pos[1] :])
      new_words = (
          left_words + left + new_middle_words + right + right_words
      )
      left_pos = [len(left_words), len(left_words) + len(left) - 1]
      right_pos = [
          len(left_words) + len(left) + len(new_middle_words),
          len(left_words)
          + len(left)
          + len(new_middle_words)
          + len(right)
          - 1,
      ]
  
      if not reverse:
          sh, st = left_pos
          oh, ot = right_pos
      else:
          sh, st = right_pos
          oh, ot = left_pos
  
      return new_words, [sh, st], [oh, ot]
  
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 5 for calling the SwapEmployee obj's underlying member method code with example usage: obj.generate_new_item(reverse, left, right, left_words, right_words, middle_words, title_pos) and returns: new_words,  list,  list