Author Topic: wolfram.xml  (Read 5700 times)

0 Members and 1 Guest are viewing this topic.

outlaw

  • Jr. Member
  • **
  • Posts: 21
  • Karma: -1
    • View Profile
wolfram.xml
« on: February 25, 2015, 06:56:19 PM »
hi,im still a newbie  :bonk I hope im posting this in the right spot..my ? is ive put in James's xml for wolfram and ive
gone and did my alpha api key from wolfram and have put it into vc. however it still doesn't work.

thanks for your time
  james m

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: wolfram.xml
« Reply #1 on: February 25, 2015, 07:19:34 PM »
Hi James,

Yes, this is the right spot. However, we'd need more information in order to help you with this.

1. There are several different Wolfram Alpha commands posted on the forum. Please copy and paste the xml for the command you're trying to use in your next forum post so that we know which one you're using. (By this I mean the xml that's actually in your command tree.)

2. What version number of VC are you using (e.g. Version 2.1.3.8?), and are you using the "regular" VoxCommando.exe, or are you using VoxCommandoSP.exe?

3. "It doesn't work" doesn't provide us with much info about what's happening, because it could mean a lot of different things. Does VoxCommando seem to understand what you're saying but then you are not getting the results you expected? If this is the case, what kind of result are you getting?

Often it is easier and quicker to post a log, rather than trying to explain the symptoms.

So, I would recommend that you enable logging under Options (http://voxcommando.com/mediawiki/index.php?title=Log ), then try a couple sample Wolfram Alpha questions, then attach your voxLog.txt file to your next post (along with the xml for the command you are using!).

That will make it easier for us to diagnose the problem.


« Last Edit: February 25, 2015, 07:25:45 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)

outlaw

  • Jr. Member
  • **
  • Posts: 21
  • Karma: -1
    • View Profile
Re: wolfram.xml
« Reply #2 on: February 25, 2015, 07:36:04 PM »
im using vc version 2.138 and yes it is activated :)
here is the xml file I copied and pasted into the vc tree...

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="625" name="wolfram" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Scrape</cmdType>
    <cmdString>http://api.wolframalpha.com/v2/query?appid=[yourAPIkey]&amp;input={1}&amp;format=plaintext</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExSingle</cmdType>
    <cmdString>Input.*?&lt;plaintext&gt;([^&lt;].*?)&lt;/plaintext&gt;.*?[Result|Definition|approximation].*?&lt;plaintext&gt;([^&lt;].*?)&lt;/plaintext&gt;</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>LastActionSuccess</ifType>
    <ifParams>&amp;&amp;</ifParams>
    <then>
      <action>
        <cmdType>Results.SetLastResult</cmdType>
        <cmdString>You asked for: {Match.1.1}. {Cr}The answer is: {Match.1.2}</cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Results.RegExReplace</cmdType>
        <cmdString>sqrt\((.*?)\)&amp;&amp;square root of $1</cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Results.Replace</cmdType>
        <cmdString> × &amp;&amp; times </cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Results.Replace</cmdType>
        <cmdString> | &amp;&amp;, </cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>OSD.ShowText</cmdType>
        <cmdString>{LastResult}</cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <cmdString>{LastResult}</cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <cmdString>I'm sorry, I don't know the answer to: {1} Could you speak more clearly, or perhaps try to rephrase your question.</cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>OSD.ShowText</cmdType>
        <cmdString>I'm sorry, I don't know the answer to: {CR}{1}{CR}Could you speak more clearly, or perhaps try to rephrase your question.</cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <phrase>Wolfram</phrase>
  <payloadDictation>payloadDictation: Regular</payloadDictation>
</command>


 VoxCommando.exe is the one I am using.....but I watched James's how to upgrade video and that's how I installed it.
and yes vc does understand what I am saying ...better example is....when I say...wolfram what is 9+9 ...it replys I do not know
the answer to 9+9
« Last Edit: February 25, 2015, 09:39:42 PM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: wolfram.xml
« Reply #3 on: February 25, 2015, 07:40:54 PM »
Thanks for the followup info.  We're just sitting down to eat dinner but we'll try to take another look at this later tonight.  ;D

outlaw

  • Jr. Member
  • **
  • Posts: 21
  • Karma: -1
    • View Profile
Re: wolfram.xml
« Reply #4 on: February 25, 2015, 07:46:45 PM »
your welcome :) take your time enjoy time with your family :):)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: wolfram.xml
« Reply #5 on: February 25, 2015, 09:39:06 PM »
You should not put your actual api key in square brackets.  Remove the square brackets and it should work.

outlaw

  • Jr. Member
  • **
  • Posts: 21
  • Karma: -1
    • View Profile
