aiml

How to eliminate the "unknown" output in AIML when using ^ wildcard and there are no word captured by the wildcard?


AIML Code:

  <category>
      <pattern>Can I reserve a table ^</pattern>
      <template>Sure. Your reservation <star /> has been made.</template>
  </category>

When I typed "Can I reserve a table for 4", the chatbot will work smoothly and respond with "Sure. Your reservation for 4 has been made."
However, when I type "Can I reserve a table?", the chatbot will respond with "Sure. Your reservation unknown has been made."

How to eliminate the "unknown" in the second output so that it can respond with something like "Sure. Your reservation has been made."?


Solution

  • You can set the default value of unknown values in your system properties. Just remove this line and "unknown" will no longer be displayed.

    ["default-property", "unknown"],