Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Mte90 committed Jul 3, 2018
1 parent e974688 commit 97d2794
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions syntaxalert.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ def loadWord(filename):

# Parse argument
parser = argparse.ArgumentParser(description='Scan your digited letter for wrong words and alert you!')

parser.add_argument('-words', action="store", dest='words_file', nargs='?', default=script_path + '/words/en.json', type=str)
parser.add_argument('-words2', action="store", dest='words_file2', nargs='?', default=script_path + '/words/it.json', type=str)
args = parser.parse_args()
Expand All @@ -26,14 +25,14 @@ def loadWord(filename):
words = loadWord(args.words_file)
words2 = loadWord(args.words_file2)
words.update(words2)
else:
print('ERR: Alerts 2 file not exist!')
else:
words = loadWord(args.words_file)

print(str(len(words)) + " words loaded")
for (correct, wrongs) in words.items():
for wrong in wrongs:
if wrong != '':
keyboard.add_abbreviation(wrong + ' ', ' ' + correct + ' ', False)
print('Loaded ' + wrong + ' with as: ' + correct)
keyboard.add_abbreviation(wrong, ' ' + correct + ' ')

keyboard.wait()

0 comments on commit 97d2794

Please sign in to comment.