内容简介:Go 语言高效分词, 支持英文、中文、日文等 词典用双数组trie(Double-Array Trie)实现, 分词器算法为基于词频的最短路径加动态规划。 支持普通和搜索引擎两种分词模式,支持用户词典、词性标注,可运行JSON RP...
Go 语言高效分词, 支持英文、中文、日文等
词典用双数组trie(Double-Array Trie)实现, 分词器算法为基于词频的最短路径加动态规划。
支持普通和搜索引擎两种分词模式,支持用户词典、词性标注,可运行JSON RPC服务。
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 )
[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, pullrequesttemplate.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.
【声明】文章转载自:开源中国社区 [http://www.oschina.net]
以上所述就是小编给大家介绍的《Go 高性能分词 Gse v0.20.0 发布, 优化性能》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
猜你喜欢:- Go 高性能分词 Gse v0.20.0 发布, 优化性能
- Gse v0.10.0 发布了, Go 高性能分词
- Gse v0.50.0 发布, Go 高性能分词,大幅度更新
- Gse v0.30.0 发布, Go 高性能分词, 增加 hmm 支持
- Gse v0.30.0 发布, Go 高性能分词, 增加 hmm 支持
- Gse v0.40.0 发布,Go 高性能分词,增加更多常用 API
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
疯狂科学家大本营
Bei Er Fei Ao Er / 本书翻译组 译、黄晓庆 周宇煜 张为民 审译 / Science Press / 2012-1-5 / 48.00元
美国最棒的创意工场不是贝尔实验室,不是硅谷,也不是麻省理工学院的媒体实验室,而是由五角大楼领导的绝密军事机构DARPA——国防高级研究计划局。DARPA是由美国前总统艾森豪威尔建立的军事部门,创建的目的是为了回应苏联的太空计划。 虽然DARPA属于政府机构,但是没有冷冰 冰的氛围和官僚做派,那里的科学家偏爱牛仔裤和运动鞋。不过他们最爱的还是在各个领域寻找颠覆性创意。从航空航天、IT,到能源领......一起来看看 《疯狂科学家大本营》 这本书的介绍吧!