Author Topic: [v1.8.3] "Allow command segment info for composite commands" only on last/first  (Read 1682 times)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
When the "Allow command segment info for composite commands" is enabled, "{CMDSEGMENT:}" will not function correctly when the prefix of a composite command has multiple, non bracketed options, only working with the last section of the prefix, or if both the prefix and the suffix have multiple sections, in which case it doesn't work at all.

E.G.
Prefix "prefix 1;prefix 2"
Suffix "suffix"
Speaking "prefix 1 suffix"
"{CMDSEGMENT:0}" will return "Not Set"
Speaking "prefix 2 suffix"
"{CMDSEGMENT:0}" will return "prefix 2 suffix"

Prefix "prefix 1;prefix 2"
Suffix "suffix 1;suffix 2"
Speaking "prefix 1 suffix 1"
"{CMDSEGMENT:0}" will return "Not Set"
Speaking "prefix 2 suffix 1"
"{CMDSEGMENT:0}" will return "Not Set"
Speaking "prefix 1 suffix 2"
"{CMDSEGMENT:0}" will return "Not Set"
Speaking "prefix 2 suffix 2"
"{CMDSEGMENT:0}" will return "Not Set"

Prefix "prefix 1;prefix 2"
Suffix "suffix 1;suffix 2"
Speaking "prefix 1 suffix 1"
"{CMDSEGMENT:0}" will return "Not Set"
Speaking "prefix 2 suffix 1"
"{CMDSEGMENT:0}" will return "Not Set"
Speaking "prefix 1 suffix 2"
"{CMDSEGMENT:0}" will return "Not Set"
Speaking "prefix 2 suffix 2"
"{CMDSEGMENT:0}" will return "Not Set"


However, if the suffix has brackets, it does work with the last section of the prefix, and the first section of the suffix:
Prefix "prefix 1;prefix 2"
Suffix "suffix 1 [test;];suffix 2 [test;]"
Speaking "prefix 1 suffix 1"
"{CMDSEGMENT:0}" will return "Not Set"
Speaking "prefix 2 suffix 1"
"{CMDSEGMENT:0}" will return "prefix 2 suffix 1"
Speaking "prefix 1 suffix 2"
"{CMDSEGMENT:0}" will return "Not Set"
Speaking "prefix 2 suffix 2"
"{CMDSEGMENT:0}" will return "Not Set"

"{CMDSEGMENT:1}" will also function in this manner, returning "test" if "test" was spoken, ""(blank) if "test" was not spoken, provided the suffix used is "suffix 1".


If all sections on either side are wrapped in brackets, "{CMDSEGMENT:0}" and "{CMDSEGMENT:1}" will correctly return the chosen prefix and suffix, respectively.

If the prefix contains a dynamic section, E.G. "prefix 1;prefix 2 [test;]", "{CMDSEGMENT:0}" will correctly return "prefix 2".



EDIT: Fixed in v1.8.3.10
« Last Edit: February 04, 2020, 08:35:53 PM by Pfeil »

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Although this is a good catch, I will need to backburner this until a later time.  For now, although dynamic composite (prefix/suffix) commands are supported, multipart dynamic composite (prefix/suffix) commands are unsupported.

I'll take another stab at this tomorrow o_O

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
I think I've got it wrangled up.  Thanks for the super huge catch.

I uploaded v1.8.3.10 into the, 'unoffical' bin:  http://voiceattack.com/u

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Combinations that use dynamic sections now work, in v1.8.3.10; However, combinations that do not, don't.

