eliza

package
v0.0.0-...-11242b9 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnswerGenerator

type AnswerGenerator interface {
	GenerateAnswers(question string) []string
}

AnswerGenerator should be able to give back a slice of answers when given a question.

type AnswerPicker

type AnswerPicker interface {
	PickAnswer(answers []string) string
}

AnswerPicker is in charge of picking a response out of a list of answers.

type Eliza

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

func NewEliza

func NewEliza(generator AnswerGenerator, picker AnswerPicker) *Eliza

NewEliza creates a new Eliza instance with teh given answer generator and answer picker.

func (*Eliza) Answers

func (e *Eliza) Answers() ([]string, error)

Answers returns a list of all given answers.

func (*Eliza) GoAsk

func (e *Eliza) GoAsk(question string) (string, error)

GoAsk is the "main" exported function Eliza is needed for. it takes a single question in string format, and gives back a single response also in string format.

func (*Eliza) Questions

func (e *Eliza) Questions() ([]string, error)

Questions returns a list of all asked questions

Jump to

Keyboard shortcuts

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