Documentation ¶
Overview ¶
* blevejieba是一个bleve的中文分词插件,基于gojieba开发
Index ¶
- Constants
- func AnalyzerConstructor(config map[string]interface{}, cache *registry.Cache) (*analysis.Analyzer, error)
- func Dotoken(word string) ([]gojieba.Word, int)
- func IsChinese(str string) bool
- func IsExist(f string) bool
- func Is_date(date_str string) bool
- func Is_price(price string) (string, bool)
- func JiebaTokenizerConstructor(config map[string]interface{}, cache *registry.Cache) (analysis.Tokenizer, error)
- func NewGoJiebaIndexMapping(opt *Options) (mapping.IndexMapping, error)
- func NewJiebaTokenizer(dictFilePath, hmm, userDictPath, idfDict, stopDict string, searchMode bool) (analysis.Tokenizer, error)
- func NewMemIndexWithGoJieba(opt *Options) (bleve.Index, error)
- func NewStoreIndexWithGoJieba(store string, opt *Options) (bleve.Index, error)
- func OpenStoreIndexWithGoJieba(store string, opt *Options) (bleve.Index, error)
- func Regword(word string) string
- func StopTokenFilterConstructor(config map[string]interface{}, cache *registry.Cache) (analysis.TokenFilter, error)
- func TokenMapConstructor(config map[string]interface{}, cache *registry.Cache) (analysis.TokenMap, error)
- type JiebaTokenizer
- type Options
- func (o *Options) WithHMMPath(p string) *Options
- func (o *Options) WithIDFDictPath(p string) *Options
- func (o *Options) WithJiebaDictPath(p string) *Options
- func (o *Options) WithSearch(search bool) *Options
- func (o *Options) WithStopDictPath(p string) *Options
- func (o *Options) WithUserDictPath(p string) *Options
Constants ¶
View Source
const Name = "jieba"
Name is the jieba analyzer/tokenizer name.
Variables ¶
This section is empty.
Functions ¶
func AnalyzerConstructor ¶
func JiebaTokenizerConstructor ¶
func JiebaTokenizerConstructor(config map[string]interface{}, cache *registry.Cache) ( analysis.Tokenizer, error)
JiebaTokenizerConstructor creates a JiebaTokenizer. Parameter config can contains following parameter:
dict_path: optional, the path of the dictionary file. hmm_path: optional, specify whether to use Hidden Markov Model, see NewJiebaTokenizer for details. userdict_path: optional, specify user dict file path idf_path: optional, specify idf file path stopdict_path: optional, specify user stop dict file path is_search: optional, speficy whether to use isSearch mode, see NewJiebaTokenizer for details.
func NewGoJiebaIndexMapping ¶
func NewGoJiebaIndexMapping(opt *Options) (mapping.IndexMapping, error)
func NewJiebaTokenizer ¶
func OpenStoreIndexWithGoJieba ¶ added in v1.0.5
Types ¶
type JiebaTokenizer ¶
type JiebaTokenizer struct {
// contains filtered or unexported fields
}
JiebaTokenizer is the beleve tokenizer for jiebago.
func (*JiebaTokenizer) Tokenize ¶
func (jt *JiebaTokenizer) Tokenize(input []byte) analysis.TokenStream
Tokenize cuts input into bleve token stream.
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
func NewOptions ¶
func NewOptions() *Options
func (*Options) WithHMMPath ¶
func (*Options) WithIDFDictPath ¶
func (*Options) WithJiebaDictPath ¶
func (*Options) WithSearch ¶
func (*Options) WithStopDictPath ¶
func (*Options) WithUserDictPath ¶
Click to show internal directories.
Click to hide internal directories.