I'm trying to understand what you wrote, but I'm not sure I get your point.
You mentioned exported rules, active rules, top-level rules, and the
results_callback() method of the GrammarWrapper class. You discuss
different combinations of these, for example a non-exported rule that
you would like to be active.
Isn't it the case that those concepts are all actually the same, or
very closely related? Something like this:
"Exported rule" and "top-level rule" are identical. (At least for DNS;
WSR does make a distinction, as other grammars can refer to exported
rules, something which is not possible for DNS)
A rule's "active" state is only relevant for top-level rules.
Dragonfly's processing of an "internal" rule that is recognized as
part of a different top-level rule doesn't take the "internal" rule's
activity into account: it can always be processed.
The results_callback() method is only called once for the top-level
rule that is recognized. E.g. it is only called for exported rules
that are active. A non-exported rule can never be recognized (in DNS),
and inactive rules cannot be recognized at the moment.
How does the above relate to your message?
Best regards,
Charlie
> When this exported attribute is False, and if the rule is at the top
> level, the grammar doesn't work, because the rule is not activated.
By "the grammar doesn't work" do you mean that the rule is never
recognized, or that some error is given when loading the grammar?
> DNS works with the rule properly (which seems contrary to what you
> mentioned), but within Dragonfly, the logic does not provide
> activation, as this is only applied to exported rules.
What do you mean by "DNS works with the rule properly"?
You say activation is only applied to exported rules (aka top-level
rules, those that match a complete utterance). Isn't that obvious, as
a recognition could never consist of an active top-level rule
referring to an inactive sub-rule; that just doesn't make sense...
> A simple code modification enabled activation of the rule.
Could you perhaps share the code modification you mention that enables
activation of the rule?
Best regards,
Charlie