class_docstr: Replace word with its synonym.
  
  Example::
  
      先生过奖了 -> 先生过誉了
class_docstr_tok: ["Replace","word","with","its","synonym",".","Example",":",":","\u5148\u751f\u8fc7\u5956\u4e86","-",">","\u5148\u751f\u8fc7\u8a89\u4e86"]
docstr: In this function, there are several deformation modes.
  
  :param ~textflint.CWSSample sample: the data which need be changed
  :param **kwargs:
  :return: In this function, there may be multiple outputs
docstr_tok: ["In","this","function",",","there","are","several","deformation","modes",".",":","param","~textflint.CWSSample","sample",":","the","data","which","need","be","changed",":","param","*","*","kwargs",":",":","return",":","In","this","function",",","there","may","be","multiple","outputs"]
code: def _transform(self, sample, n=5, **kwargs):
      r"""
      In this function, there are several deformation modes.
  
      :param ~textflint.CWSSample sample: the data which need be changed
      :param **kwargs:
      :return: In this function, there may be multiple outputs
  
      """
      # get sentence words
      origin_words = sample.get_words()
  
      # change function
      change_pos, change_word = self._get_transformations(
          origin_words, n
      )
      if len(change_pos) == 0:
          return []
  
      change_word = descartes(change_word, n)
      return [
          sample.replace_at_ranges(change_pos, words)
          for words in change_word
      ]
  
file_path: textflint/textflint/generation/transformation/CWS/swap_syn.py
imports: from ..transformation import Transformation
  from ....common.settings import SYNONYM_PATH
  from ....common.utils.load import plain_lines_loader
  from ....common.utils.install import download_if_needed
  from ....common.utils.list_op import descartes
  import random
label_desc: Use image node_id 4 for calling the SwapSyn obj's underlying member method code with example usage: obj._transform(sample, n) and returns: unknown, list