Git Product home page Git Product logo

aerolito's Introduction

Aerolito

Aerolito is a markup language YAML based influenced by AIML and RiveScript. The motivation is to have a more clean and easy language than AIML without create a new file format, like RiveScript.

Use example:

from aerolito import Kernel
kernel = Kernel('config.yml')

print kernel.respond(u'Hello')

YAML Schema

YAML was chosed because is more clean, and easy to maintain and read. It's easy to define python types as lists, strings and dictionaries. For example:

# YAML File
key:
    - this is a list item
    - 999                   # integer
    - [1, 2, 3, 4]          # list
    - {1:2, 3:4}            # dict
    - some string           # string

The example above above generate following structure in Python:

{key: [
    'this is a list item',
    999,
    [1, 2, 3, 4],
    {1:2, 3:4}
    'some string'
]}

Is important to understand the yaml structure to create a correct structure for aerolito.

Configuration File

To provide a simple structure for encapsulation, Aerolito knowledge base is divided at least in 2 main files: a configuration and a conversation file.

The configuration file (e.g. config.yml) will registry every global variable and specify the conversation and special files. An example of a config.yml:

# config.yml
version   : v0.1
botname   : chapolin
variable1 : value
variable2 : value
variableN : value

conversations:
    - conversations/file1.yml
    - conversations/file2.yml

synonyms:
    - specials/file1.yml
    - specials/file2.yml

Notice, the first 5 tags are global variables, accessed in patterns by "<variable>" expression. Also notice the tags "conversations" and "synonyms", these tags define conversations pattern file and special synonym files, respectively. Conversations tag is the only one required in config file, with at least one entry.

Conversation Files

The conversation files contains the definition of conversation patterns (i.e., the set of user-inputs patterns and responses texts). Theses files must have the "patterns" tag, with at least one element. The "patterns" tags defines the list of conversation patterns.

Example of file:

patterns:
    - in:
        - Hello
        - Hi there!
      out:
        - Hi!

aerolito's People

Contributors

renatopp avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.