UNPKG

aimlparser

Version:

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

40 lines (30 loc) 864 B
# aimlparser AIML parser for Node.js which supports non-English language based on aimlinterpreter About **aimlinterpreter** - https://www.npmjs.com/package/aimlinterpreter - https://github.com/raethlein/AIML.js # 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) }) ```