E.G.
Prefix "prefix 1;prefix 2 [test;]"
Suffix "suffix 1;suffix 2 [test;]"
Speaking "prefix 1 suffix 1"
"{CMDSEGMENT:0}" will return "Not Set"
Speaking "prefix 2 suffix 1"
"{CMDSEGMENT:0}" will return "prefix 2 suffix 1"
Speaking "prefix 1 suffix 2"
"{CMDSEGMENT:0}" will return "prefix 1 suffix 2"
Speaking "prefix 2 suffix 2"
"{CMDSEGMENT:0}" will return "prefix 2 suffix 2"

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Ok - I think I know what's up there.  Thank you!

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Quote
Ok - I think I know what's up there.  Thank you!
  Sorry - I thought something else was going on the first time I read it. 

Thanks for all the info.  I did some testing and these are the results I found:

Prefix "prefix 1;prefix 2 [test;]"
Suffix "suffix 1;suffix 2 [test;]"
Speaking "prefix 1 suffix 1"
"{CMDSEGMENT:0}" will return "Not Set" 
Expected - prefix 1 and suffix 1, when assembled, do not contain any dynamic elements.  It looks like this when assembled:  "prefix 1 suffix 1"


Speaking "prefix 2 suffix 1"
"{CMDSEGMENT:0}" will return "prefix 2 suffix 1" 

Not sure why your {CMDSEGMENT:0} has all that in it.  My initial test used '{CMDSEGMENT:0} {CMDSEGMENT:1} {CMDSEGMENT:2}'.  What I get back is 'prefix 2  suffix 1' (probably an extra space in the middle).  This is what I would expect to see, as prefix 2 has the optional set in the dynamic block ([test;]). 

To make sure I was seeing it right, I broke the items up into their own actions. If I speak 'prefix 2 test suffix 1' , I get back:
{CMDSEGMENT:0} = prefix 2
{CMDSEGMENT:1} = test
{CMDSEGMENT:2} = suffix 1
Which is what was expected.


Speaking "prefix 1 suffix 2"
"{CMDSEGMENT:0}" will return "prefix 1 suffix 2"

Broken out:
{CMDSEGMENT:0} = prefix 1 suffix 2
{CMDSEGMENT:1} = Empty
{CMDSEGMENT:2} = Not Set

Expected - since the phrase looks like this when assembled:  prefix 1 suffix 2 [test;], and the dynamic block is optional.  Again, not sure why your segment 0 is returning all that.


Speaking "prefix 2 suffix 2"
"{CMDSEGMENT:0}" will return "prefix 2 suffix 2"

My result looks like this:

{CMDSEGMENT:0} = prefix 2
{CMDSEGMENT:1} = Empty
{CMDSEGMENT:2} = suffix 2
Expected - when assembled, it looks like this: prefix 2 [test;] suffix 2

Also not sure why yours is coming back all in segment 0.  I am testing using a new profile with just the prefix and suffix commands that you had indicated.


For anyone else reading along, note that composite commands just join together two phrases - they don't add any dynamic elements.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Bah, I went over all of them manually, but somehow it didn't register that it wasn't in the same segment (I'm also showing the info for segments 0, 1, and 2 at a time, on separate lines in the log).

I was also under the erroneous impression that "{CMDSEGMENT:0}" would function as "{CMD}" without dynamic segments, which is apparently not the case (the documentation does state " If your command contains, ‘dynamic command sections’").

Double-checking again shows it's working as you described:
Prefix "prefix 1;prefix 2 [test;]"
Suffix "suffix 1;suffix 2 [test;]"
Speaking "prefix 1 suffix 1"
"{CMDSEGMENT:0}" will return "Not Set"
Speaking "prefix 2 suffix 1"
"{CMDSEGMENT:0}" will return "prefix 2"
Speaking "prefix 1 suffix 2"
"{CMDSEGMENT:0}" will return "prefix 1 suffix 2"
Speaking "prefix 2 suffix 2"
"{CMDSEGMENT:0}" will return "prefix 2"


Sorry about that :-\

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
No apalogy, Pfeil - This is actually a fairly complicated piece to keep straight - and probably not documented as well as it could be.  Wondering if your results (everything in a single segment) were due to caching  :thinking:

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
I doubt it, chances are it was human error on my part.