def f2lookup(f, lookup):
lookup = {i: r for i, r in [l.strip().split('<STR_LIT:\t>')[<NUM_LIT:0>:<NUM_LIT:2>] for l in lookup]}<EOL>for line in f:<EOL><INDENT>line = line.strip()<EOL>for find, replace in list(lookup.items()):<EOL><INDENT>line = line.replace(find, replace)<EOL><DEDENT>yield line<EOL><DEDENT>
find and replace elements in lookup within file