Integrated term preprocessing logic for filters and corrections