Skip to content
/ gcws Public

gcws is CWS(Chinese Word Segmentation) for golang - 一个开源中文分词集成

Notifications You must be signed in to change notification settings

WindomZ/gcws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gcws

Build Status Coverage Status Go Report Card GoDoc

gcws是golang版本的CWS(Chinese Word Segmentation) - 一个开源中文分词集成适配管理器

English

安装

go get github.com/WindomZ/gcws/...

支持

  • sego - Go中文分词,用双数组trie(Double-Array Trie)实现[GitHub]
  • jieba - "结巴"中文分词的Golang版本[GitHub]
  • cwsharp - Golang中文分词库,支持多种分词模式,支持自定义字典和扩展[GitHub]
  • segment - golang 版中文分词包, inspired from 盘古分词[GitHub]
  • gse - Go 语言高效分词, 支持英文、中文、日文等[GitHub]

用法

导入

import (
    "github.com/WindomZ/gcws"
)

初始化(以jieba为例)

import (
    _ "github.com/WindomZ/gcws/jieba"
)
...
cws, err := gcws.NewCWS("jieba")

简单易用

cws.Tokenize("喜欢就坚持,爱就别放弃") // 返回[]string{...}

模式

  • ModeDefault - 默认分词模式
  • ModeSearch - 搜索分词模式,sego, jieba, segment, gse支持
  • ModeFast - 快速分词模式,cwsharp支持
  • ModeEnglish - 英文分词模式,sego, jieba支持

About

gcws is CWS(Chinese Word Segmentation) for golang - 一个开源中文分词集成

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages