Permalink
Browse files

Made ENGLISH_WORDS a dict instead of a list

  • Loading branch information...
1 parent 50eff4b commit 6537d550078dc8d10ff2ea6bfe2ee0be6aec5605 @asweigart committed Aug 21, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 detectEnglish.py
View
@@ -9,7 +9,9 @@
import re
dictionaryFile = open('dictionary.txt')
-ENGLISH_WORDS = dictionaryFile.read().upper().split('\n')
+ENGLISH_WORDS = {}
+for word in dictionaryFile.read().upper().split('\n'):
+ ENGLISH_WORDS[word] = None
dictionaryFile.close()
nonLettersOrSpacePattern = re.compile('[^A-Z\s]')

0 comments on commit 6537d55

Please sign in to comment.