keiffster / program-y

Python 3.x based AIML 2.0 Chatbot interpreter, framework, related programs and knowledge files
https://keiffster.github.io/program-y/
Other
348 stars 138 forks source link

Again on wildcard "_" #220

Closed gianfrasoft closed 5 years ago

gianfrasoft commented 5 years ago

This code works perfectly:

    <category>
        <pattern>_ [STOP]</pattern>
        <template><star index="1"></star></template>
    </category>

Input: Hello World [STOP] Output: Hello World

But this code doesn't work:

    <category>
        <pattern>_ _STOP_</pattern>
        <template><star index="1"></star></template>
    </category>

Input: Hello World _STOP_ Output: Hello World _STOP_

Is seems character "_" as part of a word sends parser into confusion.

keiffster commented 5 years ago

I'm not seeing that in the latests build, I have added the grammar

    <category>
        <pattern>_ _STOP_</pattern>
        <template><star index="1"></star></template>
    </category>

And when I ask it the question 'PLEASE DO STOP' I get the response 'PLEASE DO'

The AIML spec does not support wild card as part of the word, instead, it treats the as part of the word and so matches STOP

gianfrasoft commented 5 years ago

Ok, thank you.

I think I have to update my install to the latest build.

Thank you!