class_docstr: Make the first word of the surname and the preceding word form a word,
          and the last word of the name and the following word form a word
  
  Example::
  
      我朝小明走了过去 -> 我朝向明走了过去
class_docstr_tok: ["Make","the","first","word","of","the","surname","and","the","preceding","word","form","a","word",",","and","the","last","word","of","the","name","and","the","following","word","form","a","word","Example",":",":","\u6211\u671d\u5c0f\u660e\u8d70\u4e86\u8fc7\u53bb","-",">","\u6211\u671d\u5411\u660e\u8d70\u4e86\u8fc7\u53bb"]
docstr: We randomly generated five sets of data.
  
  :param ~textflint.CWSSample sample: sample the data which need be changed
  :param int n: number of generated data
  :param **kwargs:
  :return: trans_sample a list of sample
docstr_tok: ["We","randomly","generated","five","sets","of","data",".",":","param","~textflint.CWSSample","sample",":","sample","the","data","which","need","be","changed",":","param","int","n",":","number","of","generated","data",":","param","*","*","kwargs",":",":","return",":","trans_sample","a","list","of","sample"]
code: def _transform(self, sample, n=5, **kwargs):
      r"""
      We randomly generated five sets of data.
  
      :param ~textflint.CWSSample sample: sample the data which need be changed
      :param int n: number of generated data
      :param **kwargs:
      :return: trans_sample a list of sample
      """
      # get sentence and label and ner_label
      origin_sentence = sample.get_value("x")
      origin_label = sample.get_value("y")
      ner_label, _ = sample.ner
  
      # change function
      change_pos, change_list = self._get_transformations(
          origin_sentence, origin_label, ner_label, n
      )
  
      if len(change_pos) == 0:
          return []
  
      change_list = descartes(change_list, n)
      return [
          sample.replace_at_ranges(change_pos, item)
          for item in change_list
      ]
  
file_path: textflint/textflint/generation/transformation/CWS/swap_name.py
imports: import random
  from ..transformation import Transformation
  from ....common.settings import NAME_PATH, WORD_LIST_PATH
  from ....common.utils.load import plain_lines_loader
  from ....common.utils.install import download_if_needed
  from ....common.utils.list_op import descartes
label_desc: Use image node_id 4 for calling the SwapName obj's underlying member method code with example usage: obj._transform(sample, n) and returns: unknown, list