node

package
v0.0.0-...-ba2758a Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	Code   int
	Value  int
	Vector []float64
	// contains filtered or unexported fields
}

Node stores the node with vector in huffman tree.

func (*Node) GetPath

func (n *Node) GetPath() Nodes

GetPath returns the nodes from root to word on huffman tree.

type Nodes

type Nodes []*Node

Nodes is the list of Node.

func (*Nodes) Build

func (n *Nodes) Build(dimension int) error

Build builds huffman tree based on word frequencies.

func (*Nodes) Len

func (n *Nodes) Len() int

func (*Nodes) Less

func (n *Nodes) Less(i, j int) bool

func (*Nodes) Swap

func (n *Nodes) Swap(i, j int)

Jump to

Keyboard shortcuts

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