go-morphy: github.com/ReanGD/go-morphy/dawg Index | Files

package dawg

import "github.com/ReanGD/go-morphy/dawg"

Index

Package Files

bytes_dawg.go completer.go completion_dawg.go dawg.go dictionary.go guide.go int_completion_dawg.go record_dawg.go units.go

type BytesDAWG Uses

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 Uses

func NewBytesDAWG() *BytesDAWG

NewBytesDAWG - constructor for BytesDAWG

func (*BytesDAWG) Contains Uses

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

Contains ...

func (*BytesDAWG) Get Uses

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

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

func (*BytesDAWG) Items Uses

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

Items ...

func (*BytesDAWG) Keys Uses

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

Keys ...

type Completer Uses

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

Completer ...

func NewCompleter Uses

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

NewCompleter - constructor for Completer

type CompletionDAWG Uses

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

CompletionDAWG - DAWG with key completion support.

func NewCompletionDAWG Uses

func NewCompletionDAWG() *CompletionDAWG

NewCompletionDAWG - constructor for CompletionDAWG

func (*CompletionDAWG) Keys Uses

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

Keys ...

func (*CompletionDAWG) Load Uses

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

Load - Loads DAWG from a file.

type DAWG Uses

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

DAWG - Base DAWG wrapper.

func NewDAWG Uses

func NewDAWG() *DAWG

NewDAWG - constructor for DAWG

func (*DAWG) Contains Uses

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

Contains - Exact matching.

func (*DAWG) InitVTable Uses

func (d *DAWG) InitVTable(vDAWG virtDAWG)

InitVTable - Init vDAWG.

func (*DAWG) Load Uses

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

Load - Loads DAWG from a file.

func (*DAWG) Prefixes Uses

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 Uses

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 Uses

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

Dictionary - class for retrieval and binary I/O.

func NewDictionary Uses

func NewDictionary() *Dictionary

NewDictionary - constructor for Dictionary

func (*Dictionary) Contains Uses

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

Contains - Exact matching.

func (*Dictionary) Find Uses

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

Find - Exact matching (returns value)

func (*Dictionary) Read Uses

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

read - Reads a dictionary from an input stream.

type Guide Uses

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

Guide ...

func NewGuide Uses

func NewGuide() *Guide

NewGuide - constructor for Guide

type IntCompletionDAWG Uses

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 Uses

func NewIntCompletionDAWG() *IntCompletionDAWG

NewIntCompletionDAWG - constructor for IntCompletionDAWG

func (*IntCompletionDAWG) Get Uses

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

Get - Return value for the given key.

func (*IntCompletionDAWG) Items Uses

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

Items ...

func (*IntCompletionDAWG) Load Uses

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

Load ...

type RecordDAWG Uses

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

RecordDAWG ...

func NewRecordDAWG Uses

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

NewRecordDAWG - constructor for RecordDAWG

func (*RecordDAWG) Get Uses

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

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

func (*RecordDAWG) Items Uses

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

Items ...

func (*RecordDAWG) SimilarItems Uses

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 Uses

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'.

Package dawg imports 7 packages (graph) and is imported by 1 packages. Updated 2018-04-02. Refresh now. Tools for package owners.