talonhub / community

Voice command set for Talon, community-supported.
MIT License
618 stars 767 forks source link

Comma not working in dictation mode with Dragon #284

Closed jeheydorn closed 3 years ago

jeheydorn commented 3 years ago

I just upgraded Talon beta to version talon-windows-105-0.1.2-105-g5b1386b, and I updated knausj_talon to revision 7b4aa7164eb3ccbde91d38eca86fcd019335ca11, and now when I dictate "comma" in dictation mode, it writes "comma" instead of ",". It didn't have this problem when I was on version talon-windows-89-0.0.8.29-1302-g082af90.

I tried removing all of my changes to knausj_talon to make sure they weren't causing a problem, but it didn't help. I also verified I'm not getting any errors when I run talon_consolel.exe.

I don't know why this is happening because dictation_mode.talon does have the rule to convert comma to ",":

(comma | kama): auto_insert(",")

I tried simplifying that to comma: auto_insert(",") but that didn't help.

I also tried adding a line in dictation_mode.talon just for testing, which converted the word fish to &, and it worked. I also verified that if I change that rule to use a different word, other than than comma, that other word will write a ",".

Comma works fine in command mode, meaning if I say comma, it writes ",".

rntz commented 3 years ago

Hi! Are you using dragon, or wav2letter? Also, are you on the talon slack? It might be easier to do some interactive debugging on there if one of the other repository maintainers happens to be around (I'm afraid I'm about to go to sleep, unfortunately).

jeheydorn commented 3 years ago

I'm using dragon 15 professional individual.

I do believe I have a free slack account, but at the moment I'm heading out for the day.

For now I have reverted to the older version of talon.

rntz commented 3 years ago

Hm, I don't have Dragon so I may not be able to help. I've not seen this behavior on wav2letter and I've used dictation mode a fair bit so I think this is probably a Dragon-Talon specific issue. @knausj85 or @dwiel, can either of you reproduce this with Dragon?

If you do get the time to visit the slack, you can try asking in #help or #community. It might also help to get the Talon log output and/or your Talon command history from when the issue occurs.

knausj85 commented 3 years ago

I think this is a result of two things: (1) Talon's been modified to return the word, rather than the symbol, via the dictate.parse_words action. https://github.com/knausj85/knausj_talon/blob/master/code/vocabulary.py#L88 (2) Can't override dragon commands - https://github.com/talonvoice/beta/issues/34

Consistent with the workaround in the above issue, the reason it works in command mode is that it's part of a capture/list https://github.com/knausj85/knausj_talon/blob/master/code/keys.py#L121.

I think we'd need something like rntz' change for dictation mode, if we want this functionality-it would need to map ',' to ',' for Dragon, though.

https://github.com/rntz/knausj_talon/commit/9ca9dfcb8016f366cf1d678c9d4706fadf3212ff#diff-ee4aef3799e8837ccf5fdf99dcbd091de3914f8339c9af257673261c018988ecR33

jeheydorn commented 3 years ago

I tried to work around this issue by installing the latest official release of Talon from https://talonvoice.com/dl/latest/talon-windows.exe, rather than use the older beta version I was previously on before trying to upgrade, but when I run it the officially released Talon, I'm getting these errors in talon_console.exe:

2020-11-18 10:06:45 ERROR user.knausj_talon.code.mouse (C:\Users\jheydorn\AppData\Roaming\talon\user\knausj_talon\code\mouse.py) import failed 17: /threading.py:890| 16: /threading.py:926| 15: /threading.py:870| 14: app\resources\loader.py:613| 13: -----------------------------------# loader thread 12: app\resources\loader.py:592| 11: app\resources\loader.py:446| 10: app\resources\loader.py:481| 9: app\resources\loader.py:526| 8: app\resources\loader.py:335| 7: -----------------------------------# stack splice 6: app\resources\loader.py:330| 5: /init.py:127| 4: app\resources\loader.py:224| 3: app\resources\loader.py:219| 2: user\knausj_talon\code\mouse.py:2 | from talon.engine import engine 1: app\resources\loader.py:279| ModuleNotFoundError: No module named 'talon.engine' 2

