similarity: provide document encoding when feeding parser