clyde

package module
v0.0.0-...-10b26a5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2017 License: MIT Imports: 19 Imported by: 0

README

clyde

Clyde is a Markov chain chatbot created by cat@mit.edu. He's been a beloved presence on MIT Zephyr for ~20 years, amusing and delighting many generations of students. Clyde's perl code has been getting a bit long in the tooth, so I wrote this port in order to add some features that were hard to do in perl, make future maintenance and development easier, and get my feet wet in Go.

clyde-go is currently under heavy development, and isn't really a functional chatbot quite yet.

Instructions

Installation
$ go get github.com/sdukhovni/clyde-go/cmd/clyde
Usage
$ $GOPATH/bin/clyde

Documentation

Index

Constants

View Source
const (
	LISTEN    classPolicy = 1
	REPLYHOME classPolicy = 2
	FULL      classPolicy = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Clyde

type Clyde struct {
	// contains filtered or unexported fields
}

Clyde (the struct) holds all of the internal state needed for Clyde (the zephyrbot) to send and receive zephyrs, generate text, and load/save persistent state data.

func LoadClyde

func LoadClyde(dir string) (*Clyde, error)

LoadClyde initializes a Clyde by loading data files found in the given directory, returning an error if the directory does not exist and cannot be created.

func (*Clyde) Run

func (c *Clyde) Run()

Run starts Clyde running; Clyde will begin receiving and responding to zephyrs on classes Clyde is subscribed to, as well as responding to clock ticks. After Clyde.Run() is called, Clyde.Shutdown() must be called before exiting.

func (*Clyde) Shutdown

func (c *Clyde) Shutdown()

Shutdown tells Clyde to save his persistent state to his home directory, close his zephyr session, and perform any other necessary cleanup for Clyde to shut down. Any program that uses a Clyde must call this method to cleanly shutdown Clyde before exiting.

Directories

Path Synopsis
cmd
clyde command
Generating random text: a Markov chain algorithm Based on the program presented in the "Design and Implementation" chapter of The Practice of Programming (Kernighan and Pike, Addison-Wesley 1999).
Generating random text: a Markov chain algorithm Based on the program presented in the "Design and Implementation" chapter of The Practice of Programming (Kernighan and Pike, Addison-Wesley 1999).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL