elizaHelper

package
v0.0.0-...-add042c Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2019 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ElizaFarewells []string

ElizaFarewells holds responses for after the user quit the program

View Source
var ElizaGreetings []string

ElizaGreetings holds strings for greeting the user

View Source
var UserFarewells map[string]int

UserFarewells holds string options for the user to quit the program

Functions

func GetResponse

func GetResponse(userInput string) string

GetResponse returns an appropriate response to the user input

func LoadResources

func LoadResources()

LoadResources loads the resources from the json files

func SliceToMap

func SliceToMap(slice []string) map[string]int

SliceToMap converts a string slice into a map convience function for fastercheck if user entered a keyword for quiting the program

Types

type Decomp

type Decomp struct {
	DisAssRule string   `json:"rule"`
	Responses  []string `json:"responses"`
}

Decomp holds the regular expression pattern for decomposition and an array of associated responses

type KeyWord

type KeyWord struct {
	Keyword string `json:"keyword" `
	Rank    int    `json:"rank"`
	Decomp  []Decomp
}

KeyWord holds the keywords, their assoctiated rank and a Decomp struct

Jump to

Keyboard shortcuts

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