pyaiml21.graphmaster.sqlite_gm.SqLiteGraphMaster

class pyaiml21.graphmaster.sqlite_gm.SqLiteGraphMaster(bot_config: pyaiml21.botconfig.config.BotConfig, conn: sqlite3.Connection, policy: Union[str, Callable[[Any, Any], Any]] = 'keep_last')[source][source]

Store the template nodes in the sqlite database.

For more details on the graphmaster, please refer to the GraphMaster implementation.

The constructor expects a sqlite3.Connection object, it is the responsibility of the user to make sure the connection stays open during the lifetime of the graphmaster.

Methods

add_pattern_tag

Add pattern tag to the known tags of this graphmaster.

dump

Store the graphmaster into the specified file.

generate_html

Store graphmaster to html file.

load

Load the graphmaster from the file, after it was saved using dump.

load_obj

Load template from the database.

match

Find the matching Pattern Path.

save

Save the category into the graphmaster.

save_obj

Save obj to the database.

size

Return the number of AIML categories.

validate

Validate the category, check its syntax.

vocabulary

Implement <vocabulary> tag.

Attributes

THAT

TOPIC

load_obj(saved_obj: int) Any[source][source]

Load template from the database.

save_obj(obj: Any) int[source][source]

Save obj to the database.