This is the link to the word list txt file. https://drive.google.com/file/d/0B4a
ID: 3795391 • Letter: T
Question
This is the link to the word list txt file.
https://drive.google.com/file/d/0B4akmIRkT2AaTDlpY2g5V2doR2c/view?usp=sharing
Explanation / Answer
import sys
import re
alpha = re.compile(r'[a-zA-Z0-9]+')
email = re.compile(r'[0-9a-z]+@[0-9a-z]+.latech.edu')
identifier = re.compile(r'^[^dW]w*Z')
def isValidWord(word):
if alpha.match(word):
print "alpha"
return True
elif email.match(word):
return True
elif identifier.match(word):
return True
else:
return False
out = open("extracted_words.txt", "w")
with open(sys.argv[1], 'r') as f:
for line in f:
words = line.split()
for word in words:
if isValidWord(word):
out.write(word + " ")
out.close()
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.