class_docstr: Swap prefix and keep the same POS tags.
class_docstr_tok: ["Swap","prefix","and","keep","the","same","POS","tags","."]
docstr: Returns a list containing all possible words.
  
  :param word: str, the word to replace
  :param pos: str, the pos of the word to replace
  :param n: the number of returned words
  :return: a candidates list
docstr_tok: ["Returns","a","list","containing","all","possible","words",".",":","param","word",":","str",",","the","word","to","replace",":","param","pos",":","str",",","the","pos","of","the","word","to","replace",":","param","n",":","the","number","of","returned","words",":","return",":","a","candidates","list"]
code: def _get_candidates(self, word, pos, n=5):
      r"""
      Returns a list containing all possible words.
  
      :param word: str, the word to replace
      :param pos: str, the pos of the word to replace
      :param n: the number of returned words
      :return: a candidates list
      """
      assert pos is not None, "POS tag must be given!"
      candidates = []
      segs, _ = self.morpheme_analyzer.viterbi_segment(word)
      remain = "".join(segs[1:])
  
      if remain in self.remain_prefix_dict:
          for type, prefix in self.remain_prefix_dict[remain]:
              if type == pos and prefix != segs[0]:
                  candidates.append(prefix + remain)
      return self.sample_num(candidates, n)
  
file_path: textflint/textflint/generation/transformation/POS/prefix_swap.py
imports: from collections import Counter
  from ....input.component.sample import POSSample
  from ...transformation import WordSubstitute
  from ....common.utils.load import load_morfessor_model
  from ....common.utils.install import download_if_needed
  from ....common.settings import MORPHEME_ANALYZER
label_desc: Use image node_id 4 for calling the SwapPrefix obj's underlying member method code with example usage: obj._get_candidates(word, pos, n) and returns: self