This extension, a very early implementation of which it must be said, adds support to Dragonfly for "modes", which are effectively grammars, but they support the idea of sub-grammars in some way, and to do so modes are detached from DNS grammars.
Being detached from DNS grammars, in order to receive recognition notifications, a "pipe" grammar is added to the MacroSystem folder, which matches all text. This text is routed to the Modes system by a 'hook' inserted into Dragonfly's Engine class. A ModeManager handles recognition notifications, referring them on to the current mode.
A stack is maintained of invoked modes which can be pushed and popped according to need, recognition events being passed to the current mode at the top of the stack.
With independence from of the Grammar class, and with elements being recast to be grammar independent where necessary, the mode system is completely independent of the DNS/Engine/Grammar system. Beyond providing more flexibility with grammars, this makes simulation straightforward:
manager = ModeManager()
manager.dns_set_window_context("sim")
manager.dns_words_spoken([('some', 1000000), ('words', 1000000),])
The mode system may be useful in recognition problems that are inherently modal in nature.
Needless to say however, that for most applications the existing grammar system in Dragonfly and DNS would be more suitable.
Jason