KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Vocola Contextual Commands not working correctly?
Topic Summary: -- or maybe my code is suspect
Created On: 06/17/2020 04:09 PM
Status: Post and Reply
Linear : Threading : Single : Branch
 Vocola Contextual Commands not working correctly?   - spock - 06/17/2020 04:09 PM  
 Vocola Contextual Commands not working correctly?   - quintijn - 06/20/2020 07:19 AM  
 Vocola Contextual Commands not working correctly?   - spock - 06/20/2020 11:58 AM  
 Vocola Contextual Commands not working correctly?   - quintijn - 06/23/2020 10:47 AM  
 Vocola Contextual Commands not working correctly?   - spock - 06/23/2020 03:07 PM  
 Vocola Contextual Commands not working correctly?   - quintijn - 06/25/2020 11:34 AM  
 Vocola Contextual Commands not working correctly?   - spock - 06/25/2020 12:29 PM  
 Vocola Contextual Commands not working correctly?   - alexander - 06/26/2020 01:28 PM  
 Vocola Contextual Commands not working correctly?   - quintijn - 06/26/2020 02:58 PM  
 Vocola Contextual Commands not working correctly?   - spock - 06/27/2020 03:49 PM  
 Vocola Contextual Commands not working correctly?   - alexander - 07/19/2020 03:53 AM  
 Vocola Contextual Commands not working correctly?   - quintijn - 06/29/2020 03:30 AM  
 Vocola Contextual Commands not working correctly?   - mdl - 07/04/2020 01:14 AM  
 Vocola Contextual Commands not working correctly?   - quintijn - 07/04/2020 08:45 AM  
 Vocola Contextual Commands not working correctly?   - quintijn - 07/04/2020 08:48 AM  
 Vocola Contextual Commands not working correctly?   - spock - 07/04/2020 01:36 PM  
 Vocola Contextual Commands not working correctly?   - mdl - 01/03/2022 11:41 PM  
Keyword
 06/17/2020 04:09 PM
User is offline View Users Profile Print this message

Author Icon
spock
New Member

Posts: 12
Joined: 08/28/2018

Hi folks. Been following this guidance;

http://vocola.net/v2/ContextualCommands.asp

I'm using it to create context aware commands on a per-website basis.

So within my 'chrome.vcl' file my code reads something like this...

google.com:    #name of specific website by way of example

--bunch of commands I want to work exclusively in this website--

:     # to end context sensitivity

This works fine to begin with. However the moment I execute a command in the matching website none of my chrome commands work elsewhere. It's as if it becomes locked in that context. The only way to break the context lock is by issuing the instruction 'Load All Commands'

Is this a bug or am I simply getting my syntax wrong?

Any suggestions would be welcome.

Regards

 06/20/2020 07:19 AM
User is offline View Users Profile Print this message

Author Icon
quintijn
Top-Tier Member

Posts: 218
Joined: 07/28/2014

Oops, good question. Something to delve into!! Does the window title change with the command you execute?
 06/20/2020 11:58 AM
User is offline View Users Profile Print this message

Author Icon
spock
New Member

Posts: 12
Joined: 08/28/2018

Hi quintijn. This is all specific to my browser (in this case google chrome). The window title changes according to whichever website i'm on. When I read the guidance for contextual commands I assumed I would be able to exploit this functionality to have certain commands apply uniquely to specific websites (based on their window titles).

The code itself does not change the window title. It merely executes the code within the confines of that website. Apologies if i've misunderstood your question.
 06/23/2020 10:47 AM
User is offline View Users Profile Print this message

Author Icon
quintijn
Top-Tier Member

Posts: 218
Joined: 07/28/2014

This works in my browser (apart from MSG command throwing an error, which I will tackle):

KnowBrainer:
knowbrainer test = MSG("context knowbrainer");


The command "knowbrainer test" is recognised when the knowbrainer tab is in front. In other tabs it is not recognised.

Hope, this is what you mean.

 06/23/2020 03:07 PM
User is offline View Users Profile Print this message

Author Icon
spock
New Member

Posts: 12
Joined: 08/28/2018

Thanks for looking into this for me quintijn. Yes that is exactly what I mean. Did you test it several times to be sure? I only ask because on my setup it works when I first execute the command (on that specific website) but when I move to a different tab all my chrome related commands stop working.
 06/25/2020 11:34 AM
User is offline View Users Profile Print this message

Author Icon
quintijn
Top-Tier Member

Posts: 218
Joined: 07/28/2014

Right, this is a bug. Do you work with the python 2.7 (stable) release, or already with the python 3 version, which can currently be obtained from github? Fixing for python2.7 will not be done any more, for python 3 I can make a bug report.

 06/25/2020 12:29 PM
User is offline View Users Profile Print this message

Author Icon
spock
New Member

