Prose是一款用于Go语言的文本处理库(主要是英文),支持okeizatio(分词)、part-of-speechtaggig(词性标注)、amed-etityextractio(命名实体提取)等。
安装$ go get github.com/jdkato/prose/...使用Tokeizig
Taggig
Trasformig
Summarizig
Chukig
Licese
Tokeizig
单词、句子和regexptokeizer可用。每个分词器实现相同的接口,这样可以轻松地在库的其他部分中自定义词语切分。
package maiimport ( "fmt" "github.com/jdkato/prose/tokeize")fuc mai() { text := "They'll save ad ivest more." tokeizer := tokeize.NewTreebakWordTokeizer() for _, word := rage tokeizer.Tokeize(text) { // [They 'll save ad ivest more .] fmt.Pritl(word) }}
评论