Example #1
0
func main() {
	log.Println("generating new dict...")
	sqlite.Run(DB_FILE, func(db *sqlite.DB) {
		var keywords []weibo.UserKeyword
		db.Query(&keywords, "select keyword, id from user_keyword")
		for _, keyword := range keywords {
			line := keyword.Keyword
			query, _ := parse.Parse(line)
			for _, k := range query.AllTerms() {
				fmt.Printf("%s\t%d\t%d\n", strings.ToUpper(k), 1, keyword.Id)
			}
		}
	})
}
Example #2
0
func main() {
	fmt.Println("vim-go")
	var examples = []string{
		"1 2 3 4 5",
		"2 + 2 = 4",
	}
	for _, ex := range examples {
		nums, err := parse.Parse(ex)
		if err != nil {
			fmt.Println(err)
			continue
		}
		fmt.Println(nums)
	}
}
Example #3
0
func please(tid int, state *core.BuildState, parsePackageOnly bool, include, exclude []string) {
	for {
		label, dependor, t := state.NextTask()
		switch t {
		case core.Stop, core.Kill:
			return
		case core.Parse, core.SubincludeParse:
			parse.Parse(tid, state, label, dependor, parsePackageOnly, include, exclude)
		case core.Build, core.SubincludeBuild:
			build.Build(tid, state, label)
		case core.Test:
			test.Test(tid, state, label)
		}
		state.TaskDone()
	}
}