data

package
v0.0.0-...-6777dfb Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataHandler

type DataHandler struct {
	DbFile         string
	IncWeight      float64
	DecayFactor    float64
	PruneThreshold float64
}

func (DataHandler) CreateTable

func (data_h DataHandler) CreateTable() error

CreateTable will create a sql table at `data_h.Db_file`. This will create the file if it does not exists.

func (DataHandler) DropTable

func (data_h DataHandler) DropTable() error

DropTable will drop the frecency table if it exists. An error will be returned if `data_h.Db_file` is not found.

func (DataHandler) GetTopBaseMatch

func (data_h DataHandler) GetTopBaseMatch(query_base string) (string, bool, error)

GetTopBaseMatch will return the matching path with the highest score.

func (DataHandler) GetTopPrefixBaseMatch

func (data_h DataHandler) GetTopPrefixBaseMatch(query_prefix, query_base string) (string, bool, error)

func (DataHandler) ListPaths

func (data_h DataHandler) ListPaths(descending bool, scores bool) (string, error)

ListPaths list the paths ordered using their scores and the `descending` flag.

func (DataHandler) Size

func (data_h DataHandler) Size() uint

Size returns the number of rows to the table

func (DataHandler) UpdatePath

func (data_h DataHandler) UpdatePath(path string)

UpdatePath updates the table given a `path`. This should increase the score of `path` and decrease the score of all other paths.

The home directory will be ignored.

Jump to

Keyboard shortcuts

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