cmd/kagome/server/cmd.go
func command(opt *option) error {
	var dic tokenizer.Dic
	if opt.sysdic == "simple" {
		dic = tokenizer.SysDicIPASimple()
	} else {
		dic = tokenizer.SysDic()
	}
	t := tokenizer.NewWithDic(dic)

	var udic tokenizer.UserDic
	if opt.udic != "" {
		var err error
		if udic, err = tokenizer.NewUserDic(opt.udic); err != nil {
			return err
		}
	}
	t.SetUserDic(udic)

	mux := http.NewServeMux()
	mux.Handle("/", &TokenizeDemoHandler{tokenizer: t})
	mux.Handle("/a", &TokenizeHandler{tokenizer: t})
	log.Fatal(http.ListenAndServe(opt.http, mux))

	return nil
}
func command(opt *option) error {
	var dic tokenizer.Dic
	if opt.sysdic == "simple" {
		dic = tokenizer.SysDicIPASimple()
	} else {
		dic = tokenizer.SysDic()
	}
	t := tokenizer.NewWithDic(dic)

	var udic tokenizer.UserDic
	if opt.udic != "" {
		var err error
		if udic, err = tokenizer.NewUserDic(opt.udic); err != nil {
			return err
		}
	}
	t.SetUserDic(udic)

	mux := http.NewServeMux()
	mux.Handle("/", &TokenizeDemoHandler{tokenizer: t})
	mux.Handle("/a", &TokenizeHandler{tokenizer: t})
	log.Fatal(http.ListenAndServe(opt.http, mux))

	return nil
}
// command main