def METHOD_NAME(self, name):
    ref_name = self._get_reference_name(name)
    jsgf_rule = self._jsgf_grammar.get_rule_from_name(ref_name)
    # Only disable the rule and set the flag if the rule is enabled.
    if jsgf_rule.active:
        jsgf_rule.disable()
        self.set_search = True