class_docstr: Transforms an input by replacing its tokens with words of mask language
  predicted.
  To accelerate transformation for long text, input single sentence to
  language model rather than whole text.
docstr: Get a list of transformed tokens. Default one word replace one char.
  
  :param str word: token word to transform.
  :param int n: number of transformed tokens to generate.
  :param kwargs:
  :return: candidate list
code: def _get_candidates(self, word, pos=None, n=5, **kwargs):
      r"""
      Get a list of transformed tokens. Default one word replace one char.
  
      :param str word: token word to transform.
      :param int n: number of transformed tokens to generate.
      :param kwargs:
      :return: candidate list
  
      """
      pinyins = lazy_pinyin(word)
      new_pinyins = []
  
      for pinyin in pinyins:
          if "eng" in pinyin:
              pinyin = pinyin.replace("eng", "en")
          elif ("en" in pinyin) and pinyin != "en":
              pinyin = pinyin.replace("en", "eng")
  
          if "ang" in pinyin:
              pinyin = pinyin.replace("ang", "an")
          elif "an" in pinyin:
              pinyin = pinyin.replace("an", "ang")
  
          if "ing" in pinyin:
              pinyin = pinyin.replace("ing", "in")
          elif "in" in pinyin:
              pinyin = pinyin.replace("in", "ing")
          new_pinyins.append(pinyin)
      try:
          result = viterbi(
              hmm_params=hmmparams,
              observations=new_pinyins,
              path_num=n + 1,
          )
      except:
          # TODO  add log
          return []
  
      ret = []
      for i in result:
          if "".join(i.path) != word:
              ret.append("".join(i.path))
  
      return ret
  
file_path: textflint/textflint/generation/transformation/UTCN/cn_nasal.py
imports: from ...transformation import CnWordSubstitute
  from pypinyin import lazy_pinyin
  from Pinyin2Hanzi import DefaultHmmParams
  from Pinyin2Hanzi import viterbi
label_desc: Use image node_id 3 for calling the CnNasal obj's underlying member method code with example usage: obj._get_candidates(word, pos, n) and returns: ret, list