ppindzola
Newbie
Posts: 2
Joined: Mon Apr 18, 2016 9:31 pm

Pattern match in succession (space between matches?)

Fri Apr 22, 2016 4:36 am

Hi Syn community,

I've got a question about when there are matches in succession (in a row)...

The code below is a simple learn pattern (feel free to critique) that I'd like to function like:

input - learn a dog can jump high
pattern - can a dog jump high?

The problem is that since the matches are in succession, the pattern that activates is actually

pattern - can a dogjump high

I've considered a regex in between the matches that simply grabs a space "\s", rearranging the process tag, or throwing in a type of wildcard (they only grab words)...

Any suggestions would be greatly appreciated!

Code: Select all

<Model>
      <Pattern>LEARN * CAN *</Pattern>
      	<Response>Alright, I'll remember that <Match Index="1" /> can <Match Index="2" />.
      		<Learn>
      			<Concept Name="Learn" Type="Public" Repeat="True">
            		<Model>
            			<Pattern>CAN <Process><Match Index="1" /><Match Index="2" /></Process></Pattern>
                			<Response>Yes, <Process><Match Index="1" /></Process> can <Process><Match Index="2" /></Process></Response>
            		</Model>
        		</Concept>
      		</Learn>
     	</Response>
    </Model>

JeffersonStack
Pro
Posts: 44
Joined: Fri Apr 05, 2013 1:20 am

Re: Pattern match in succession (space between matches?)

Fri Apr 22, 2016 12:27 pm

In Chatbot Studio right click that Process tag and select Insert->Attributes->xml:space done! ;)

SIML Code

<Process xml:space="preserve" ><Match Index="1" /> <Match Index="2" />

ppindzola
Newbie
Posts: 2
Joined: Mon Apr 18, 2016 9:31 pm

Re: Pattern match in succession (space between matches?)

Fri Apr 22, 2016 7:19 pm

Thanks for the quick and helpful response!

+1 +1

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests