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
349 stars 136 forks source link

Pattern matching not work in a right way #299

Open haonguyen1915 opened 2 years ago

haonguyen1915 commented 2 years ago

Hi When I created an aiml like this:

<?xml version="1.0" encoding="UTF-8"?>
<aiml version="2.0">
    <category>
        <pattern>^ hello</pattern>
        <template>
            hello
        </template>
    </category>

    <category>
        <pattern>^ LA AI </pattern>
        <template>something</template>
    </category>

</aiml>

When I typing hello hello -> There is no matching found But I made a small modify, changing from ^ to * or remove second partern then it works well

<aiml version="2.0">
    <category>
        <pattern>* hello</pattern>
        <template>
            hello
        </template>
    </category>

    <category>
        <pattern>^ LÀ AI </pattern>
        <template>Kinh tom</template>
    </category>

</aiml>

or

<?xml version="1.0" encoding="UTF-8"?>
<aiml version="2.0">
    <category>
        <pattern>^ hello</pattern>
        <template>
            hello
        </template>
    </category>
</aiml>

Please tell me know why? I think it's a bug Thank you so much!