Re: wolfram.xml
« Reply #6 on: February 25, 2015, 09:49:27 PM »
worked like a champ!! thanks a million james  ;D ;D ;D

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: wolfram.xml
« Reply #7 on: March 10, 2015, 06:10:02 PM »
A reminder to all:

The Wolfram commands rely on dictation payloads, so that we are free to ask Wolfram|Alpha a wide range of questions.

VoxCommandoSP.exe does not support payload dictation. This is a limitation of Microsoft's Speech Platform 11, unfortunately.

This means you will not be able to import many of the wolfram command xml examples from the forum if you are using the SP version.

It is still possible to create a somewhat more limited Wolfram Alpha command that will work with the VoxCommando SP if you have a specific type of question in mind, however.

Very basic example to get you started:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.4.0-->
<command id="644" name="Wolfram calculator" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="Input.*?&lt;plaintext&gt;(.*?)&lt;/plaintext&gt;.*?[Result|Definition|approximation].*?&lt;plaintext&gt;(.*?)&lt;/plaintext&gt;">
  <action>
    <cmdType>Scrape</cmdType>
    <params>
      <param>http://api.wolframalpha.com/v2/query?appid=YOUR_API_KEY&amp;input={1}{2}{3}&amp;format=plaintext</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExSingle</cmdType>
    <params>
      <param>Input.*?&lt;plaintext&gt;(.*?)&lt;.*?[Decimal.approximation|Result|Definition].*?&lt;plaintext&gt;(.*?)&lt;/plaintext&gt;</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>You asked for: {Match.1.1}{CR}The answer is: {Match.1.2}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>You asked for: {Match.1.1}{CR}The answer is: {Match.1.2}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Calculate</phrase>
  <payloadRange>1,25</payloadRange>
  <payloadList>times, plus, minus, divided by, percent of</payloadList>
  <payloadRange>1,99</payloadRange>
</command>
« Last Edit: March 10, 2015, 06:13:56 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)

scherr

  • Jr. Member
  • **
  • Posts: 5
  • Karma: 0
    • View Profile
Re: wolfram.xml
« Reply #8 on: March 11, 2015, 01:56:27 AM »
Thanks for the reply.
I am using W8.1, voxcommando.exe, v 2.133 & v2.14.2. I tried your xml thinking that there may be a difference from the one I copied several times and but I still get a "invalid XML" when I try to paste it in the command tree.
Pet peeve: When VC comes out with a new feature they usually put out a video showing it working but not how to get it to work.
Bob
I would really put "south" for the verification answer but I don't want to have to retype this ahain because I was trying to be "cute".

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: wolfram.xml
« Reply #9 on: March 11, 2015, 09:05:40 AM »
I am using W8.1, voxcommando.exe, v 2.133 & v2.14.2. I tried your xml thinking that there may be a difference from the one I copied several times and but I still get a "invalid XML" when I try to paste it in the command tree.

I have tried everything I can think of to get the xml to fail when pasting it into my command tree with no luck. That said, I don't have a W8.1 machine to test on.

Have you successfully imported other command xml on the forum into your tree?

Are you following the instructions provided for doing so? http://voxcommando.com/mediawiki/index.php?title=XML_on_the_forum

Our forum now includes a "select" link above code boxes, which is a more reliable way to make sure you're selecting *all* the text in a code box that needs to be copied. Have you been using that?

If you still can't get it to work, you'll have to make a video showing us what you're doing so that we can try to diagnose the problem based on evident symptoms rather than guessing.

Quote
Pet peeve: When VC comes out with a new feature they usually put out a video showing it working but not how to get it to work.

The Wolfram video was not demonstrating a new feature. It was a video response to someone's post on the forum. The Wolfram command uses a scrape action and regular expressions, like many other commands posted on the forum.

Making, editing, uploading video tutorials is extremely time consuming. Given that VoxCommando is the work of one man who develops the program in his "spare" time because many people prefer to crack software rather than pay for it, and therefore a full-time job is also required, perhaps you can understand that he can only make video tutorials for some aspects of the program:

http://voxcommando.com/mediawiki/index.php?title=Video_Tutorials

There are 2 video tutorials on using the Regex Tool. These show scrape and regex in action.

There is also extensive wiki documentation.

And as per the link above, there are also several tutorials on how to copy xml.

Quote
I would really put "south" for the verification answer but I don't want to have to retype this ahain because I was trying to be "cute".

Ha. Yes, I'm sure that would have made signing onto the forum that much more enjoyable for you.

