Created
May 19, 2016 19:20
-
-
Save THEMVFFINMAN/edeb7ce74f938a10212ad4bd2d090d7f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import re | |
def main(argv): | |
line = sys.stdin.readline() | |
pattern = re.compile("[a-zA-Z][a-zA-Z0-9]*") | |
try: | |
while line: | |
for word in pattern.findall(line): | |
print word.lower() + "\t" + "1" | |
line = sys.stdin.readline() | |
except "end of file": | |
return None | |
if __name__ == "__main__": | |
main(sys.argv) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment