Versions in this module Expand all Collapse all v1 v1.0.1 Jan 13, 2022 v1.0.0 Mar 23, 2018 Changes in this version + func Add(e Expr, weight float32, words []string) + func AddWeight(e Expr, weights []float32, words []string) + func MultiCosN(m *Model, exprs []Expr, n int) ([][]Match, error) + func NewServer(c Coser) http.Handler + type Client struct + Addr string + func (c Client) Cos(x, y Expr) (float32, error) + func (c Client) CosN(e Expr, n int) ([]Match, error) + func (c Client) Coses(pairs [][2]Expr) ([]float32, error) + type Coser interface + Cos func(e, f Expr) (float32, error) + CosN func(e Expr, n int) ([]Match, error) + Coses func(pairs [][2]Expr) ([]float32, error) + func NewCache(c Coser) Coser + type Expr map[string]float32 + func (e Expr) Add(weight float32, word string) + func (e Expr) Eval(m *Model) (Vector, error) + type Mapper interface + Map func(words []string) map[string]Vector + type Match struct + Score float32 + Word string + type Model struct + func FromReader(r io.Reader) (*Model, error) + func (m *Model) Cos(a, b Expr) (float32, error) + func (m *Model) CosN(e Expr, n int) ([]Match, error) + func (m *Model) Coses(pairs [][2]Expr) ([]float32, error) + func (m *Model) Dim() int + func (m *Model) Eval(expr Expr) (Vector, error) + func (m *Model) Map(words []string) map[string]Vector + func (m *Model) Size() int + type NotFoundError struct + Word string + func (e NotFoundError) Error() string + type Vector []float32 + func (v Vector) Add(a float32, u Vector) + func (v Vector) Dot(u Vector) float32 + func (v Vector) Norm() float32 + func (v Vector) Normalise()