Author Topic: Help.ShowByName* - can it be configured to show entire list of phrases?  (Read 4330 times)

0 Members and 3 Guests are viewing this topic.

marcusvdt

  • Sr. Member
  • ****
  • Posts: 152
  • Karma: 6
  • Researching
    • View Profile
I'm building my groups in a way I can ask for help about some important commands. It consists of a payload xml where I will use the phrase to value config, and where the phrase is the actual topic I will ask for help and the value is the actual group name.
Because of some groups that are automatically generated by my Py Controller for My Sensors, the name of the groups are not always named with a name that a user would ask help for.

For displaying the help on full screen and as quick as possible, I'm using Robo Browser for loading the help file.

It works quite fine, but there are two things that I would like to enhance:
1-The help file is generated with cropped text. Did not try to figure out what is the logic behind the crop size, but in some cases the user could need to see the entire list.
2- I would like to hear VC saying the only the first phrase of each command that has been displayed in the help html.

Are there possible?

Thanks!


nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
1-The help file is generated with cropped text. Did not try to figure out what is the logic behind the crop size, but in some cases the user could need to see the entire list.

Are you referring here to the fact that Show Help does not show all possible payload phrases for each command?

Basically this is done to keep the help page from getting ridiculously huge given that most people use VC to control their media : http://voxcommando.com/forum/index.php?topic=2182.msg18878#msg18878

I guess you'd have to create your own custom solution if that doesn't suit your needs for these particular commands.

Quote
2- I would like to hear VC saying the only the first phrase of each command that has been displayed in the help html.

Are there possible?

Without seeing the command(s) you've created for this purpose, it's not clear what you mean here. Do you mean that you are not only displaying the commands, but also that you have TTS announcing the phrasing for each command?

If it's a friendly payload that has phrase aliases or something like that, then you can use a regular expression to capture just the first phrase. If the payloadXML files are not too big you could also use PayloadXML.GetPhrase (http://voxcommando.com/mediawiki/index.php?title=Actions#GetPhrase) but a regular expression is probably more efficient.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

marcusvdt

  • Sr. Member
  • ****
  • Posts: 152
  • Karma: 6
  • Researching
    • View Profile
Yes, I'm referring to the cropped payload phrases. I agree with what has been said. That's fine then. I'll try to make a custom help.

and regarding the other subject,  yes, I would like tts to say only the first part of the commands. I'll see what I can get with regex, but I am ridiculously bad with regex.  :bonk

thanks!

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
I'll see what I can get with regex, but I am ridiculously bad with regex.  :bonk

thanks!

Feel free to post the xml for the command where this is needed, with an example, and we'd be happy to help.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
A simpler solution that may work for you is that your users could ask to see the full list of payload phrases only if seeing the standard list of commands isn't enough.

