websearch

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BM25

type BM25 struct {
	TF           []map[string]int
	DocLengths   []int
	DocCount     int
	AvgDocLength float64
	IDF          map[string]float64
	// contains filtered or unexported fields
}

func NewBM25

func NewBM25(content []PageChunk) *BM25

func (*BM25) Search

func (bm *BM25) Search(query string) []SearchResult

type PageChunk

type PageChunk struct {
	engines.SearchEngineData
	Content string
}

type SearchResult

type SearchResult struct {
	DocID int
	Score float64
}

type WebPageDataExport

type WebPageDataExport struct {
	engines.SearchEngineData
	ContentChunks []string
	Err           error
}

type WebSearchResult

type WebSearchResult struct {
	Data  string  `json:"data"`
	Link  string  `json:"link"`
	Score float64 `json:"score"`
}

func PrepareContextFromWebSearch

func PrepareContextFromWebSearch(ctx context.Context, query string) ([]WebSearchResult, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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