Added support to pre-process sentences on demand.