简体   繁体   中英

accentuated letters for natlink and dragonfly

I have a natlink setup, with dragonfly and aena on Dragon 13. It's working all well in English, and it's almost working for French. I have a problem when a try to use accentuated letters in the grammar.

I get this error (natlink uniform6):

Traceback (most recent call last):
  File "C:\NatLink\NatLink\MacroSystem\core\natlinkmain.py", line 322, in loadFile
    imp.load_module(modName,fndFile,fndName,fndDesc)
  File "C:\NatLink\NatLink\MacroSystem\_hello_world_aenea_fra2.py", line 26
SyntaxError: Non-ASCII character '\xc3' in file C:\NatLink\NatLink\MacroSystem\_hello_world_aenea_fra2.py on line 26, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
root: Failed to load language-specific number module: global name 'GrammarError' is not defined

I also tried to put in encoding at the start of the file. But then I get another error :

Traceback (most recent call last):
  File "C:\NatLink\NatLink\MacroSystem\core\natlinkmain.py", line 322, in loadFile
    imp.load_module(modName,fndFile,fndName,fndDesc)
  File "C:\NatLink\NatLink\MacroSystem\_hello_world_aenea_fra2.py", line 34, in <module>
    grammar.add_rule(TestRule())
  File "C:\Python27\lib\site-packages\dragonfly\grammar\rule_mapping.py", line 137, in __init__
    c = Compound(spec, elements=self._extras, value=value)
  File "C:\Python27\lib\site-packages\dragonfly\grammar\elements_compound.py", line 269, in __init__
    raise SyntaxError("Invalid compound spec: %r" % spec)
SyntaxError: Invalid compound spec: 'voici la t\xc3\xa9l\xc3\xa9'

I tried with natlink version 4.1 tango to uniform6 I tried the tricks given in these links:

https://gitter.im/synkarius/caster/archives/2016/09/14

https://github.com/t4ngo/dragonfly/issues/11

If someone knows the right combinations of version numbers for each software in the pipeline with the right trick to make it all work please let me know.

Well, the patch proposed by cheep on the second link in my post did work, I just made a mistake when applying it. I just re-applyed the patch on a fresh dragonfly install and it worked.

With all my tests i confirm that natlink-4.1uniform-7 works well with accent and that the culprit is dragonfly.

This is been fixed via Unicode/multi-language support for grammar specs #14 in a Danesprite fork of dragonfly which is integrating fixes from the community. Hopefully fixes will be included upstream to t4ngo/dragonfly someday.

Let me know this resolves your issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM