extractor

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RegexUrlExtractor

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

RegexUrlExtractor is a concrete implementation of the RegexUrlExtractor interface, using regex for extraction.

func NewRegexUrlExtractor

func NewRegexUrlExtractor(query string) (*RegexUrlExtractor, error)

NewRegexUrlExtractor creates a new regular expression to extract urls

func (*RegexUrlExtractor) Extract

func (re *RegexUrlExtractor) Extract(text string) []string

Extract implements the UrlExtractor interface, using the regex to find urls in the given text.

type UrlExtractor

type UrlExtractor interface {
	Extract(text string) []string
}

UrlExtractor is an interface that defines the contract for url extraction.

Jump to

Keyboard shortcuts

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