gos
github.com/bylevel/goscws
go get github.com/bylevel/goscws
gos

github.com/bylevel/goscws

scws中文分词的go语言绑定

go get github.com/bylevel/goscws
Readme

goscws

goscws是scws分词的go语言绑定,源代码只有一个scws.go文件

安装方法

首先要安装一下scws的库

按里面的方法安装一下,然后去

下载字典和规则

例子

package main

import (
    "fmt"
    "github.com/bylevel/goscws"
)

func main() {
    scws := goscws.Scws{}
    scws.New()
    scws.SetDict("/Volumes/dev/dev/c/scws-1.2.2/dict.utf8.xdb", goscws.SCWS_XDICT_XDB)
    scws.SetRule("/Volumes/dev/dev/c/scws-1.2.2/etc/rules.utf8.ini")
    scws.SetCharset("utf8")
    scws.SetIgnore(1)
    scws.SetMulti(goscws.SCWS_MULTI_SHORT & goscws.SCWS_MULTI_DUALITY & goscws.SCWS_MULTI_ZMAIN)
    scws.SendText("这只是一个测试程序")
    for scws.Next() {
        fmt.Println(scws.GetRes())
    }
    scws.Free()
}

GitHub Stars

11

LAST COMMIT

9yrs ago

MAINTAINERS

0

CONTRIBUTORS

1

OPEN ISSUES

1

OPEN PRs

0
VersionTagPublished
v0.0.0-20130817132951-16c49c56e273
2yrs ago
No alternatives found
No tutorials found
Add a tutorial