fix: call tokenize with document encoding