stringsearch

package
v0.0.0-...-75ec8e3 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package stringsearch provides string search algorithms including Hybrid Chunked AC

Package stringsearch provides string search algorithms

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HybridChunkedAC

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

HybridChunkedAC implements a memory-efficient string matching algorithm that combines chunking with pattern matching to reduce memory usage

func NewHybridChunkedAC

func NewHybridChunkedAC(patterns []string, chunkSize int) *HybridChunkedAC

NewHybridChunkedAC creates a new Hybrid Chunked AC matcher

func (*HybridChunkedAC) Contains

func (m *HybridChunkedAC) Contains(text string) bool

Contains checks if any pattern matches in the text

func (*HybridChunkedAC) FindAll

func (m *HybridChunkedAC) FindAll(text string) []string

FindAll returns all matching pattern strings in the text

func (*HybridChunkedAC) GetPatterns

func (m *HybridChunkedAC) GetPatterns() []string

GetPatterns returns all patterns

func (*HybridChunkedAC) Match

func (m *HybridChunkedAC) Match(text []byte) []int

Match finds all patterns that match in the given text

func (*HybridChunkedAC) MatchString

func (m *HybridChunkedAC) MatchString(text string) []int

MatchString finds all patterns that match in the given text string

func (*HybridChunkedAC) PatternCount

func (m *HybridChunkedAC) PatternCount() int

PatternCount returns the number of patterns

type StringMatcher

type StringMatcher interface {
	Match(text []byte) []int
	MatchString(text string) []int
	FindAll(text string) []string
	Contains(text string) bool
	GetPatterns() []string
	PatternCount() int
}

StringMatcher interface for string matching algorithms

func NewStringMatcher

func NewStringMatcher(patterns []string) StringMatcher

NewStringMatcher creates a new string matcher using Hybrid Chunked AC

Jump to

Keyboard shortcuts

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