You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.py files in ~/.caster/rules require a get_rule method. .py files in ~/.caster/filters require a get_filter
Example user rule in the user space:
from dragonfly import Text
from castervoice.lib import control
from castervoice.lib.dfplus.merge.mergerule import MergeRule
from castervoice.lib.dfplus.state.short import R
class Decker(MergeRule):
pronunciation = "decker"
mapping = {
"hit the deck": R(Text("shipwrecked"))
}
def get_rule():
return Decker()
get_rule should a load and merge the grammar. Currently this is not the case.
However when control.nexus().merger.add_global_rule(Decker()) with get_rule results in a Rule Naming Conflict (Which is expected with a duplicate rule). It seems to suggest that the rule is loaded but not merged?
Error loading _caster from E:\NatLink\NatLink\MacroSystem\_caster.py
Traceback (most recent call last):
File "E:\NatLink\NatLink\MacroSystem\core\natlinkmain.py", line 331, in loadFile
imp.load_module(modName,fndFile,fndName,fndDesc)
File "E:\NatLink\NatLink\MacroSystem\_caster.py", line 254, in <module>
_NEXUS.process_user_content()
File "E:\NatLink\NatLink\MacroSystem\castervoice\lib\ctrl\nexus.py", line 45, in process_user_content
self.merger.add_user_content(self.user_content_manager)
File "E:\NatLink\NatLink\MacroSystem\castervoice\lib\dfplus\merge\ccrmerger.py", line 142, in add_user_content
self.add_global_rule(rule)
File "E:\NatLink\NatLink\MacroSystem\castervoice\lib\dfplus\merge\ccrmerger.py", line 115, in add_global_rule
self._add_to(rule, self._global_rules)
File "E:\NatLink\NatLink\MacroSystem\castervoice\lib\dfplus\merge\ccrmerger.py", line 151, in _add_to
raise Exception("Rule Naming Conflict: " + rule.get_pronunciation())
Exception: Rule Naming Conflict: decker
The text was updated successfully, but these errors were encountered:
The user space. It appears in
~/.caster/rules
.py files in ~/.caster/rules require a get_rule method. .py files in ~/.caster/filters require a get_filter
Example user rule in the user space:
get_rule
should a load and merge the grammar. Currently this is not the case.However when
control.nexus().merger.add_global_rule(Decker())
withget_rule
results in a Rule Naming Conflict (Which is expected with a duplicate rule). It seems to suggest that the rule is loaded but not merged?The text was updated successfully, but these errors were encountered: