da

package module
v0.0.0-...-14771aa Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2018 License: Apache-2.0 Imports: 8 Imported by: 56

README

da - A Double Array Trie package for Dicts

GoDocGo Report Card

Based on cedar.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dict

type Dict struct {
	Trie   *cedar.Cedar
	Values [][]string
}

Dict contains the Trie and dict values

func Build

func Build(in io.Reader) (*Dict, error)

Build da dict from io.Reader

func BuildFromFile

func BuildFromFile(fileName string) (*Dict, error)

BuildFromFile builds the da dict from fileName

func Load

func Load(dir string) (*Dict, error)

Load gob serialized dict from dir

func (*Dict) Get

func (d *Dict) Get(str string) ([]string, error)

Get the values of str, like map

func (*Dict) PrefixMatch

func (d *Dict) PrefixMatch(str string) (map[string][]string, error)

PrefixMatch str by Dict, returns the matched string and its according values

func (*Dict) Save

func (d *Dict) Save(dir string) error

Save gob serialized dict to dir

Jump to

Keyboard shortcuts

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