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

ChatterBean Java interpreter <that> tag problem
 
 

Hi guys. I am new here.Please help me ),  I installed Chatterbean, but when I use it I am having trouble with the <that> function. As an example:

hi
hi, how are you
fine
java.lang.NullPointerException

my code:

<category>
<
pattern>HI</pattern>
<
template>hihow are you</template>
</
category>

<
category>
<
pattern>fine</pattern>
<
that>hihow are you</that>
<
template>good</template>
</
category>

<
category>
<
pattern>bad</pattern>
<
that>hihow are you</that>
<
template>terrible</template>
</
category

This AIML code works fine via cmd.

 

 
  [ # 1 ]

The biggest problem that you have is that you’re including punctuation within your <that> tag. Please remove the comma from your <that> tag and it should work as expected.

According to the AIML specification (version does not matter) pattern-side tgs (e.g. PATTERN, THAT and TOPIC) only allow letters, numbers, spaces, wildcard characters (* and _ in AIML 1.0 and *, _, ^ and $ in AIML 2.0) and a very limited number of AIML tags. Punctuation (e.g. periods, commas, question marks, exclamation marks, colons and semi-colons) are not permitted.

 

 
  [ # 2 ]

Nothing has changed. The problem is still continuing. What can I do?

 

 
  [ # 3 ]

Try replacing the AIML code you have here with the following:

<category>
<
pattern>HI</pattern>
<
template>Hihow are you</template>
</
category>

<
category>
<
pattern>FINE</pattern>
<
that>* HOW ARE YOU</that>
<
template>good</template>
</
category>

<
category>
<
pattern>BAD</pattern>
<
that>* HOW ARE YOU</that>
<
template>terrible</template>
</
category

If that does not fix it, you should look through aLL of the AIML you use for your bot and see if there might be more punctuation where it doesn’t belong. If that also fails, you may try to google chatterbeans support forum to see if someone may be available to help you troubleshoot a possible bug.

 

 
  [ # 4 ]

Thank you sir, this code is working. what was the problem?

 

 
  [ # 5 ]

That’s a good question. I’m an expert in AIML, not ChatterBean. My guess is that there’s a bug in Chatterbean that needs to be fixed.

Have you considered using Program AB instead of ChatterBean? It’s also a Java-based AIML interpreter, and it’s actively maintained. Unless there’s a specific reason for using what you’re using now, I recommend taking a good look at it.

 

 
  [ # 6 ]

Can I make the user interface for the program AB with Java?

 

 
  [ # 7 ]

I don’t see why not. Program AB is written in Java after all. But I’m not a Java programmer, so I can’t advise you in that area.

 

 
  [ # 8 ]

Thank you very much for your help.

 

 
  login or register to react