Corpus preprocessing