aimlparser

AIML parser which supports non-English language based on aimlintepreter.

Usage no npm install needed!

<script type="module">
  import aimlparser from 'https://cdn.skypack.dev/aimlparser';
</script>

README

aimlparser

AIML parser for Node.js which supports non-English language based on aimlinterpreter

About aimlinterpreter

Sample

test-aiml.xml

<?xml version="1.0" encoding="UTF-8"?>
<aiml version="2.0">
    <category>
        <pattern>ดีจ้า</pattern>
        <template>สวัสดี</template>
    </category>

    <category>
        <pattern>HELLO</pattern>
        <template>Hello!</template>
    </category>
</aiml>

app.js

This will return 'Hello!'

const AIMLParser = require('aimlparser')
const aimlParser = new AIMLParser({ name:'HelloBot'})
aimlParser.load(['./test-aiml.xml'])
aimlParser.getResult('Hello', (answer, wildCardArray, input) => {
    console.log('Result = '+ answer)
})