module mokadi.mokadi_engine

Inheritance diagram of botadi.mokadi.mokadi_engine

Short summary

module botadi.mokadi.mokadi_engine

Make Mokadi’s engine.

source on GitHub

Classes

class

truncated documentation

MokadiEngine

Defines results for mokadi.

Static Methods

staticmethod

truncated documentation

peak_random

Pick a random message

Methods

method

truncated documentation

__init__

Constructor

fLOG

message to string

process

Process one message and returns an iterator on MokadiInfo.

process_interpreted_message

Process the interpreted message.

Documentation

Make Mokadi’s engine.

source on GitHub

class botadi.mokadi.mokadi_engine.MokadiEngine(root, clog: pyquickhelper.loghelper.custom_log.CustomLog, actions, MokadiGrammarParser, MokadiGrammarLexer, MokadiGrammarListener)

Bases: object

Defines results for mokadi.

source on GitHub

Constructor

Parameters
  • root – root folder

  • clog – custom log

  • actions – list of actions

  • MokadiGrammarParser – parser for a specific language

  • MokadiGrammarLexer – lexer for a specific language

  • MokadiGrammarListener – listener for a specific language

source on GitHub

__init__(root, clog: pyquickhelper.loghelper.custom_log.CustomLog, actions, MokadiGrammarParser, MokadiGrammarLexer, MokadiGrammarListener)

Constructor

Parameters
  • root – root folder

  • clog – custom log

  • actions – list of actions

  • MokadiGrammarParser – parser for a specific language

  • MokadiGrammarLexer – lexer for a specific language

  • MokadiGrammarListener – listener for a specific language

source on GitHub

_messages = {'dontunderstand': ["Je n'ai pas compris.", 'Parlez vous mokadi?'], 'failure': ["Un imprévu s'est produit. Je n'ai pas su faire.", 'Grosse tuile. Je pensais avoir compris. Mais non.']}
fLOG(*args, **kwargs)

message to string

source on GitHub

static peak_random(mes: list)

Pick a random message

Parameters

mes – list of strings

Returns

one string

source on GitHub

process(message: botadi.mokadi.mokadi_message.MokadiMessage, exc=False)

Process one message and returns an iterator on MokadiInfo.

Parameters
  • messageMokadiMessage

  • exc – raises an exception if an error happens

Returns

iterator on MokadiInfo

source on GitHub

process_interpreted_message(interpretation, message)

Process the interpreted message.

Parameters
  • interpretation – interpretation

  • message – original message

Returns

iterator on Info

source on GitHub