mirror of
https://github.com/QData/TextAttack.git
synced 2021-10-13 00:05:06 +03:00
return [] when not in adj list
This commit is contained in:
@@ -61,7 +61,7 @@ class WordSwapQWERTY(WordSwap):
|
||||
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:
|
||||
|
||||
Reference in New Issue
Block a user