And these errors: 2020-11-18 10:06:45 WARNING lists: skipped because they have no matching declaration: (user.file_manager_directories, user.file_manager_files) 2020-11-18 10:06:45 WARNING lists: skipped because they have no matching declaration: (user.file_manager_directories, user.file_manager_files) 2020-11-18 10:06:45 WARNING settings: skipped because they have no matching declaration: (user.mouse_enable_pop_click, user.mouse_wake_hides_cursor, user.mouse_enable_pop_stops_scroll) 2020-11-18 10:06:46 ERROR cb error topic="update_speech" cb=<bound method SpeechSystem.update_grammars of <talon.scripting.speech_system.SpeechSystem object at 0x0000000008090188>> 34: /threading.py:890| 33: /threading.py:926| 32: /threading.py:870| 31: app\resources\loader.py:613| 30: ------------------------------------# loader thread 29: app\resources\loader.py:600| 28: talon\scripting\registry.py:156| 27: talon\scripting\registry.py:167| 26: talon\scripting\dispatch.py:98 | 25: talon\scripting\dispatch.py:133| 24: talon\scripting\dispatch.py:126| 23: talon\scripting\rctx.py:200| 22: ------------------------------------# 'update_decls' main:update_decls() 21: talon\scripting\scope.py:145| 20: talon\scripting\scope.py:129| 19: talon\scripting\dispatch.py:98 | 18: talon\scripting\dispatch.py:133| 17: talon\scripting\dispatch.py:126| 16: talon\scripting\rctx.py:200| 15: ------------------------------------# 'change' main:_registry_update_contexts() 14: talon\scripting\scope.py:53 | 13: talon\scripting\registry.py:442| 12: talon\scripting\dispatch.py:98 | 11: talon\scripting\dispatch.py:133| 10: talon\scripting\dispatch.py:126| 9: talon\scripting\rctx.py:202| 8: ------------------------------------# 'update_speech' main:update_grammars() 7: ------------------------------------# stack splice 6: talon\scripting\rctx.py:200| 5: talon\scripting\speech_system.py:204| 4: talon\scripting\speech_system.py:85 | 3: talon\engines\draconity.py:401| 2: talon\engines\draconity.py:288| 1: talon\grammar\dragon.py:138| talon.grammar.dragon.DragonCompileError: rule referenced but not declared: user.mouse_index 2

Talon commands are not working at all. Is there a particular git revision of knausj_talon anyone would recommend for use with the Talon official released? Any help would be appreciated.

rntz commented 3 years ago

hm, I'm not sure what's up with that. But, if you want a version of knausj that should allow punctuation in dictation and work with the latest talon beta (not the stable/official release, it's likely to have the same issue as what you just posted; EDIT: actually I'm not sure about this; see subsequent reply), you could try https://github.com/rntz/knausj_talon/commit/9ca9dfcb8016f366cf1d678c9d4706fadf3212ff. Let me know if that does or doesn't work for you. It's definitely a temporary solution, but the changes in that branch are likely to be incorporated into knausj soonish.

rntz commented 3 years ago

wait, actually, are you sure you're using the latest/a fairly recent knausj? the line that's erroring (the import in mouse.py) shouldn't exist in recent knausj versions, see https://github.com/knausj85/knausj_talon/blob/master/code/mouse.py for example.

So, all together, some options you could try that might work are:

  1. Use the latest knausj (https://github.com/knausj85/knausj_talon) with the stable Talon release.
  2. Use my punctuation branch (https://github.com/rntz/knausj_talon/commit/9ca9dfcb8016f366cf1d678c9d4706fadf3212ff) with the latest beta Talon release.
jeheydorn commented 3 years ago

Yup, it turns out my knausj_talon repository was not up-to-date. I guess my git skills are getting rusty. Sorry for that trouble.

With the updated knausj_talon I'm still having the comma problem with version talon-windows-105-0.1.2-105-g5b1386b, but since the officially released version works fine, I'm just going to switch to that and not worry further about this issue.

lunixbochs commented 3 years ago

If 0.1.2-105 has the issue, public will have the issue in the future when 105 is released.

This was caused by an intentional change in the beta that fixes another issue where dragon made it impossible to insert some words. The solution is to map additional commands or do additional parsing or word replacement (such as s/comma/,/) in dictation mode after parse_words.

lunixbochs commented 3 years ago

I think this is fixed by the parse changes in latest beta via https://github.com/talonvoice/talon/issues/165 ?

knausj85 commented 3 years ago

Yeah, this appears to be fixed in the latest beta.

knausj85 commented 3 years ago

Fixed by Talon 0.1.3.