Managing a forum means dealing with massive amounts of spam attacks, and that can be time-consuming if we don't take any measures to thwart it. We try to choose questions that most people around the world can figure out. The verification questions are only required for the first couple of posts.
« Last Edit: March 16, 2015, 12:41:46 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)

scherr

  • Jr. Member
  • **
  • Posts: 5
  • Karma: 0
    • View Profile
Re: wolfram.xml
« Reply #10 on: March 15, 2015, 03:59:29 AM »
Hey, despite my witty comments I give you guys a lot of credit for the work that you do.
I like speech recognition for speech recognition's sake and although I am not into media and even home automation per se I am trying to put together a comprehensive total home system. I tried the VC plugin into Skype only to find that Skype had disabled that feature. I am currently running an Insteon and a Staples hub with a couple of controllers on each. I ordered Amazon echo but it isn't coming until JUNE-JULY. I have Cortana on one machine running W10 tech preview but the implementation isn't nearly as good as on the Windows phone.
I am not trying to do much with any one thing but would like to put together all the small pieces together
ALTHOUGH it makes it a lot more difficult when I can't even paste the wolfram.xml into VC.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: wolfram.xml
« Reply #11 on: March 15, 2015, 08:36:44 AM »
ALTHOUGH it makes it a lot more difficult when I can't even paste the wolfram.xml into VC.

I'm not sure if you've read our "getting support" wiki page. It explains the kind of information we need in order to help people.

I asked some questions above and provided a few suggestions. Usually we can help people who post, but only if they respond to our questions and provide useful information that helps to demonstrate the problem.

To reiterate: there is nothing unusual about the xml in this thread and it is not inherently invalid unless not properly copied in its entirety. It works fine on 5 of my machines. This suggests a computer incompatibility issue or a user issue.
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
Re: wolfram.xml
« Reply #12 on: March 15, 2015, 08:38:11 AM »
I tried the VC plugin into Skype only to find that Skype had disabled that feature.

They never actually disabled that feature and for the most part it continues to work perfectly.

scherr

  • Jr. Member
  • **
  • Posts: 5
  • Karma: 0
    • View Profile
Re: wolfram.xml
« Reply #13 on: March 16, 2015, 02:49:48 AM »
Boy am I starting to feel stupid. I tried several times again with same results.  I pasted the selected command (last time also) into notepad and it seems like a valid xml file.
The instruction video was pretty straight forward so I am at a loss. I even changed the xml file association from Brackets to VC figuring just maybe.....
As far as the Skype plugin goes when I originally tried working with it and Skype several months ago, Skype had just upgraded an said that 3rd party apps would no longer work.  However Skype has been upgraded at least twice since then and they must have re-enabled this feature.
PS they have been working some of the bugs in W8.1 and I have all the updates installed.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: wolfram.xml
« Reply #14 on: March 16, 2015, 06:51:09 AM »
I know what is going on - it looks like you have insert a empty line (maybe by accident) at first. Here is the corrected XML:


Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.8-->
<command id="625" name="wolfram" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Scrape</cmdType>
    <params>
      <param>http://api.wolframalpha.com/v2/query?appid=[yourAPIkey]&amp;input={1}&amp;format=plaintext</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExSingle</cmdType>
    <params>
      <param>Input.*?&lt;plaintext&gt;([^&lt;].*?)&lt;/plaintext&gt;.*?[Result|Definition|approximation].*?&lt;plaintext&gt;([^&lt;].*?)&lt;/plaintext&gt;</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>LastActionSuccess</ifType>
    <ifParams>&amp;&amp;</ifParams>
    <then>
      <action>
        <cmdType>Results.SetLastResult</cmdType>
        <params>
          <param>You asked for: {Match.1.1}. {Cr}The answer is: {Match.1.2}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Results.RegExReplace</cmdType>
        <params>
          <param>sqrt\((.*?)\)</param>
          <param>square root of $1</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Results.Replace</cmdType>
        <params>
          <param> � </param>
          <param> times </param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Results.Replace</cmdType>
        <params>
          <param> | </param>
          <param>, </param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>OSD.ShowText</cmdType>
        <params>
          <param>{LastResult}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>{LastResult}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>I'm sorry, I don't know the answer to: {1} Could you speak more clearly, or perhaps try to rephrase your question.</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>OSD.ShowText</cmdType>
        <params>
          <param>I'm sorry, I don't know the answer to: {CR}{1}{CR}Could you speak more clearly, or perhaps try to rephrase your question.</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <phrase>Wolfram</phrase>
  <payloadDictation>payloadDictation: Regular</payloadDictation>
</command>
« Last Edit: March 16, 2015, 07:01:23 AM by Kalle »
***********  get excited and make things  **********