Reputation: 15
In Aiml I'm trying to detect random nonsense words but why is it not working? Here is the code
<category>
<pattern>* f g h *</pattern>
<template>What nonsense did you just typed??</template>
</category>
The response is
Human: hdhfghjrur
Robot: pattern did not matched
How do you use wildcards without giving space
Why is fgh not matching?
Upvotes: 0
Views: 121
Reputation: 905
Wildcards match whole words, not just strings of letters but you can add an entry in your normal substitution file for each nonsense string you want to catch.
["fgh", " BadInput "],
This will convert your sample input of hdhfghjrur
to hdh BadInput jrur
and then you can create a category to deal with this:
<category>
<pattern># BadInput ^</pattern>
<template>What nonsense did you just type??</template>
</category>
Upvotes: 0