patterns

package
v0.0.0-...-8155ea7 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: GPL-2.0, GPL-3.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 Manager

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

Manager manages patterns for multiple languages

func NewManager

func NewManager() *Manager

NewManager creates a new pattern manager

func (*Manager) GetAllPatterns

func (m *Manager) GetAllPatterns() PatternSet

GetAllPatterns returns patterns for all languages combined

func (*Manager) GetAllSemantics

func (m *Manager) GetAllSemantics() SemanticIndicators

GetAllSemantics returns semantic indicators for all languages combined

func (*Manager) GetPatterns

func (m *Manager) GetPatterns(lang i18n.Language) PatternSet

GetPatterns returns patterns for a specific language

func (*Manager) GetSemantics

func (m *Manager) GetSemantics(lang i18n.Language) SemanticIndicators

GetSemantics returns semantic indicators for a specific language

type PatternSet

type PatternSet struct {
	Positive   []*regexp.Regexp
	Negative   []*regexp.Regexp
	Correction []*regexp.Regexp
	Workflow   []*regexp.Regexp
	ToolPref   []*regexp.Regexp
}

PatternSet contains regex patterns for detection

type SemanticIndicator

type SemanticIndicator struct {
	Keywords []string
	Weight   float64
}

SemanticIndicator represents a set of keywords with associated weight

type SemanticIndicators

type SemanticIndicators struct {
	Positive []SemanticIndicator
	Negative []SemanticIndicator
}

SemanticIndicators contains semantic keyword indicators

Jump to

Keyboard shortcuts

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