Skip to content

Instantly share code, notes, and snippets.

@davidfoerster
Created May 29, 2018 11:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidfoerster/54be942d06cd3b93d4175e153cc55365 to your computer and use it in GitHub Desktop.
Save davidfoerster/54be942d06cd3b93d4175e153cc55365 to your computer and use it in GitHub Desktop.
#!/usr/bin/python3
import sys
with open(sys.argv[1]) as dict_file:
dictionary = dict(line.rstrip('\n').split(None, 1) for line in dict_file)
with sys.stdin:
for line in sys.stdin:
line = line.rstrip('\n')
print(dictionary.get(line, line))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment