Gse v0.20.0 釋出了, Go 高效能分詞,  優化效能和程式碼, 更多測試

veni發表於2018-10-10

Go 語言高效分詞, 支援英文、中文、日文等

詞典用雙陣列 trie(Double-Array Trie)實現, 分詞器演算法為基於詞頻的最短路徑加動態規劃。

支援普通和搜尋引擎兩種分詞模式,支援使用者詞典、詞性標註,可執行 JSON RPC 服務。

專案地址: https://github.com/go-ego/gse

package main

import (
    "fmt"

    "github.com/go-ego/gse"
)

func main() {
    var seg gse.Segmenter
    seg.LoadDict("zh,testdata/test_dict.txt,testdata/test_dict1.txt")

    text1 := []byte("你好世界, Hello world")

    segments := seg.Segment(text1)
    fmt.Println(gse.ToString(segments))
}

Lethe River

Add

  • [NEW] Add slice() and string() func and test
  • [NEW] Add more test
  • [NEW] Optimize textSliceToString splicing speed
  • [NEW] Update LoadDict() log.Printf and optimize read dict log
  • [NEW] Add ToString() and ToSlice() default value and update test
  • [NEW] ToString and ToSlice use return not use else and update code
  • [NEW] Update sever code
  • [NEW] Add token equals() func and test
  • [NEW] Add search mode example
  • [NEW] Optimize file defer close
  • [NEW] Segment return use nil not empty array
  • [NEW] Update pkg to newest ( optimize cedar code ) <br/>

  • [NEW] Update and refactoring segment test code

  • [NEW] Update dictionary and static demo

  • [NEW] Refactoring gse benchmark code

  • [NEW] Update and simplify test code

Update

  • [NEW] Update issue template more obvious
  • [NEW] Update godoc, pull_request_template.md and issue_template.md
  • [NEW] Update README.md Uniform name
  • [NEW] Update godoc
  • [NEW] Update Update README.md add searchMode docs
  • [NEW] Optimize Japanese subparticipation errors
  • [NEW] Update code style and name style
  • [NEW] Update examples and benchmark code
  • [NEW] Add Travis ci go1.11 support

Fix

  • [FIX] Update examples lang fix #4
  • [FIX] Fix typo for example
  • [FIX] Fix LoadDict() godoc error
  • [FIX] Fix sub-word error
  • [FIX] Fix dict is nil segmentWords panic nil pointer
  • [FIX] Update README.md Fixed Release badge

See Commits for more details, after Apr 27.

更多原創文章乾貨分享,請關注公眾號
  • Gse v0.20.0 釋出了, Go 高效能分詞,  優化效能和程式碼, 更多測試
  • 加微信實戰群請加微信(註明:實戰群):gocnio

相關文章