Help us shape the future of Go! Take the 2026 Go Developer Survey

eliza

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2017 License: MIT Imports: 7 Imported by: 2

README

go-eliza

Go Report Card

import "github.com/necrophonic/go-eliza"

Simple library implementation of Eliza chatbot in Go

Based on the script detailed at How Eliza Works

package main

import (
	"bufio"
	"fmt"
	"os"

	eliza "github.com/necrophonic/go-eliza"
)

func main() {
	reader := bufio.NewReader(os.Stdin)
	fmt.Println("Hi, how can I help you?")

	for {
		fmt.Print("> ")
		said, _ := reader.ReadString('\n')

		if said == "bye\n" {
			break
		}

		response, err := eliza.AnalyseString(string(said))
		if err != nil {
			panic(err)
		}
		fmt.Println("[Eliza] " + response)
	}

	fmt.Println("Goodbye")
	os.Exit(0)
}

License

Copyright (c) 2016 J Gregory

Released under MIT license, see LICENSE for details.

Documentation

Overview

Package eliza provides an implementation of the Eliza chatbot

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Analyse

func Analyse(this []byte) ([]byte, error)

Analyse performs psychoanalysis on the given sentance

func AnalyseString

func AnalyseString(this string) (string, error)

AnalyseString performs psychoanalysis on the given sentance string

Types

This section is empty.

Jump to

Keyboard shortcuts

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