Documentation ¶
Index ¶
- Variables
- func AddFilter(filter Filter)
- func ApplySegmentConfig(c *config.Config)
- func CleanStopWords(v string) string
- func CleanStopWordsFromSlice(v []string) (r []string)
- func DoFilter(v string) bool
- func Has(name string) bool
- func IsInitialized() bool
- func IsNop(segment Segment) bool
- func LoadStopWordsDict(stopWordsFile string, args ...bool)
- func NewAPI(apiURL string, apiKey string) *apiSegment
- func Register(name string, c func() Segment)
- func ReloadDict(dictFiles ...string) error
- func ResetSegment()
- func ResetStopwords()
- func SplitWords(b []byte, args ...string) []string
- func SplitWordsAsString(b []byte, args ...string) string
- func SplitWordsBy(b []byte, mode string, args ...string) []string
- func StopWords() []string
- func Unregister(name string)
- type Filter
- type Segment
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultEngine = atomic.NewString(`sego`) // gojieba / sego / jiebago Filters []Filter )
View Source
var ( // DictFile 分词词典文件 DictFile string )
Functions ¶
func ApplySegmentConfig ¶
func CleanStopWords ¶
func CleanStopWordsFromSlice ¶
func IsInitialized ¶
func IsInitialized() bool
func LoadStopWordsDict ¶
func ResetSegment ¶
func ResetSegment()
func ResetStopwords ¶
func ResetStopwords()
func SplitWordsAsString ¶
SplitWordsAsString 将分词结果作为字串返回
func SplitWordsBy ¶
SplitWordsBy 按模式分词
func Unregister ¶
func Unregister(name string)
Types ¶
Click to show internal directories.
Click to hide internal directories.