Closed jgarvin closed 9 years ago
Y is automatically added to the grammar of X because X depends on it. That is intended behavior because otherwise the grammar couldn't be loaded.
Whether in your example Y can be recognized by itself depends on whether Y is "exported" or not. See http://dragonfly.readthedocs.org/en/latest/object_model.html#exported-rules for more info on that.
Using the natlink backend w/ DNSv12, if you add a rule X to a grammar that depends on another rule Y via RuleRef, then Y will be recognized by itself. So for example if X has the phrase "hello" and Y has the phrase "(foo | bar)", saying just "foo" will fire, even though only X was added to the grammar. You can workaround this by disabling Y after loading the grammar containing (now Y by itself won't be recognized but X still will). I don't know if this is intended behavior but I don't consider it intuitive and if it is intended perhaps should be documented.