stringx

package
v0.0.0-...-53d1e61 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Rand

func Rand() string

Rand returns a random string.

func RandId

func RandId() string

RandId returns a random id string.

func Randn

func Randn(n int, letterBytes string) string

Randn returns a random string with length n.

func Seed

func Seed(seed int64)

Seed sets the seed to seed.

func TakeOne

func TakeOne(effective string, s string) string

* js effective?effective:s

Types

type Trie

type Trie interface {
	Filter(text string) (string, []string, bool)
	FindKeywords(text string) []string
}

A Trie is a tree implementation that used to find elements rapidly.

func NewTrie

func NewTrie(words []string, opts ...TrieOption) Trie

NewTrie returns a Trie.

type TrieOption

type TrieOption func(trie *trieNode)

TrieOption defines the method to customize a Trie.

func WithMask

func WithMask(mask rune) TrieOption

WithMask customizes a Trie with keywords masked as given mask char.

func WithSkip

func WithSkip(skip []rune) TrieOption

Jump to

Keyboard shortcuts

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