1
0
mirror of https://github.com/fumiama/jieba.git synced 2026-06-20 18:50:38 +08:00

removed unused idx parameter from Calc function, this is correpsonding to jieba commit #8a2e7f0e7ed205429ae545f5b875af4eaa8490d1

This commit is contained in:
Wang Bin
2015-02-25 12:18:24 +08:00
parent 73cb677aca
commit 2515d2e5a0
3 changed files with 5 additions and 6 deletions

View File

@@ -96,7 +96,7 @@ func GetDAG(sentence string) map[int][]int {
return dag return dag
} }
func Calc(sentence string, dag map[int][]int, idx int) map[int]*Route { func Calc(sentence string, dag map[int][]int) map[int]*Route {
runes := []rune(sentence) runes := []rune(sentence)
number := len(runes) number := len(runes)
routes := make(map[int]*Route) routes := make(map[int]*Route)
@@ -128,7 +128,7 @@ type cutAction func(sentence string) []string
func cut_DAG(sentence string) []string { func cut_DAG(sentence string) []string {
dag := GetDAG(sentence) dag := GetDAG(sentence)
routes := Calc(sentence, dag, 0) routes := Calc(sentence, dag)
x := 0 x := 0
var y int var y int
runes := []rune(sentence) runes := []rune(sentence)
@@ -192,7 +192,7 @@ func cut_DAG_NO_HMM(sentence string) []string {
result := make([]string, 0) result := make([]string, 0)
re_eng := regexp.MustCompile(`[[:alnum:]]`) re_eng := regexp.MustCompile(`[[:alnum:]]`)
dag := GetDAG(sentence) dag := GetDAG(sentence)
routes := Calc(sentence, dag, 0) routes := Calc(sentence, dag)
x := 0 x := 0
var y int var y int
runes := []rune(sentence) runes := []rune(sentence)

View File

@@ -115,7 +115,7 @@ type cutAction func(sentence string) []WordTag
func cut_DAG(sentence string) []WordTag { func cut_DAG(sentence string) []WordTag {
dag := jiebago.GetDAG(sentence) dag := jiebago.GetDAG(sentence)
routes := jiebago.Calc(sentence, dag, 0) routes := jiebago.Calc(sentence, dag)
x := 0 x := 0
var y int var y int
runes := []rune(sentence) runes := []rune(sentence)
@@ -205,7 +205,7 @@ func cut_DAG_NO_HMM(sentence string) []WordTag {
result := make([]WordTag, 0) result := make([]WordTag, 0)
re_eng := regexp.MustCompile(`[[:alnum:]]`) re_eng := regexp.MustCompile(`[[:alnum:]]`)
dag := jiebago.GetDAG(sentence) dag := jiebago.GetDAG(sentence)
routes := jiebago.Calc(sentence, dag, 0) routes := jiebago.Calc(sentence, dag)
x := 0 x := 0
var y int var y int
runes := []rune(sentence) runes := []rune(sentence)

View File

@@ -28,7 +28,6 @@ func (t Trie) MarshalBinary() ([]byte, error) {
var b bytes.Buffer var b bytes.Buffer
enc := gob.NewEncoder(&b) enc := gob.NewEncoder(&b)
err := enc.Encode(t.Nodes.ToSlice()) err := enc.Encode(t.Nodes.ToSlice())
log.Println(err)
if err != nil { if err != nil {
return nil, err return nil, err
} }