dfa

package
v0.0.0-...-bda1dd6 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DFA

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

func New

func New() *DFA

func (*DFA) AddBadWords

func (f *DFA) AddBadWords(words []string)

func (*DFA) Check

func (f *DFA) Check(txt string) ([]string, []string, bool)

func (*DFA) CheckAndReplace

func (f *DFA) CheckAndReplace(txt string) (string, []string, []string, bool)

func (*DFA) FilterInvalidChar

func (f *DFA) FilterInvalidChar(txt ...string) []string

func (*DFA) SetInvalidChar

func (f *DFA) SetInvalidChar(chars string)

func (*DFA) SetReplaceStr

func (f *DFA) SetReplaceStr(str string)

type Node

type Node struct {
	IsEnd bool
	Value string
	Child map[rune]*Node
}

type Trie

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

func NewTrie

func NewTrie() *Trie

func (*Trie) Child

func (t *Trie) Child(key string) *Node

func (*Trie) Insert

func (t *Trie) Insert(key string)

func (*Trie) PrefixMatch

func (t *Trie) PrefixMatch(key string) []string

func (*Trie) Root

func (t *Trie) Root() *Node

func (*Trie) Walk

func (t *Trie) Walk(node *Node) (ret []string)

Jump to

Keyboard shortcuts

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