AutoVoice Make named group optional

Discussion in 'AutoApps' started by danielo515, Mar 7, 2015.

  1. danielo515

    danielo515 New Member

    Joined:
    Mar 7, 2015
    Messages:
    9
    Likes Received:
    0
    Hello everyone,

    I'm trying to build a autovoice profile with an optional named group,but it is not working. Is something like :

    I'm going to (?<where>\w+)(?<with> \w+)?

    As you can see the last group is optional, but this is not working. If I remove the last quotation mark it only works with full match, which is logical. Any workaround other than creating two different profiles?
     
  2. danielo515

    danielo515 New Member

    Joined:
    Mar 7, 2015
    Messages:
    9
    Likes Received:
    0
    Any idea?
     
  3. Jonatan

    Jonatan Member

    Joined:
    Feb 27, 2015
    Messages:
    59
    Likes Received:
    3
    I once tried creating something similar with like two thing at the end and I ended up creating two profiles for it because one never worked for me.
     
  4. danielo515

    danielo515 New Member

    Joined:
    Mar 7, 2015
    Messages:
    9
    Likes Received:
    0
    I'm afraid that is the only solution. Which is a pitty because this requires the double of profiles for a very simple thing.
     
  5. danielo515

    danielo515 New Member

    Joined:
    Mar 7, 2015
    Messages:
    9
    Likes Received:
    0
    I would love to hear something from the developer. Joaomc where are you?
     
  6. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    I was away for the weekend (I always am :)).
    What sentences did you try that with?
     
  7. danielo515

    danielo515 New Member

    Joined:
    Mar 7, 2015
    Messages:
    9
    Likes Received:
    0
    For example

    I'm going to the Market -- not working
    I'm goint to the Market Sara -- not working
     
  8. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    That's weird. It worked for me. Can you please export your profile's xml file and post it here so I can import it? thanks
     
  9. danielo515

    danielo515 New Member

    Joined:
    Mar 7, 2015
    Messages:
    9
    Likes Received:
    0
    Hello,

    Here it is, thank you

    <TaskerData sr="" dvi="1" tv="4.6u3m">
    <Profile sr="prof133" ve="2">
    <cdate>1422190429770</cdate>
    <edate>1425919065332</edate>
    <id>133</id>
    <mid0>126</mid0>
    <nme>Who Took Car</nme>
    <Event sr="con0" ve="2">
    <code>29126</code>
    <pri>0</pri>
    <Bundle sr="arg0">
    <Vals sr="val">
    <Contains>false</Contains>
    <Contains-type>java.lang.Boolean</Contains-type>
    <LastCommandIdInvert>false</LastCommandIdInvert>
    <LastCommandIdInvert-type>java.lang.Boolean</LastCommandIdInvert-type>
    <LastCommandIdRegex>false</LastCommandIdRegex>
    <LastCommandIdRegex-type>java.lang.Boolean</LastCommandIdRegex-type>
    <NotCancelSearchGoogleNow>false</NotCancelSearchGoogleNow>
    <NotCancelSearchGoogleNow-type>java.lang.Boolean</NotCancelSearchGoogleNow-type>
    <NotOnContinuous>false</NotOnContinuous>
    <NotOnContinuous-type>java.lang.Boolean</NotOnContinuous-type>
    <NotOnNormal>false</NotOnNormal>
    <NotOnNormal-type>java.lang.Boolean</NotOnNormal-type>
    <Precision>&lt;null&gt;</Precision>
    <Precision-type>java.lang.String</Precision-type>
    <ProfileName>&lt;null&gt;</ProfileName>
    <ProfileName-type>java.lang.String</ProfileName-type>
    <Substitutions>&lt;null&gt;</Substitutions>
    <Substitutions-type>java.lang.String</Substitutions-type>
    <TriggerWord>&lt;null&gt;</TriggerWord>
    <TriggerWord-type>java.lang.String</TriggerWord-type>
    <TriggerWordExact>false</TriggerWordExact>
    <TriggerWordExact-type>java.lang.Boolean</TriggerWordExact-type>
    <TriggerWordRegex>false</TriggerWordRegex>
    <TriggerWordRegex-type>java.lang.Boolean</TriggerWordRegex-type>
    <VariableNames>&lt;null&gt;</VariableNames>
    <VariableNames-type>java.lang.String</VariableNames-type>
    <VariableValues>&lt;null&gt;</VariableValues>
    <VariableValues-type>java.lang.String</VariableValues-type>
    <com.twofortyfouram.locale.intent.extra.BLURB>Command: "(?&lt;who&gt;yo|[mm].riam) co[jg][oe] el coche(?&lt;para&gt; para .*)? (regex)"</com.twofortyfouram.locale.intent.extra.BLURB>
    <com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
    <configcommand>(?&lt;who&gt;yo|[Mm].riam) co[jg][oe] el coche(?&lt;para&gt; para .*)?</configcommand>
    <configcommand-type>java.lang.String</configcommand-type>
    <configcommandid>&lt;null&gt;</configcommandid>
    <configcommandid-type>java.lang.String</configcommandid-type>
    <configcommandinvert>false</configcommandinvert>
    <configcommandinvert-type>java.lang.Boolean</configcommandinvert-type>
    <configexactsub>false</configexactsub>
    <configexactsub-type>java.lang.Boolean</configexactsub-type>
    <configlastcommand>&lt;null&gt;</configlastcommand>
    <configlastcommand-type>java.lang.String</configlastcommand-type>
    <configregexsub>true</configregexsub>
    <configregexsub-type>java.lang.Boolean</configregexsub-type>
    <net.dinglisch.android.tasker.EXTRA_NSR_DEPRECATED>true</net.dinglisch.android.tasker.EXTRA_NSR_DEPRECATED>
    <net.dinglisch.android.tasker.EXTRA_NSR_DEPRECATED-type>java.lang.Boolean</net.dinglisch.android.tasker.EXTRA_NSR_DEPRECATED-type>
    <net.dinglisch.android.tasker.RELEVANT_VARIABLES>&lt;StringArray sr=""&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0&gt;%err
    Error Code
    Only available if you select &amp;lt;b&amp;gt;Continue Task After Error&amp;lt;/b&amp;gt; and the action ends in error&lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES10&gt;%avcommsnofilter()
    All recognized commands without filter
    &lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES10&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES2&gt;%who
    who
    who&lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES2&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES1&gt;%errmsg
    Error Message
    Only available if you select &amp;lt;b&amp;gt;Continue Task After Error&amp;lt;/b&amp;gt; and the action ends in error&lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES1&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES4&gt;%regexgroups()
    Regex Groups
    Regex Groups&lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES4&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES3&gt;%para
    para
    para&lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES3&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES6&gt;%avsource
    Source of the Voice Command
    Can be normal, continuous, test or googlenow&lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES6&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES5&gt;%avcommnofilter
    First Command Without Filter
    &lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES5&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES8&gt;%avcomm
    First recognized Command
    &lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES8&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES7&gt;%avword()
    Word Array
    &lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES7&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES9&gt;%avcomms()
    All recognized commands
    &lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES9&gt;&lt;/StringArray&gt;</net.dinglisch.android.tasker.RELEVANT_VARIABLES>
    <net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
    <net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>configcommand configcommandid configlastcommand Precision DisableCommand TriggerWord ProfileName Substitutions VariableNames VariableValues plugininstanceid plugintypeid </net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>
    <net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>java.lang.String</net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>
    <net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
    <net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
    <plugininstanceid>c2ed07aa-d2ea-4860-af5b-86654f26a9b2</plugininstanceid>
    <plugininstanceid-type>java.lang.String</plugininstanceid-type>
    <plugintypeid>com.joaomgcd.autovoice.intent.IntentReceiveVoiceEvent</plugintypeid>
    <plugintypeid-type>java.lang.String</plugintypeid-type>
    </Vals>
    </Bundle>
    <Str sr="arg1" ve="3">com.joaomgcd.autovoice</Str>
    <Str sr="arg2" ve="3">AutoVoice Recognized</Str>
    </Event>
    </Profile>
    <Task sr="task126">
    <cdate>1422182566374</cdate>
    <edate>1425722885935</edate>
    <id>126</id>
    <nme>RegCarUsage</nme>
    <pri>10</pri>
    <Action sr="act0" ve="7">
    <code>129</code>
    <Str sr="arg0" ve="3">who = who.replace("í","i");</Str>
    <Str sr="arg1" ve="3"/>
    <Int sr="arg2" val="1"/>
    <Int sr="arg3" val="45"/>
    </Action>
    <Action sr="act1" ve="7">
    <code>129</code>
    <Str sr="arg0" ve="3">var db = loadTaffy("carUsage");
    var d = new Date();
    var newReg = {"who":who,"timestamp":d.getTime()};
    if(para) newReg.para = para;
    db.insert(newReg);
    var saved=saveTaffy(db().get(),"carUsage");</Str>
    <Str sr="arg1" ve="3">/sdcard/Tasker/javascript/lib/taffydb/taffy-min.js
    /sdcard/Tasker/javascript/lib/taffydb/loadTaffy.js
    /sdcard/Tasker/javascript/lib/taffydb/saveTaffy.js</Str>
    <Int sr="arg2" val="1"/>
    <Int sr="arg3" val="45"/>
    </Action>
    <Action sr="act2" ve="7">
    <code>548</code>
    <Str sr="arg0" ve="3">%res %saved %db</Str>
    <Int sr="arg1" val="1"/>
    </Action>
    <Action sr="act3" ve="7">
    <code>37</code>
    <ConditionList sr="if">
    <Condition sr="c0" ve="3">
    <lhs>%saved</lhs>
    <op>2</op>
    <rhs>true</rhs>
    </Condition>
    </ConditionList>
    </Action>
    <Action sr="act4" ve="7">
    <code>37</code>
    <ConditionList sr="if">
    <Condition sr="c0" ve="3">
    <lhs>%who</lhs>
    <op>3</op>
    <rhs>yo</rhs>
    </Condition>
    </ConditionList>
    </Action>
    <Action sr="act5" ve="7">
    <code>559</code>
    <Str sr="arg0" ve="3">Vale, tomo nota. Ánimo campeona.</Str>
    <Str sr="arg1" ve="3">default:default</Str>
    <Int sr="arg2" val="4"/>
    <Int sr="arg3" val="5"/>
    <Int sr="arg4" val="6"/>
    <Int sr="arg5" val="1"/>
    <Int sr="arg6" val="0"/>
    <Int sr="arg7" val="0"/>
    </Action>
    <Action sr="act6" ve="7">
    <code>43</code>
    </Action>
    <Action sr="act7" ve="7">
    <code>559</code>
    <Str sr="arg0" ve="3">Vale, tomo nota</Str>
    <Str sr="arg1" ve="3">default:default</Str>
    <Int sr="arg2" val="4"/>
    <Int sr="arg3" val="5"/>
    <Int sr="arg4" val="6"/>
    <Int sr="arg5" val="1"/>
    <Int sr="arg6" val="0"/>
    <Int sr="arg7" val="0"/>
    </Action>
    <Action sr="act8" ve="7">
    <code>38</code>
    </Action>
    <Action sr="act9" ve="7">
    <code>38</code>
    </Action>
    </Task>
    </TaskerData>
     
  10. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Can you please post that as a file attachment? Tasker never likes it when I copy paste text like that. Sorry!
     
  11. danielo515

    danielo515 New Member

    Joined:
    Mar 7, 2015
    Messages:
    9
    Likes Received:
    0
    Hello, sorry for the late response. Here is the profile. Change the extension to XML
     

    Attached Files:

  12. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Can you tell me what voice command doesn't work with that?
     
: Autovoice, Regex

Share This Page