class_docstr: Transforms input by common abbreviations.
  
  Each sample generate one transformed sample at most.
  
  Example::
  
         "we're playing ping pang ball, you are so lazy. She's so beautiful!"
  
      >> "we are playing ping pang ball, you're so lazy. She is so beautiful!"
docstr: Transform text string according transform_field.
  
  :param ~Sample sample: input data, normally one data component.
  :param str field: indicate which field to transform.
  :param int n: number of generated samples
  :param kwargs:
  :return list trans_samples: transformed sample list.
code: def _transform(self, sample, field="x", n=1, **kwargs):
      r"""
      Transform text string according transform_field.
  
      :param ~Sample sample: input data, normally one data component.
      :param str field: indicate which field to transform.
      :param int n: number of generated samples
      :param kwargs:
      :return list trans_samples: transformed sample list.
  
      """
      tokens = sample.get_words(field)
  
      contractions_indices, phrases = self._get_contractions(tokens)
      phrases_indices, contractions = self._get_expanded_phrases(tokens)
      indices = contractions_indices + phrases_indices
      rep_items = phrases + contractions
  
      if indices:
          return [
              sample.unequal_replace_field_at_indices(
                  field, indices, rep_items
              )
          ]
  
      return []
  
file_path: textflint/textflint/generation/transformation/UT/contraction.py
imports: from ...transformation import Transformation
  from ....common.settings import CONTRACTION_PHRASES
label_desc: Use image node_id 3 for calling the Contraction obj's underlying member method code with example usage: obj._transform(sample, field, n) and returns: list, list