Posts: 12
Joined: 08/28/2018

Thank you quintijn. I am currently using 2.7 but I will make the switch to python 3 soon. I would be happy for you to make a bug report. Your help is greatly appreciated!
 06/26/2020 01:28 PM
User is offline View Users Profile Print this message

Author Icon
alexander
Top-Tier Member

Posts: 207
Joined: 07/31/2016

The contextual commands have always been a bit finicky. I'm not sure where the issue lies, whether it's in Vocola's code, Natlink or Dragon proper.

In my experience I found it best to put contextual commands in their own file. So for example you have your standard chrome.vcl. You can also have a chrome_website1.vcl, chrome_website2.vcl etc. I found that to be generally more reliable but still not bulletproof. It's also a bit of a pain since you cannot just say "edit commands" to open up those files. ( but if you have a tool like vs code or sublime it's easy enough to open them up there if you open up the Vocola folder)
 06/26/2020 02:58 PM
User is offline View Users Profile Print this message

Author Icon
quintijn
Top-Tier Member

Posts: 218
Joined: 07/28/2014

They should be handled by Vocola correct, but they are not. So a good chance to fix this. Your workaround works well, probably, because the changing of contexts within one grammar is not done.

So, Vocola stuff, Natlink and Dragon can handle things properly.
 06/27/2020 03:49 PM
User is offline View Users Profile Print this message

Author Icon
spock
New Member

Posts: 12
Joined: 08/28/2018

That sounds like a great idea alexander, unfortunately I couldn't get it to work. Nevertheless thanks for your reply.

Thank you quintijn for making the bug report. I found the information here;

https://github.com/dictation-toolbox/natlink/issues/14

This looks very promising but I'm not advanced enough to understand it. Does it contain a working solution I can use?



 07/19/2020 03:53 AM
User is offline View Users Profile Print this message

Author Icon
alexander
Top-Tier Member

Posts: 207
Joined: 07/31/2016

Spock please post a sample of your vcl file name(s) and the contents.  Your vocola version seems fine.

 06/29/2020 03:30 AM
User is offline View Users Profile Print this message

Author Icon
quintijn
Top-Tier Member

Posts: 218
Joined: 07/28/2014

No, this solution should be built in in the vocola internal software. Handling contexts from different Vocola source files should work though, so that is the way to do this now!!
 07/04/2020 01:14 AM
User is offline View Users Profile Print this message


mdl
Top-Tier Member

Posts: 906
Joined: 04/18/2009

What version of DNS, Vocola, and Natlink are you using?
 07/04/2020 08:45 AM
User is offline View Users Profile Print this message

Author Icon
quintijn
Top-Tier Member

Posts: 218
Joined: 07/28/2014

Output of my Messages from Natlink 11/06/2020:

--
-- natlinkmain starting...
--- natlinkstartup starting...
Vocola version 2.8.6 starting...

(...)

natlinkmain started from C:\DT\Natlink\MacroSystem\core:

  Natlink version: 4.2

  DNS version: 15

  Python version: 38

  Windows Version: 10

Unimacro enabled, UnimacroUserDirectory:

  C:\Users\Gebruiker\Documents\unimacro_qh

Vocola enabled, VocolaUserDirectory:

  C:\Users\Gebruiker\Documents\vocola_qh

----------------------------------------

And this is the python3 version of Natlink (see at github) or in https://qh.antenna.nl/unimacro/installation/index.html


 07/04/2020 08:48 AM
User is offline View Users Profile Print this message

Author Icon
quintijn
Top-Tier Member

Posts: 218
Joined: 07/28/2014

BTW, nice to "see" you back, Mark!

Greetings, Quintijn
 07/04/2020 01:36 PM
User is offline View Users Profile Print this message

Author Icon
spock
New Member

Posts: 12
Joined: 08/28/2018

Hi mdl. Not sure whether your question was directed at quintijn or myself (as the OP) but FWIW;

DNS version 15.3
Vocola 2.8.6
Natlink 4.2

Additionally I'm running python version 2.7.18 on Windows 10 (with latest update)
 01/03/2022 11:41 PM
User is offline View Users Profile Print this message


mdl
Top-Tier Member

Posts: 906
Joined: 04/18/2009

I have been able to reproduce this with DNS 15, Vocola 2.8.7.

it looks like a Dragon bug, but I need to investigate more.

in the meantime, a simple workaround is to put the title specific commands in a separate .vcl file for each context
Statistics
32285 users are registered to the KnowBrainer Speech Recognition forum.
There are currently 0 users logged in.
The most users ever online was 12124 on 09/09/2020 at 04:59 AM.
There are currently 516 guests browsing this forum, which makes a total of 516 users using this forum.

FuseTalk Standard Edition v4.0 - © 1999-2022 FuseTalk™ Inc. All rights reserved.