@marceloverdijk found an optimization in RiveScript-Java which allowed for getting rid of the redundant rs.thats structure. This implements that fix for the Go version.
It also cleans up some of the code and adds new features to the cmd/rivescript shell:
ANSI color codes to visually identify prompt/response lines (helpful when debugging is enabled); disable colors using the -nocolor option.
New command to toggle debug mode: /debug true or /debug false
New command to print internal data structures: /dump topics or /dump sorted
And finally, this fixes a couple small bugs:
GetGlobal() and SetGlobal() now correctly toggle the special globals "debug" and "depth". Values like "true", "t", "on", and "yes" enables debug mode and other values disable it.
Move a unit test to prevent a cyclic dependency error when running tests from a standard GOPATH (i.e., not using make test).
@marceloverdijk found an optimization in RiveScript-Java which allowed for getting rid of the redundant
rs.thats
structure. This implements that fix for the Go version.It also cleans up some of the code and adds new features to the
cmd/rivescript
shell:-nocolor
option./debug true
or/debug false
/dump topics
or/dump sorted
And finally, this fixes a couple small bugs:
GetGlobal()
andSetGlobal()
now correctly toggle the special globals "debug" and "depth". Values like "true", "t", "on", and "yes" enables debug mode and other values disable it.make test
).