Versions in this module Expand all Collapse all v0 v0.2.2 Jul 4, 2022 v0.2.1 May 26, 2022 v0.2.0 May 26, 2022 v0.1.9 Jan 4, 2022 v0.1.8 Nov 11, 2021 v0.1.7 Jul 13, 2021 v0.1.6 Jul 12, 2021 v0.1.5 Feb 12, 2021 v0.1.4 Dec 29, 2020 v0.1.3 Oct 6, 2020 v0.1.2 Sep 29, 2020 v0.1.1 Sep 29, 2020 v0.1.0 Sep 28, 2020 Changes in this version + const BgBlack + const BgBlue + const BgCyan + const BgGreen + const BgMagenta + const BgRed + const BgWhite + const BgYellow + const Blink + const Bright + const DefaultSeparator + const Dim + const FgBlack + const FgBlue + const FgCyan + const FgGreen + const FgMagenta + const FgRed + const FgWhite + const FgYellow + const Hidden + const Name + const Reset + const Reverse + const Underscore + type ANSIFragmentFormatter struct + func NewANSIFragmentFormatter() *ANSIFragmentFormatter + func NewANSIFragmentFormatterColor(color string) *ANSIFragmentFormatter + func (a *ANSIFragmentFormatter) Format(f *Fragment, orderedTermLocations TermLocations) string + type Fragment struct + End int + Index int + Orig []byte + Score float64 + Start int + func (f *Fragment) Overlaps(other *Fragment) bool + type FragmentFormatter interface + Format func(f *Fragment, orderedTermLocations TermLocations) string + type FragmentQueue []*Fragment + func (fq *FragmentQueue) Pop() interface{} + func (fq *FragmentQueue) Push(x interface{}) + func (fq FragmentQueue) Len() int + func (fq FragmentQueue) Less(i, j int) bool + func (fq FragmentQueue) Swap(i, j int) + type FragmentScorer interface + Score func(f *Fragment) float64 + type Fragmenter interface + Fragment func([]byte, TermLocations) []*Fragment + type HTMLFragmentFormatter struct + func NewHTMLFragmentFormatter() *HTMLFragmentFormatter + func NewHTMLFragmentFormatterTags(before, after string) *HTMLFragmentFormatter + func (a *HTMLFragmentFormatter) Format(f *Fragment, orderedTermLocations TermLocations) string + type Highlighter interface + BestFragment func(tlm search.TermLocationMap, orig []byte) string + BestFragments func(tlm search.TermLocationMap, orig []byte, num int) []string + type SimpleFragmentScorer struct + func NewFragmentScorer(tlm search.TermLocationMap) *SimpleFragmentScorer + func (s *SimpleFragmentScorer) Score(f *Fragment) + type SimpleFragmenter struct + func NewSimpleFragmenter() *SimpleFragmenter + func NewSimpleFragmenterSized(fragmentSize int) *SimpleFragmenter + func (s *SimpleFragmenter) Fragment(orig []byte, ot TermLocations) []*Fragment + type SimpleHighlighter struct + func NewANSIHighlighter() *SimpleHighlighter + func NewANSIHighlighterColor(color string) *SimpleHighlighter + func NewHTMLHighlighter() *SimpleHighlighter + func NewHTMLHighlighterTags(before, after string) *SimpleHighlighter + func NewSimpleHighlighter(fragmenter Fragmenter, formatter FragmentFormatter, separator string) *SimpleHighlighter + func (s *SimpleHighlighter) BestFragment(tlm search.TermLocationMap, orig []byte) string + func (s *SimpleHighlighter) BestFragments(tlm search.TermLocationMap, orig []byte, num int) []string + type TermLocation struct + End int + Pos int + Start int + Term string + func (tl *TermLocation) Overlaps(other *TermLocation) bool + type TermLocations []*TermLocation + func OrderTermLocations(tlm search.TermLocationMap) TermLocations + func (t TermLocations) Len() int + func (t TermLocations) Less(i, j int) bool + func (t TermLocations) MergeOverlapping() + func (t TermLocations) Swap(i, j int)