Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DFAMatcher ¶
type DFAMatcher struct {
// contains filtered or unexported fields
}
DFAMatcher implements a Deterministic Finite Automaton for pattern matching
func NewDFAMatcher ¶
func NewDFAMatcher(caseSensitive bool) *DFAMatcher
NewDFAMatcher creates a new DFA matcher instance
func (*DFAMatcher) Build ¶
func (m *DFAMatcher) Build(words []dict.Word) error
Build constructs the DFA from the given words
func (*DFAMatcher) Match ¶
func (m *DFAMatcher) Match(text string) []algorithm.MatchResult
Match finds all sensitive words in the text
func (*DFAMatcher) Replace ¶
func (m *DFAMatcher) Replace(text string, repl rune) string
Replace replaces all sensitive words with the given replacement rune
func (*DFAMatcher) Validate ¶
func (m *DFAMatcher) Validate(text string) bool
Validate checks if the text contains any sensitive words
Click to show internal directories.
Click to hide internal directories.