Generalized Collocation list creator

This code takes as its input a .txt file with an ordered list of the
lemmas or words in a document where each word is on a different line.
It then creates a comma-delimited text file for each lemma/word with a
column for each position left or right of the word ordered by the most
frequent collocate in that position.