dictation-toolbox / Caster

Dragonfly-Based Voice Programming and Accessibility Toolkit
Other
339 stars 121 forks source link

Loading of top-level rules other than MappingRule from the user directory #830

Open ileben opened 4 years ago

ileben commented 4 years ago

Caster currently complains and ignores a rule returned from the get_rule function, unless it is a subclass of MappingRule.

CompoundRule is really useful as a top-level rule when constructing nested rule references such as the following example. _spelling.txt

I would like to be able to have a top-level CompoundRule loaded from the user directory, to keep such custom rules neatly separated from the caster source code directory, while retaining the functionality such as hot-reloading, enabling/disabling via voice commands, etc.

kendonB commented 3 years ago

@LexiconCode Is there anything fundamental about caster that requires MappingRules to be the only type of dragonfly rule? Or could we just change the validation checkers?

LexiconCode commented 3 years ago

@LexiconCode Is there anything fundamental about caster that requires MappingRules to be the only type of dragonfly rule? Or could we just change the validation checkers?

I imagine it would take more than just simply bypass the validator's especially if CCR is involved. Being able to load dragonfly grammars like _spelling.py from the user directory would be an alternative method.