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:
6
jieba.go
6
jieba.go
@@ -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)
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user