dfa

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DFAMatcher

type DFAMatcher struct {
	Root *Node
}

func NewDFAMatcher

func NewDFAMatcher() *DFAMatcher

func (*DFAMatcher) Build

func (D *DFAMatcher) Build(strings []string)

func (*DFAMatcher) Match

func (D *DFAMatcher) Match(text string) bool

Match 匹配

type Matcher

type Matcher interface {
	//构建铭感词
	Build([]string)
	// 匹配
	Match(text string) bool
}

type Node

type Node struct {
	//结束
	End bool
	//节点
	Next map[rune]*Node
}

func (*Node) AddChild

func (n *Node) AddChild(c rune) *Node

AddChild add char

func (*Node) AddWords

func (n *Node) AddWords(w string)

AddWords add words

func (*Node) FindChild

func (n *Node) FindChild(c rune) *Node

FindChild find char

Jump to

Keyboard shortcuts

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