tried

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WordIndexDict map[WordIndexType]*wordIndexStore

Functions

This section is empty.

Types

type Node

type Node struct {
	// contains filtered or unexported fields
}

type Tried

type Tried struct {
	// contains filtered or unexported fields
}

func New

func New() *Tried

New 默认 WordIndexLower 意味着只支持小写

func NewWithWordType

func NewWithWordType(t WordIndexType) *Tried

NewWithWordType 选择单词的类型 WordIndexLower 意味着只支持小写

func (*Tried) Get

func (tried *Tried) Get(words string) interface{}

func (*Tried) Has

func (tried *Tried) Has(words string) bool

func (*Tried) HasPrefix

func (tried *Tried) HasPrefix(words string) bool

func (*Tried) PrefixWords

func (tried *Tried) PrefixWords(words string) []string

func (*Tried) Put

func (tried *Tried) Put(words string)

Put the word in tried

func (*Tried) PutWithValue added in v0.11.3

func (tried *Tried) PutWithValue(words string, value interface{})

PutWithValue the word with value in tried.eg. you can count word in value

func (*Tried) String

func (tried *Tried) String() string

func (*Tried) Traversal

func (tried *Tried) Traversal(every func(cidx uint, value interface{}) bool)

func (*Tried) WordsArray

func (tried *Tried) WordsArray() []string

type WordIndexType

type WordIndexType int

WordIndexType 单词统计的类型 eg. WordIndexLower 意味Put的单词只支持小写...

const (

	// WordIndexLower 小写
	WordIndexLower WordIndexType
	// WordIndexUpper 大写
	WordIndexUpper
	// WordIndexDigital 数字
	WordIndexDigital
	// WordIndexUpperLower 大+小写
	WordIndexUpperLower
	// WordIndexLowerDigital 小写+数字
	WordIndexLowerDigital
	// WordIndexUpperDigital 大写+数字
	WordIndexUpperDigital
	// WordIndexUpperLowerDigital 大小写+数字
	WordIndexUpperLowerDigital
	// WordIndex256 256个字符 0-255 ascii
	WordIndex256
	// WordIndex32to126  32-126 ascii
	WordIndex32to126
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL