highlight

package
v0.0.0-...-a41f229 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2015 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fragment

type Fragment struct {
	Orig  []byte
	Start int
	End   int
	Score float64
	Index int // used by heap
}

func (*Fragment) Overlaps

func (f *Fragment) Overlaps(other *Fragment) bool

type FragmentFormatter

type FragmentFormatter interface {
	Format(f *Fragment, tlm search.TermLocationMap) string
}

type FragmentScorer

type FragmentScorer interface {
	Score(f *Fragment) float64
}

type Fragmenter

type Fragmenter interface {
	Fragment([]byte, TermLocations) []*Fragment
}

type Highlighter

type Highlighter interface {
	Fragmenter() Fragmenter
	SetFragmenter(Fragmenter)

	FragmentFormatter() FragmentFormatter
	SetFragmentFormatter(FragmentFormatter)

	Separator() string
	SetSeparator(string)

	BestFragmentInField(*search.DocumentMatch, *document.Document, string) string
	BestFragmentsInField(*search.DocumentMatch, *document.Document, string, int) []string
}

type TermLocation

type TermLocation struct {
	Term  string
	Pos   int
	Start int
	End   int
}

type TermLocations

type TermLocations []*TermLocation

func OrderTermLocations

func OrderTermLocations(tlm search.TermLocationMap) TermLocations

func (TermLocations) Len

func (t TermLocations) Len() int

func (TermLocations) Less

func (t TermLocations) Less(i, j int) bool

func (TermLocations) Swap

func (t TermLocations) Swap(i, j int)

Directories

Path Synopsis
fragment_formatters
fragmenters
highlighters

Jump to

Keyboard shortcuts

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