dawg

package
v0.0.0-...-d85e760 Latest Latest
Warning

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

Go to latest
Published: May 30, 2017 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BytesDAWG

type BytesDAWG struct {
	CompletionDAWG
}

BytesDAWG - DAWG that is able to transparently store extra binary payload in keys; there may be several payloads for the same key. In other words, this class implements read-only DAWG-based {unicode -> list of bytes objects} mapping.

func NewBytesDAWG

func NewBytesDAWG() *BytesDAWG

NewBytesDAWG - constructor for BytesDAWG

func (*BytesDAWG) Contains

func (d *BytesDAWG) Contains(key string) bool

Contains ...

func (*BytesDAWG) Get

func (d *BytesDAWG) Get(key string) ([][]byte, bool)

Get - Returns a list of payloads (as byte objects) for a given key

func (*BytesDAWG) Items

func (d *BytesDAWG) Items(prefix string) []std.StrBytes

Items ...

func (*BytesDAWG) Keys

func (d *BytesDAWG) Keys(prefix string) []string

Keys ...

type Completer

type Completer struct {
	// contains filtered or unexported fields
}

Completer ...

func NewCompleter

func NewCompleter(dic *Dictionary, guide *Guide) *Completer

NewCompleter - constructor for Completer

type CompletionDAWG

type CompletionDAWG struct {
	DAWG
	// contains filtered or unexported fields
}

CompletionDAWG - DAWG with key completion support.

func NewCompletionDAWG

func NewCompletionDAWG() *CompletionDAWG

NewCompletionDAWG - constructor for CompletionDAWG

func (*CompletionDAWG) Keys

func (d *CompletionDAWG) Keys(prefix string) []string

Keys ...

func (*CompletionDAWG) Load

func (d *CompletionDAWG) Load(path string) error

Load - Loads DAWG from a file.

type DAWG

type DAWG struct {
	// contains filtered or unexported fields
}

DAWG - Base DAWG wrapper.

func NewDAWG

func NewDAWG() *DAWG

NewDAWG - constructor for DAWG

func (*DAWG) Contains

func (d *DAWG) Contains(key string) bool

Contains - Exact matching.

func (*DAWG) InitVTable

func (d *DAWG) InitVTable(vDAWG virtDAWG)

InitVTable - Init vDAWG.

func (*DAWG) Load

func (d *DAWG) Load(path string) error

Load - Loads DAWG from a file.

func (*DAWG) Prefixes

func (d *DAWG) Prefixes(key string) []string

Prefixes - Returns a list with keys of this DAWG that are prefixes of the 'key'.

func (*DAWG) SimilarKeys

func (d *DAWG) SimilarKeys(key string, replaceChars map[rune]rune) []string

SimilarKeys - Returns all variants of 'key' in this DAWG according to 'replaces'. This may be useful e.g. for handling single-character umlauts.

type Dictionary

type Dictionary struct {
	// contains filtered or unexported fields
}

Dictionary - class for retrieval and binary I/O.

func NewDictionary

func NewDictionary() *Dictionary

NewDictionary - constructor for Dictionary

func (*Dictionary) Contains

func (d *Dictionary) Contains(key []byte) bool

Contains - Exact matching.

func (*Dictionary) Find

func (d *Dictionary) Find(key []byte) (uint32, bool)

Find - Exact matching (returns value)

func (*Dictionary) Read

func (d *Dictionary) Read(buf io.Reader) error

read - Reads a dictionary from an input stream.

type Guide

type Guide struct {
	// contains filtered or unexported fields
}

Guide ...

func NewGuide

func NewGuide() *Guide

NewGuide - constructor for Guide

type IntCompletionDAWG

type IntCompletionDAWG struct {
	DAWG
	CompletionDAWG
}

IntCompletionDAWG - Dict-like class based on DAWG. It can store integer values for unicode keys and support key completion.

func NewIntCompletionDAWG

func NewIntCompletionDAWG() *IntCompletionDAWG

NewIntCompletionDAWG - constructor for IntCompletionDAWG

func (*IntCompletionDAWG) Get

func (d *IntCompletionDAWG) Get(key string) (uint32, bool)

Get - Return value for the given key.

func (*IntCompletionDAWG) Items

func (d *IntCompletionDAWG) Items(prefix string) []std.StrUint32

Items ...

func (*IntCompletionDAWG) Load

func (d *IntCompletionDAWG) Load(path string) error

Load ...

type RecordDAWG

type RecordDAWG struct {
	BytesDAWG
	// contains filtered or unexported fields
}

RecordDAWG ...

func NewRecordDAWG

func NewRecordDAWG(fmt uint8, order binary.ByteOrder) *RecordDAWG

NewRecordDAWG - constructor for RecordDAWG

func (*RecordDAWG) Get

func (d *RecordDAWG) Get(key string) ([][]uint16, bool)

Get - Returns a list of payloads (as uint16 objects) for a given key

func (*RecordDAWG) Items

func (d *RecordDAWG) Items(prefix string) []std.StrUints16

Items ...

func (*RecordDAWG) SimilarItems

func (d *RecordDAWG) SimilarItems(key string, replaceChars map[rune]rune) []std.StrUints16Arr

SimilarItems - Returns a list of (key, value) tuples for all variants of 'key' in this DAWG according to 'replaces'.

func (*RecordDAWG) SimilarItemsValues

func (d *RecordDAWG) SimilarItemsValues(key string, replaceChars map[rune]rune) [][][]uint16

SimilarItemsValues - Returns a list of values tuples for all variants of 'key' in this DAWG according to 'replaces'.

Jump to

Keyboard shortcuts

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