func load(prefixLen int, verbose bool, cn string) *markovianomatic.Chain { _, dbc := model.Connect(cn) lc, _ := dbc.Count() fmt.Fprintf(os.Stdout, "Using %s with %d prefixes\n", cn, lc) var c *markovianomatic.Chain c = markovianomatic.NewChain(prefixLen, verbose, cn) loadChain(c, dbc) return c }
func TestNewChain(t *testing.T) { var aChain = markovianomatic.NewChain(2) if l := aChain.Length(); l != 0 { t.Errorf("Chain Length is expected to be 0 but was %d", l) } }
func buildChain(n int) *markovianomatic.Chain { var aChain = markovianomatic.NewChain(n) b := bytes.NewBufferString("The quick fox jumps over the lazy dog") aChain.Build(b) return aChain }
func newEmptyChain(prefixLen int, verbose bool) *markovianomatic.Chain { fmt.Fprintf(os.Stdout, "Collection name: ") var cn string fmt.Scanf("%s", &cn) return markovianomatic.NewChain(prefixLen, verbose, cn) }