class_docstr: Transforms an input by replacing its words with double denial forms.
  
  Example::
  
      ori: The leading actor is good
      trans: The leading actor is not bad
docstr: Transform text string according field, this kind of transformation
  can only produce one sample.
  
  :param ~SASample sample: input data, a SASample contains 'x' field
      and 'y' field
  :param int n: number of generated samples, this transformation can
      only generate one sample
  :return list trans_samples: transformed sample list that only contain
      one sample
docstr_tok: ["Transform","text","string","according","field",",","this","kind","of","transformation","can","only","produce","one","sample",".",":","param","~SASample","sample",":","input","data",",","a","SASample","contains","'","x","'","field","and","'","y","'","field",":","param","int","n",":","number","of","generated","samples",",","this","transformation","can","only","generate","one","sample",":","return","list","trans_samples",":","transformed","sample","list","that","only","contain","one","sample"]
code: def _transform(self, sample, n=1, **kwargs):
      r"""
      Transform text string according field, this kind of transformation
      can only produce one sample.
  
      :param ~SASample sample: input data, a SASample contains 'x' field
          and 'y' field
      :param int n: number of generated samples, this transformation can
          only generate one sample
      :return list trans_samples: transformed sample list that only contain
          one sample
  
      """
      tokens = sample.get_tokens("x")
      sub_indices, sub_words = self._get_double_denial_info(tokens)
  
      if not sub_indices:
          return []
  
      sub_tokens = [
          self.processor.tokenize(sub_word) for sub_word in sub_words
      ]
      sample = sample.unequal_replace_field_at_indices(
          "x", sub_indices, sub_tokens
      )
      trans_samples = [sample]
      return trans_samples
  
file_path: textflint/textflint/generation/transformation/SACN/double_denial.py
imports: from ..transformation import Transformation
  from ....common.settings import CNSA_DOUBLE_DENIAL_DICT
label_desc: Use image node_id 3 for calling the CNDoubleDenial obj's underlying member method code with example usage: obj._transform(sample, n) and returns: trans_samples, list