hash

package
v0.0.0-...-5fecf9c Latest Latest
Warning

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

Go to latest
Published: May 11, 2016 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NGrams

func NGrams(tokens []string, minN, maxN int) []uint32

Returns hashes of all N-grams in tokens with minN ≤ N ≤ maxN.

The hash of an N-gram is the hash of the tokens, joined by NUL characters. We assume these don't occur in text. The hash function used is FNV-32.

Types

type HashPos

type HashPos struct {
	Hash       uint32
	Start, End int
}

Hash of n-gram at position Start through End (exclusive) in the input.

The length of input n-gram is (End-Start).

func NGramsPos

func NGramsPos(tokens []string, maxN int) []HashPos

Like NGrams, but returns position info and minN is hardcoded to one.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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