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..

date tag
 
 

As you’re always happy to help, I’m always happy to have help wink

There’s a little problem with the date tag.

I saw a post on the forum about it.

Whatever I put in the format options, I have the same output :

samnov23 18:42:54 CET 2013 

And this is the code :

<date locale="fr_FR" timezone="1" format="%H:%M"/> 

I would like to have the date, and, in other way, the hour.
Is it possible ?

Thanks wink

Patrice

 

 

 
  [ # 1 ]

In Program AB you need to use jformat to format the date/time:

<date locale="en_GB" timezone="0" format="%I:%M %p" jformat="h:mm a"/> 

or

<date format="%x" jformat="EEEEEEEEEE, MMMMMMMMM dd, YYYY"/>. 

I would include both types of formatting. The interpreter will know which one to pick.

 

 
  [ # 2 ]

Thanks, it works. I’ve the date and the time.
Just a little pbm with the time because of the apostrophe here :

<pattern>* ME DONNER L HEURE</pattern
 

 
  [ # 3 ]

I’m not sure I understand the problem here, Patrice. Most likely because I know less about French than I do about particle physics, but also because it’s difficult to troubleshoot a problem without complete information about the symptoms and conditions. Can you post the entire AIML category that you’re having trouble with? Perhaps that would help to clarify things. smile

 

 
  [ # 4 ]

It’s the code that I have problem with :

<category>
    <
pattern>JOUR</pattern>
      <
template>
 
Nous sommes le <date format="%x" jformat="EEEEEEEEEE, MMMMMMMMM dd, YYYY"/>.   
      </
template>
</
category>
<
category>
  <
pattern>QUEL JOUR *</pattern>
  <
template>
    <
srai>JOUR</srai>
  </
template>
</
category>
<
category>
  <
pattern>* QUEL JOUR</pattern>
  <
template>
    <
srai>JOUR</srai>
  </
template>
</
category>
<
category>
  <
pattern>QUELLE EST LA DATE *</pattern>
  <
template>
    <
srai>JOUR</srai>
  </
template>
</
category>



<
category>
    <
pattern>QUELLE HEURE *</pattern>
      <
template>
 
Il est <date locale="fr_FR" timezone="1" format="%I:%M %p" jformat="h:mm"/>.  
      </
template>
</
category>
<
category>
  <
pattern>* QUELLE HEURE</pattern>
  <
template>
    <
srai>QUELLE HEURE *</srai>
  </
template>
</
category>
<
category>
  <
pattern>* ME DONNER LHEURE</pattern>
  <
template>
    <
srai>QUELLE HEURE *</srai>
  </
template>
</
category

The first category (JOUR) works fine and output the date of the day.
But the second (QUELLE HEURE *) output the pattern for the date also…

Perhaps the pattern “* ME DONNER LHEURE” is incorrect, because, in correct french we spell it like this :
me donner l’heure.
I don’t know how to write a pattern when there’s an apostrophe.

I expect to be more explicit now.

 

 

 
  [ # 5 ]

I’m not sure if Program AB replaces the apostrophe (or other accent mark, if it’s not an apostrophe) with a space or not. I just don’t have the experience with that platform that I should. If it does, then you need to do the same in your patterns, so that this:

<pattern>* ME DONNER LHEURE</pattern

would look like this:

<pattern>* ME DONNER L HEURE</pattern

Also, this AIML code:

<srai>QUELLE HEURE *</srai

should be written like this:

<srai>QUELLE HEURE <star/></srai

Wildcards like * or _ are not used in the <template> portion of the AIML code, but are instead to be written as <star> tags. If you have more than one wildcard in any of the “pattern-side” AIML tags (PATTERN, THAT or TOPIC) they are given a numerical index that begins with 1. Please see the examples, below for clarification:

<!-- Using a wildcard in a topic -->
<
topic name="* FISHING">
<
category>
  <
pattern>WHERE DO YOU LIKE TO GO</pattern>
  <
template>
    
I like to go <topicstar index="1"/> fishing at Lake Castiac.
  </
template>
</
category>
</
topic>

<!-- 
Using a wildcard within a <thattag -->
<
category>
  <
pattern>YES</pattern>
  <
that>DO YOU LIKE TO at *</that>
  <
template>
    
So do IAfter a long day of workI often find <thatstar index="2"/> is the perfect place to <thatstar/>.
  </
template>
</
category>

<!-- 
Using a wildcard in a pattern -->
<
category>
  <
pattern>MY IS *</pattern>
  <
template>
    
Let me see if I have this rightAre you telling me you have a <star index="2"/> <star index="1"/>?
  </
template>
</
category

Please note that both <star/> and <star index=“1”/> are the same exact thing, and are interchangeable. The same thing goes for <thatstar> and <topicstar> tags, too.

Now for some example outputs, based on the AIML code above (and some additional ALICE AIML code that’s assumed to be in place)

You: Let’s talk about fly fishing.
bot:  Sure. Fly fishing sounds like a good topic. (this sets the topic to FLY FISHING)
You:Where do you like to go?
bot: I like to go FLY fishing at Lake Castiac.
You: I’ve never been there.
bot: Do you like to FLY fish at Lake Havasu?
You: yes.
bot: So do I. After a long day of work, I often find Lake Havasu is the perfect place to FLY fish.
You: That’s cool.
bot: I’m glad you think so.
You: My dog is crazy.
bot: Let me see if I have this right. Are you telling me you have a crazy dog?
You: lol yes.
bot: I’m glad you found that amusing. That’s amazing! smile
...

If everything is coded properly, this is pretty much the sort of conversation that you can expect by using the AIML code that I’ve provided above. Of course the above conversation relies on having more AIML code than I’ve given, but if you have the most recent version of the ALICE AIML set in use in addition to what I’ve given, you can expect a very similar sort of bot output. I hope this clarifies things a bit. smile

 

 
  [ # 6 ]

Thanks for all of these informations, it’s usefull, I have to use the <star> tag.

But for my time pbm, it’s always the same… I try with and without space but noting changes.
And now, nothing works with the time category :

<category>
  <
pattern>QUELLE HEURE</pattern>
      <
template>
 
Il est <date locale="fr_FR" timezone="1" format="%I:%M %p" jformat="h:mm"/>.  
      </
template>
</
category>
<
category>
  <
pattern>* QUELLE HEURE</pattern>
  <
template>
    <
srai>QUELLE HEURE <star/></srai>
  </
template>
</
category>
<
category>
  <
pattern>* DONNER L HEURE</pattern>
  <
template>
    <
srai>QUELLE HEURE <star/></srai>
  </
template>
</
category
 

 
  [ # 7 ]

It looks like you’re having trouble because you’re using <SRAI> tags that contain the <star> tags, but you have no AIML category that uses it in a pattern. Remember that this:

<pattern>QUELLE HEURE</pattern

is not the same as this:

<pattern>QUELLE HEURE *</pattern

or this:

<pattern>* QUELLE HEURE</pattern

The first one will ONLY match the phrase QUELLE HEURE, and ~NOT~ QUELLE HEURE PICKLE or QUELLE HEURE SIL VOUS PLAIT (my French is absolutely horrible, I’m afraid).

By the same token, QUELLE HEURE * will match QUELLE HEURE PICKLE, but ~NOT~ PARDON QUELLE HEURE or QUELLE HEURE all by itself.

 

 
  [ # 8 ]

Yes, it’s an inattention error. All seems good now.
And, for the apostrophe, I put “L HEURE”.

Thanks a lot !

I have to learned how to use <star> now, it’s usefull.
And also use some variables like name.

 

 
  login or register to react
‹‹ syntax      store the name ››