Spell checks a given document and outputs a corrected document