AI Zone Admin Forum Add your forum

CHATBOT MEETUP CHATBOT MEETUP CHATBOT MEETUP CHATBOT CHATBOT MEETUP CHATBOT MEETUP CHATBOT MEETUP CHATBOT MEETUP

On June 28th, 2017 we're organizing our next Chatbot Meetup in Amsterdam, The Netherlands. Feel free to join!'

Using ^burst to split sentence
 
 

I want to split ” Neha Prabhugaonkar (.(JavaScript must be enabled to view this email address)) ” and store them in two in variables, namely,
$name = Neha Prabhugaonkar
$email = .(JavaScript must be enabled to view this email address)

I used ^burst
a: ( _*4 > ) ^keep() ^repeat()
    $id = ^original(_0)
    $name = ^burst($id \(  )

but I can get only the first token i.e. Neha Prabhugaonkar, how should i do it ?

 

 
  [ # 1 ]

^burst outputs a collection. It cannot output to user variables because it does not know what names to give. You can burst onto a factset or you can burst onto a sequence of match variables
a: (_*4>)
$id = ^original(_0)
_0 = ^burst( ... ) 
$id = _0
$name = _1

 

 
  [ # 2 ]

I have a difficulty with using rejoinder, Following is my script to take input from the user for multiple choice:


t: I know two Neha’s, Neha P (.(JavaScript must be enabled to view this email address)) and Neha G (.(JavaScript must be enabled to view this email address)), which Neha are you talking about? Choose from the two: < Neha P ( .(JavaScript must be enabled to view this email address) ) , Neha G ( .(JavaScript must be enabled to view this email address) ) >


a: (_*4>)

  $$input =  ^original(_0)
  $$text =  \\” $$input \\”

  $$pattern = :
  $$open = (
  $$space = _
  $$close = \)

  $$temp = ^substitute ( word $$text $$open $$pattern )
  $$normalised = ^substitute ( word $$temp $$close $$space )

  $$start = findtext($$normalised $$pattern 1)
  $$index = $$start - 2
  $$name = extract($$normalised 1 $$index)


  $$textLength = ^length( $$normalised)
  $$end = $$textLength - 3
  $$index = $$start + 1
  $$email = extract($$normalised $$index $$end)

          /* I Get the Details of user having user name as name and email id using external service*/


The expected input from the user is Neha P (.(JavaScript must be enabled to view this email address)) or Neha G ( .(JavaScript must be enabled to view this email address) which i present in the app .

But i am not able to take input correctly from the user, i want to capture the input in the rejoinder and save it in the variable as $$text = “Neha G ( .(JavaScript must be enabled to view this email address) )” so that i can correctly parse the name n image using extract.


Your help is really appreciated.

 

 
  [ # 3 ]

Basically, How can i add double quotes to the input obtained from the user ?

For example: input from the user is Neha P (.(JavaScript must be enabled to view this email address)) and while storing the input in system variable i want to add quotes to the input, like “Neha P (.(JavaScript must be enabled to view this email address))”, how can i do it ?

 

 
  [ # 4 ]

^join( \” $_userinput \”)

 

 
  login or register to react