added substring mapping for terms