Documentation ¶
Index ¶
- type DataHandler
- func (data_h DataHandler) CreateTable() error
- func (data_h DataHandler) DropTable() error
- func (data_h DataHandler) GetTopBaseMatch(query_base string) (string, bool, error)
- func (data_h DataHandler) GetTopPrefixBaseMatch(query_prefix, query_base string) (string, bool, error)
- func (data_h DataHandler) ListPaths(descending bool, scores bool) (string, error)
- func (data_h DataHandler) Size() uint
- func (data_h DataHandler) UpdatePath(path string)
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.
Click to show internal directories.
Click to hide internal directories.