Skip to content

Simple library implementation of Eliza chatbot in Go

License

Notifications You must be signed in to change notification settings

necrophonic/go-eliza

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Simple library implementation of Eliza chatbot in Go

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages