search

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 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 Heap

type Heap []*LocationWrapper

func (Heap) Len

func (h Heap) Len() int

func (Heap) Less

func (h Heap) Less(i, j int) bool

func (*Heap) Pop

func (h *Heap) Pop() interface{}

func (*Heap) Push

func (h *Heap) Push(x interface{})

func (Heap) Swap

func (h Heap) Swap(i, j int)

type Interface

type Interface interface {
	Search(text string, limit int) []*SearchResult
}

type LocationWrapper

type LocationWrapper struct {
	*teryt.Location
	Score      int
	SearchText []rune
}

type ReverseHeap

type ReverseHeap []*LocationWrapper

func (ReverseHeap) Len

func (h ReverseHeap) Len() int

func (ReverseHeap) Less

func (h ReverseHeap) Less(i, j int) bool

func (*ReverseHeap) Pop

func (h *ReverseHeap) Pop() interface{}

func (*ReverseHeap) Push

func (h *ReverseHeap) Push(x interface{})

func (ReverseHeap) Swap

func (h ReverseHeap) Swap(i, j int)

type SearchResult

type SearchResult struct {
	Location *teryt.Location
	Score    int
}

type SearchV1

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

func NewSearchV1

func NewSearchV1(localities []*teryt.Location) *SearchV1

func (*SearchV1) Search

func (s *SearchV1) Search(text string, limit int) []*SearchResult

Jump to

Keyboard shortcuts

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