docstr: A transformation that swaps characters with adjacent keys on a
  QWERTY keyboard, replicating the kind of errors that come from typing
  too quickly.
  
  :param random_one: Whether to return a single (random) swap, or all possible swaps.
  :param skip_first_char: When True, do not modify the first character of each word.
  :param skip_last_char: When True, do not modify the last character of each word.
  >>> from textattack.transformations import WordSwapQWERTY
  >>> from textattack.augmentation import Augmenter
  
  >>> transformation = WordSwapQWERT()
  >>> augmenter = Augmenter(transformation=transformation)
  >>> s = 'I am fabulous.'
  >>> augmenter.augment(s)
docstr_tok: ["A","transformation","that","swaps","characters","with","adjacent","keys","on","a","QWERTY","keyboard",",","replicating","the","kind","of","errors","that","come","from","typing","too","quickly",".",":","param","random_one",":","Whether","to","return","a","single","(","random",")","swap",",","or","all","possible","swaps",".",":","param","skip_first_char",":","When","True",",","do","not","modify","the","first","character","of","each","word",".",":","param","skip_last_char",":","When","True",",","do","not","modify","the","last","character","of","each","word",".",">",">",">","from","textattack.transformations","import","WordSwapQWERTY",">",">",">","from","textattack.augmentation","import","Augmenter",">",">",">","transformation","=","WordSwapQWERT","(",")",">",">",">","augmenter","=","Augmenter","(","transformation=transformation",")",">",">",">","s","=","'","I","am","fabulous",".","'",">",">",">","augmenter.augment","(","s",")"]
code: def __init__(
      self,
      random_one=True,
      skip_first_char=False,
      skip_last_char=False,
      **kwargs,
  ):
      """A transformation that swaps characters with adjacent keys on a
      QWERTY keyboard, replicating the kind of errors that come from typing
      too quickly.
  
      :param random_one: Whether to return a single (random) swap, or all possible swaps.
      :param skip_first_char: When True, do not modify the first character of each word.
      :param skip_last_char: When True, do not modify the last character of each word.
      >>> from textattack.transformations import WordSwapQWERTY
      >>> from textattack.augmentation import Augmenter
  
      >>> transformation = WordSwapQWERT()
      >>> augmenter = Augmenter(transformation=transformation)
      >>> s = 'I am fabulous.'
      >>> augmenter.augment(s)
      """
      super().__init__(**kwargs)
      self.random_one = random_one
      self.skip_first_char = skip_first_char
      self.skip_last_char = skip_last_char
  
      self._keyboard_adjacency = {
          "q": [
              "w",
              "a",
              "s",
          ],
          "w": ["q", "e", "a", "s", "d"],
          "e": ["w", "s", "d", "f", "r"],
          "r": ["e", "d", "f", "g", "t"],
          "t": ["r", "f", "g", "h", "y"],
          "y": ["t", "g", "h", "j", "u"],
          "u": ["y", "h", "j", "k", "i"],
          "i": ["u", "j", "k", "l", "o"],
          "o": ["i", "k", "l", "p"],
          "p": ["o", "l"],
          "a": ["q", "w", "s", "z", "x"],
          "s": ["q", "w", "e", "a", "d", "z", "x"],
          "d": ["w", "e", "r", "f", "c", "x", "s"],
          "f": ["e", "r", "t", "g", "v", "c", "d"],
          "g": ["r", "t", "y", "h", "b", "v", "d"],
          "h": ["t", "y", "u", "g", "j", "b", "n"],
          "j": ["y", "u", "i", "k", "m", "n", "h"],
          "k": ["u", "i", "o", "l", "m", "j"],
          "l": ["i", "o", "p", "k"],
          "z": ["a", "s", "x"],
          "x": ["s", "d", "z", "c"],
          "c": ["x", "d", "f", "v"],
          "v": ["c", "f", "g", "b"],
          "b": ["v", "g", "h", "n"],
          "n": ["b", "h", "j", "m"],
          "m": ["n", "j", "k"],
      }
  
file_path: TextAttack/textattack/transformations/word_swaps/word_swap_qwerty.py
imports: import random
  from .word_swap import WordSwap
label_desc: Use image node_id 1 to create a new WordSwapQWERTY object from inherited base classes: WordSwap with example: obj = WordSwapQWERTY(random_one, skip_first_char, skip_last_char)