class_docstr: Transforms an input by replacing its words with a neighboring character
  swap.
  
  Args:
      random_one (bool): Whether to return a single word with two characters
          swapped. If not, returns all possible options.
      skip_first_char (bool): Whether to disregard perturbing the first
          character.
      skip_last_char (bool): Whether to disregard perturbing the last
          character.
  >>> from textattack.transformations import WordSwapNeighboringCharacterSwap
  >>> from textattack.augmentation import Augmenter
  
  >>> transformation = WordSwapNeighboringCharacterSwap()
  >>> augmenter = Augmenter(transformation=transformation)
  >>> s = 'I am fabulous.'
  >>> augmenter.augment(s)
docstr: Returns a list containing all possible words with 1 pair of
  neighboring characters swapped.
docstr_tok: ["Returns","a","list","containing","all","possible","words","with","1","pair","of","neighboring","characters","swapped","."]
code: def _get_replacement_words(self, word):
      """Returns a list containing all possible words with 1 pair of
      neighboring characters swapped."""
  
      if len(word) <= 1:
          return []
  
      candidate_words = []
  
      start_idx = 1 if self.skip_first_char else 0
      end_idx = (
          (len(word) - 2) if self.skip_last_char else (len(word) - 1)
      )
  
      if start_idx >= end_idx:
          return []
  
      if self.random_one:
          i = np.random.randint(start_idx, end_idx)
          candidate_word = (
              word[:i] + word[i + 1] + word[i] + word[i + 2 :]
          )
          candidate_words.append(candidate_word)
      else:
          for i in range(start_idx, end_idx):
              candidate_word = (
                  word[:i] + word[i + 1] + word[i] + word[i + 2 :]
              )
              candidate_words.append(candidate_word)
  
      return candidate_words
  
file_path: TextAttack/textattack/transformations/word_swaps/word_swap_neighboring_character_swap.py
imports: import numpy
  from .word_swap import WordSwap
label_desc: Use image node_id 2 for calling the WordSwapNeighboringCharacterSwap obj's underlying member method code with example usage: obj._get_replacement_words(word) and returns: candidate_words, list, list