One option would be to use the shelf to store your lookup table and then retrieve values for word1, word2, word3 and word4 that way. Then in the loop have something like:
thisWord = ''
if word == 'word1':
thisWord = word1
elif word == 'word2':
thisWord = word2
elif word == 'word3':
thisWord = word3
elif word == 'word4':
thisWord = word4