file

package
v0.0.0-...-51c18d2 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIndexedURLs

func GetIndexedURLs(fpath string) ([]string, error)

GetIndexedURLs returns the indexed urls

func GetIndexedURLsGOB

func GetIndexedURLsGOB(fpath string) ([]string, error)

GetIndexedURLsGOB reads the gobified document data

Types

type ScoreData

type ScoreData struct {
	Index int
	Score float32
}

ScoreData stores the scores and indexes for a single query term

type WordData

type WordData struct {
	Data map[string][]ScoreData
}

WordData An abstraction layer for word score data

func LoadData

func LoadData(path string) (WordData, error)

LoadData loads the word data

func LoadWordDataGOB

func LoadWordDataGOB(path string) (WordData, error)

LoadWordDataGOB loads the data gob from a file

func (*WordData) GetScores

func (w *WordData) GetScores(word string) []ScoreData

GetScores gets the scores for a given word

func (*WordData) InsertScores

func (w *WordData) InsertScores(word string, scoreData []ScoreData)

InsertScores inserts the scores for a given word

func (*WordData) NewWordData

func (w *WordData) NewWordData()

NewWordData creates the memory for use by the struct

func (*WordData) SaveToGOB

func (w *WordData) SaveToGOB(fname string)

SaveToGOB save the data structure

Jump to

Keyboard shortcuts

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