t4ngo / dragonfly

ARCHIVED! - Speech recognition framework allowing powerful Python-based scripting and extension of Dragon NaturallySpeaking (DNS) and Windows Speech Recognition (WSR)
GNU Lesser General Public License v3.0
364 stars 82 forks source link

Is there a way to remove a rule that has been previously added? #65

Closed reckoner closed 6 years ago

reckoner commented 6 years ago

There is a

grammar.add_rule

Is there something like a

grammar.remove_rule

to remove a rule that had previously been added?

tylercal commented 6 years ago

What I use is rule.disable() on the rule itself, you can also grammar.unload().

If you really want to remove a rule, the exact method you mentioned does exist: https://github.com/t4ngo/dragonfly/blob/master/dragonfly/grammar/grammar_base.py#L175