Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

irin-lang

pureexe8SEE LICENSE IN LICENSE0.0.6

IRIN (Indent to Recognize for Intelligent Natural language) is a scripting language of chatterbots, make you easier to create chatterbot.

bot, chatbot, chatterbot, aiml, artificial, intelligence, chatscript, buddyscript

readme

irin-lang

Indent to Recognize for Intelligent Natural language or IRIN is the programming language which use indent to descibe question and answer for chatterbot. It's design for shorter script and easier for newbie. compatible test with English and Thai.

This repo irin-lang is interpreter for irin language. it's written on coffeescript and make to compatible with javascript in browser side and server side.

If you have any question or any problem. Let's me hear at Github issue

How to scripting irin

irin language has divided into two part that call Head and Body. In head use to define variable and body use to define question and answer for chatterbot. You can scripting without head. irin script must save in .irin file extension. In body use indent to descibe question or answer. You can indent by use Tab or space. Here is example.

Hello
  Hi!

when you type hello. Don't worry about case sensitive on question. bot will reply Hi!. Line without indent always question. And greater deep level is answer. And next greater level is question.

And irin language has many feature. such as in-line condition. define topic in seperate files information. So please read documentation to find them out.

Installation

irin-lang interpreter is available via NPM you can download by

npm install --save irin-lang

and available on Bower too. you can download by

bower install --save irin-lang

Don't worry if you isn't use both NPM and Bower. you can directly download from Github Repo Release

by using Node.js or CommonJS

var Irin = require("irin-lang")

by using normal browser

<script src="path/to/irin-lang.min.js"></script>

then you must check for make sure everything work correctly. by create file hello.irin

hello
  Hello world!

and write this javascript to run hello.irin with input hello

var bot = new Irin("hello.irin",function(err){
  if(err){
    throw err;
  }
  console.log(bot.reply("hello"));
});

if everything work fine. you should see Hello world! from console. if you ran into problem. try to fix it by your safe. if nothing work. Let's me here at Github issue

and finally you is ready to learn irin language. Please read documentation to continue.

Documentation

documentation is available in Thai and English.

LICENSE

this project has been supported by the National Electronics and Computer Technology Center (NECTEC)

Please read custom license from LICENSE in this repository.

Develop by

Pakkapon Phongthawee
Email : phongthawee_p@silpakorn.edu
Personal Website: www.pureapp.in.th

changelog

CHANGELOG

v0.0.6

  • fix: ### multiline comment working incorrectly ###
  • fix: tokenizeOperator return without trim

v0.0.5

  • fix: crash on use [*] operator
  • fix: {a+1} isn't return a1
  • fix: {5+1} isn't return 6

v0.0.4

  • fix: -> on difference directory
  • fix: expression - and / is wrong because stack popping error.
  • fix: regular expression escape
  • fix: declare variable which isn't following top-down law
  • fix: ### multiline comment working incorrectly ###
  • add: support data<-{other_variable}+5 in header
  • add: error Unexpected declaration in header.
  • add: error Variable name must not start with number.
  • add: error unexpected indentation
  • remove: error Header must have no indent. (replace by unexpected indentation)

v0.0.3

  • fix: wrong next pointer in method parseProcess
  • fix: inline-condition return true on undefined and NaN
  • fix: undefined on answer {}, it should be empty
  • add: {0} is user input

v0.0.2

  • fix: topic wrong pointer next node
  • fix: in-line variable work incorrectly because conflict on == and ===
  • fix: error has been detect wrong line
  • fix: crash on answer node is missing
  • fix: crash on reply parameter is empty string
  • fix: crash on countIndent()
  • fix: crash on chrome
  • add: error if reply input isn't string
  • add: error if input file path isn't string
  • add: error when call reply before Irin class callback
  • add: error when multiline comment without closing tag

v0.0.1

  • initial Release
  • tested with browser and node.js
  • tested with Thai and English language
  • more, see documentation