For example, if you have a payload xml file with all your device names called devices.xml, the following could display a list of all the friendly device names:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.5.0-->
<command id="594" name="Show me all the device names" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>File.Read</cmdType>
    <params>
      <param>payloads\{1}.xml</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegEx</cmdType>
    <params>
      <param>&lt;phrase&gt;(.*?)&lt;/phrase&gt;</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>All devices:</param>
      <param />
      <param>5</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.AddText</cmdType>
    <params>
      <param>{Match.{i}}</param>
    </params>
    <cmdRepeat>{#M}</cmdRepeat>
  </action>
  <phrase>show me a a list of</phrase>
  <payloadList>devices</payloadList>
</command>

This will work for any payloadXML file.

... If your payloadXML phrases include comma-separated aliases and you only want to show the first phrase you can replace the above regular expression with:
Code: [Select]
<phrase>(.*?)[,|<]
You could also avoid regular expressions altogether by using Scrape.XML to return all "phrase" nodes.
« Last Edit: July 02, 2015, 12:27:29 PM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
1-The help file is generated with cropped text. Did not try to figure out what is the logic behind the crop size, but in some cases the user could need to see the entire list.

The logic behind it is to keep any one command from creating a help entry that takes up too much space on the web page.  If a payload string is longer than the maximum length it will be truncated.  I probably set the maximum length a bit too low, but the purpose of the help html was to remind you of the structure of a voice command, not of every possible way to say it.

I am adding some options (to the advanced tab) that will allow the user to specify the maximum length for payload Lists, and payload XML files separately.

I am also adding classes to the different types of phrase or payload so you can customize the look a bit.

For example, here is what the default style will yield with max length for payload lists = 200 and max length for payloadXML =300:

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
I'll see what I can get with regex, but I am ridiculously bad with regex.  :bonk

check this http://voxcommando.com/forum/index.php?topic=1684.msg14655#msg14655... might give you a starting point
When Voice command gets tough, use hand gestures

marcusvdt

  • Sr. Member
  • ****
  • Posts: 152
  • Karma: 6
  • Researching
    • View Profile
Sorry for the late response.
I was busy replacing the VC computer with a newer one, and came back to this only today. Btw, what an improvement going from an Atom mini PC with 2GB of RAM to an i3 with 4GB of RAM.

Thanks for all responses. Let me show what I'm talking about.
Basically, I have a command where I must say:
Help for <name of the group>

In this command, I've purposely placed a payload list with only the groups that I want the other users to ask help for. Here is the command:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.5.2-->
<command id="643" name="Ajuda (grupo)" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>File.Delete</cmdType>
    <params>
      <param>commandhelp.html</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Help.ShowByName*</cmdType>
    <params>
      <param>{1}</param>
      <param>False</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>oh!{CR}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.SpeakSync</cmdType>
    <params>
      <param>Pois não. Estou construindo a ajuda sobre {1}. Isso pode demorar alguns segundos, mas assim que estiver pronto eu mostro na tela pra você.</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.TriggerEvent</cmdType>
    <params>
      <param>HelpByGroupName</param>
      <param>{1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>ajuda</phrase>
  <phrase optional="true">sobre,com,para</phrase>
  <payloadList>ajuda,o sistema,cancelar lembretes,criar lembretes,repetir lembretes,lembretes,previsão do tempo</payloadList>
</command>

Then, this command below will show the help html on the screen:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.5.2-->
<command id="596" name="Notification Help by group name" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>oh!{CR}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>Pronto! Veja na tela os comandos que você pode falar sobre {1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>File.GetFiles</cmdType>
    <params>
      <param>{Path.VC}</param>
      <param>commandhelp.html</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>LastActionSuccess</ifType>
    <ifParams>&amp;&amp;</ifParams>
    <then>
      <action>
        <cmdType>RoboB.Select</cmdType>
        <params>
          <param>ajuda</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Results.Replace</cmdType>
        <params>
          <param>\</param>
          <param>/</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>RoboB.Navigate</cmdType>
        <params>
          <param>file://{Match.1}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>RoboB.Fullscreen</cmdType>
        <params>
          <param>True</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>RoboB.Show</cmdType>
        <params />
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>Opa! Não consegui abrir a ajuda.</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <event>HelpByGroupName</event>
</command>

The above works perfectly. Obviously I have another command to close the help.
I understand the reasons for truncating the long payload lists, etc, it makes sense.

What I'm still needing some help about is if you guys have any ideas on how to make VC to speak only the circled phrases in the left side in the attached screenshot..
Also, how do I hide the investigator checkbox?

marcusvdt

  • Sr. Member
  • ****
  • Posts: 152
  • Karma: 6
  • Researching
    • View Profile
I have no time to check everything now, but it seems Haddood's example may have the response for what I just asked.
So forgive me if I'm too excited and asking many things like crazy  :bonk

Will check it out asap. Thank you!


jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Also, how do I hide the investigator checkbox?
It's an optional parameter referred to as "tools", because at one point there were multiple check boxes up there:
http://voxcommando.com/mediawiki/index.php?title=Plugin_RoboB#Show

What I'm still needing some help about is if you guys have any ideas on how to make VC to speak only the circled phrases in the left side in the attached screenshot..
I'm just wondering why you would want the text that is circled?  I don't get it.  Be advised that in the next release of VC the HTML format of the help file will change, so whatever regEx you come up with now may not work after the upgrade.

marcusvdt

  • Sr. Member
  • ****
  • Posts: 152
  • Karma: 6
  • Researching
    • View Profile
Thank you!
I was going to change some things on the html file but I'll wait then.

marcusvdt

  • Sr. Member
  • ****
  • Posts: 152
  • Karma: 6
  • Researching
    • View Profile
The purpose is to let the user do a quick recall of what can be said. To avoid the tts to keep speaking everything, I'd like it to say onlythe first part of each command phrase.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
That makes sense (to keep it as short as possible) but having it read all possible alternates of the first phrase and nothing from the rest of the command does not make sense to me.

For example, the TTS saying "cancelar numero X" is both shorter, and more helpful than saying "cancelar cancelar lembrete ok lembrete".  No?

Probably it would be best to use command names that fit the most common phrasing and just have it read the command names.  This is generally what I try to do although I am not 100% diligent about adhering to it.

marcusvdt

  • Sr. Member
  • ****
  • Posts: 152
  • Karma: 6
  • Researching
    • View Profile
Yes it makes sense. Thanks

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
@marcus ...as well check this http://voxcommando.com/forum/index.php?topic=1825.0

nime5ter posted very efficient solutions ....
When Voice command gets tough, use hand gestures