Optimization and tuning of word identification logic