Documentation ¶
Index ¶
- Variables
- func Contains(list []string, str string) bool
- func Filter(s string, filter func(r rune) bool) string
- func HasEmpty(args ...string) bool
- func NotEmpty(args ...string) bool
- func Rand() string
- func RandId() string
- func Randn(n int) string
- func Remove(strings []string, strs ...string) []string
- func Reverse(s string) string
- func Seed(seed int64)
- func Substr(str string, start int, stop int) (string, error)
- func TakeOne(valid, or string) string
- func TakeWithPriority(fns ...func() string) string
- func Union(first, second []string) []string
- type Replacer
- type Trie
- type TrieOption
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidStartPosition = errors.New("start position is invalid") ErrInvalidStopPosition = errors.New("stop position is invalid") )
Functions ¶
func Substr ¶
Substr returns runes between start and stop [start, stop) regardless of the chars are ascii or utf8
func TakeWithPriority ¶
Types ¶
type Replacer ¶
func NewReplacer ¶
type Trie ¶
type Trie interface { Filter(text string) (string, []string, bool) FindKeywords(text string) []string }
func NewTrie ¶
func NewTrie(words []string, opts ...TrieOption) Trie
type TrieOption ¶ added in v1.0.4
type TrieOption func(trie *trieNode)
func WithMask ¶ added in v1.0.4
func WithMask(mask rune) TrieOption
Click to show internal directories.
Click to hide internal directories.