tokenize words and strip newlines/spaces while creating corpus