Writing tuples for each term in a file (first indexer step).