module mokadi.mokadi_action_conversation

Inheritance diagram of botadi.mokadi.mokadi_action_conversation

Short summary

module botadi.mokadi.mokadi_action_conversation

Defines an action for Mokadi.

source on GitHub

Classes

class

truncated documentation

MokadiActionConversation

Action. Conversation.

Static Methods

staticmethod

truncated documentation

peak_random

Pick a random message

Methods

method

truncated documentation

__init__

Constructor.

can_do

Tells if the class can process the message.

process_interpreted_message

Process the interpreted message.

Documentation

Defines an action for Mokadi.

source on GitHub

class botadi.mokadi.mokadi_action_conversation.MokadiActionConversation(fLOG=None)

Bases: botadi.mokadi.mokadi_action.MokadiAction

Action. Conversation.

source on GitHub

Constructor.

Parameters
  • folder – folder where to look for presentation

  • fLOG – logging function

source on GitHub

__init__(fLOG=None)

Constructor.

Parameters
  • folder – folder where to look for presentation

  • fLOG – logging function

source on GitHub

_messages = {'bye': ['au revoir', 'salut', 'adieu', la prochaine', la revoyure'], 'hello': ['hello', 'bonjour', 'salut']}
_sounds = {'applaudit': 'somewhere/workspace/botadi/botadi_UT_39_std/_doc/sphinxdoc/source/botadi/mokadi/data/applaus.wav', 'faux_rire': 'somewhere/workspace/botadi/botadi_UT_39_std/_doc/sphinxdoc/source/botadi/mokadi/data/faux_rire.wav', 'hello': 'somewhere/workspace/botadi/botadi_UT_39_std/_doc/sphinxdoc/source/botadi/mokadi/data/hello.wav', 'toilette': 'somewhere/workspace/botadi/botadi_UT_39_std/_doc/sphinxdoc/source/botadi/mokadi/data/toilet_flush_2.wav'}
can_do(interpreted, message)

Tells if the class can process the message.

Parameters
  • interpreted – interpreted message

  • message – message

Returns

true if the class can process the message

The function should be optimized for a subset of answers quite long to build.

source on GitHub

static peak_random(mes: list)

Pick a random message

Parameters

mes – list of strings

Returns

one string

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