Crates.io | rivescript |
lib.rs | rivescript |
version | 0.1.0 |
source | src |
created_at | 2022-11-26 00:04:19.378706 |
updated_at | 2022-11-26 00:04:19.378706 |
description | Implementation of a RiveScript chatbot interpreter for Rust. |
homepage | https://www.rivescript.com |
repository | https://github.com/aichaos/rivescript-rs |
max_upload_size | |
id | 723012 |
size | 43,472 |
This is a port of the RiveScript interpreter for the Rust programming language.
It is very much a WORK IN PROGRESS and is not functional yet. The checklist below may give you an idea of its state. Watch the git log and see me learn Rust while I figure this module out!
The rough roadmap as I see it so far:
! DEFINITION
> LABEL
+ TRIGGER
- RESPONSE
% PREVIOUS
^ CONTINUE
@ REDIRECT
* CONDITION
// COMMENT
and /* multiline comments */
! local concat = none|space|newline
! global depth = 25
can change recursion depth> begin
blocks<star>, <star1> - <starN>
<botstar>, <botstar1> - <botstarN>
<input1> - <input9>
<reply1> - <reply9>
<id>
<noreply>
<bot>
<env>
<get>, <set>
<add>, <sub>, <mult>, <div>
{topic=...}
{weight=...}
{@...}, <@>
{!...}
{random}
{person}, <person>
{formal}, <formal>
{sentence}, <sentence>
{uppercase}, <uppercase>
{lowercase}, <lowercase>
{ok}
\s
\n
\/
\#
Git clone this project and run: RUST_LOG=debug cargo run
The main.rs program is currently hardcoded to read from ./eg/brain.
This may be put somewhere else when the module is closer to "done."
Just some notes about integrating this module as compared to the other programming languages RiveScript was written in:
> begin
or > topic
is started; any trigger-in-progress
for the old topic is committed to AST.^Continues
(append them to the current line) and to peek
for %Previous
underneath triggers. In rivescript-rs we only look
ahead for ^Continue
and process %Previous
in the normal command
switch similar to @Redirect
or *Condition
This module will be released under MIT when it becomes functional.
Copyright © 2022 Noah Petherbridge.