Skip to content

Commit

Permalink
Merge pull request #466 from QData/qwerty-bug
Browse files Browse the repository at this point in the history
return [] when not in adj list
  • Loading branch information
jxmorris12 committed May 24, 2021
2 parents 5030d52 + 723bf6c commit d5e9048
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion textattack/transformations/word_swaps/word_swap_qwerty.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(
def _get_adjacent(self, s):
s_lower = s.lower()
if s_lower in self._keyboard_adjacency:
adjacent_keys = self._keyboard_adjacency[s_lower]
adjacent_keys = self._keyboard_adjacency.get(s_lower, [])
if s.isupper():
return [key.upper() for key in adjacent_keys]
else:
Expand Down

0 comments on commit d5e9048

Please sign in to comment.