AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

How do i set the time or date ?
 
 
  [ # 16 ]

Hi,

I want to tell my bot for the period 01.06.2017 to 31.07.2017.
i have given question to bot as 1.6.2017 to 31.7.2017

in reply i should get thank you you have told the date as 1.6.2017 to 31.7.2017.

<category>1.6.2017 to 31.7.2017</pattern>
<template> thank you you have told the date as 1.6.2017 to 31.7.2017
</template>
</category>

how it will read as date not as numeric value?

Thanks in Advance.

 

 

 
  [ # 17 ]

You will need to allocate variables representing the date. What interpreter are you using? This example assumes you are using Pandorabots:

<category>
<
pattern>* * * TO * * *</pattern>
<
template>
<
think>
<
set name="day1"><star/></set>
<
set name="month1"><star index="2"/></set>
<
set name="year1"><star index="3"/></set>
<
set name="day2"><star index="4"/></set>
<
set name="month2"><star index="5"/></set>
<
set name="year2"><star index="6"/></set>
</
think>
Dates set.
</
template>
</
category

Then you can manipulate the variables you have set. If you don’t want it as detailed, you could do this:

<category>
<
pattern>* TO *</pattern>
<
template>
<
think>
<
set name="date1"><star/></set>
<
set name="date2"><star index="2"/></set>
</
think>
Dates set.
</
template>
</
category

In both examples, make sure the categories are not accidentally called by input such as, “going to bed”.

 

 
  [ # 18 ]

Thank you guys .

I have one more query on recognizing the mathematical notation like %

i will ask my bot saying what is the discount % .

i want my bot to reply by saying This product having 70%.

Thank in advance.

 

 
  [ # 19 ]

You will struggle to do percentages in AIML without a lot of hand coding. Are you expecting the bot to work out the percentage of something or simply to recite what you have told it to say?

 

 
  [ # 20 ]

Thanks Steve .

I do not want to do % calculation now. I will ask my bot in question as what is the discount %?

In reply i am expecting my bot to tell you are eligible for 70 % discount just it has to say . No calculation .

Thanks in Advance.

 

 
  [ # 21 ]

Ok. Unfortunately, you still haven’t told me what interpreter you are using, so I will assume Pandorabots again. Pandorabots replaces the % sign with a space, so you would do the following:

<category>
<
pattern>WHAT IS THE DISCOUNT</pattern>
<
template>
You are eligible for 70 discount.
</
template>
</
category

If you are not using Pandorabots, check your normal.txt file to see how you are representing %. For example in Program AB, there is the following entry:
“%”,” percent “

So the same category in Program AB would be:

<category>
<
pattern>WHAT IS THE DISCOUNT PERCENT</pattern>
<
template>
You are eligible for 70 discount.
</
template>
</
category
 

 
  [ # 22 ]

Thanks Steve its working fine.

 

 
  [ # 23 ]

Always happy to help

 

 
  [ # 24 ]

Using “-5” works for New York or similar time zones. I however live in Adelaide Australia which is between +9 and +10 but I can’t put +9:30 as the value as it make it display the date instead of the time. I had this trouble 7 years ago. Am I to assume they still have not fixed this?

 

 
  [ # 25 ]

I was unaware of this issue but I can definitely see the need for minutes as well as hours in the timzone offset. I think some places in India also use part hours. I’m the chair of the AIML Foundation and will propose this suggestion at our next meeting.

 

 < 1 2
2 of 2
 
  login or register to react