trie

package
v0.0.0-...-300735a Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: MPL-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BitsSetTable256 [256]int
View Source
var Debug = false
View Source
var L1 = 32 * 32
View Source
var L2 = 32
View Source
var MaskBottom = make(map[int][]uint16)
View Source
var MaskTop = make(map[int][]uint16)
View Source
var W = 16

Functions

func Bit0

func Bit0(n int, p int, pad int) int

func CHR16

func CHR16(charcode int) string

func CountSetBits

func CountSetBits(n int) int

func DEC16

func DEC16(str string, index int) int

func Find_Lista_Listb

func Find_Lista_Listb(list1 []string, list2 []string) (bool, []string)

func FlagSubstring

func FlagSubstring(str string, si int, ei int) string

func Flag_to_uint

func Flag_to_uint(str string) []uint32

func MD5Hex

func MD5Hex(b *[]byte) string

from: stackoverflow.com/a/25286918

func TxtEncode

func TxtEncode(str string) ([]uint8, error)

Types

type BStr

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

func NewBStr

func NewBStr(str *[]uint16) *BStr

func (*BStr) Size

func (bs *BStr) Size() int

type Cache

type Cache struct {
	// If len > UpperBound, cache will automatically evict
	// down to LowerBound.  If either value is 0, this behavior
	// is disabled.
	UpperBound int
	LowerBound int

	EvictionChannel chan<- Eviction
	// contains filtered or unexported fields
}

func (*Cache) Evict

func (c *Cache) Evict(count int) int

func (*Cache) Get

func (c *Cache) Get(key string) interface{}

func (*Cache) Len

func (c *Cache) Len() int

func (*Cache) Set

func (c *Cache) Set(key string, value interface{})

type Eviction

type Eviction struct {
	Key   string
	Value interface{}
}

type FrozenTrie

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

func Build

func Build(tdpath, rdpath, bcpath, ftpath string) (ftrie *FrozenTrie, err error)

func NewFrozenTrie

func NewFrozenTrie(td *BStr, rdir *RankDirectory, nodeCount int, tagfile string) *FrozenTrie

func (*FrozenTrie) CreateUrlEncodedflag

func (ft *FrozenTrie) CreateUrlEncodedflag(fl []string) string

func (*FrozenTrie) DNlookup

func (ft *FrozenTrie) DNlookup(dn string, usr_flag string) (bool, []string)

func (*FrozenTrie) FlagstoTag

func (ft *FrozenTrie) FlagstoTag(flags []uint32) []string

func (*FrozenTrie) LoadTag

func (ft *FrozenTrie) LoadTag(filepath string) error

func (*FrozenTrie) Lookup

func (ft *FrozenTrie) Lookup(word []uint8) (bool, []uint32)

func (*FrozenTrie) Sizes

func (f *FrozenTrie) Sizes() string

func (*FrozenTrie) Urlenc_to_flag

func (ft *FrozenTrie) Urlenc_to_flag(str string) []string

type FrozenTrieNode

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

func NewFrozenTrieNode

func NewFrozenTrieNode(ft *FrozenTrie, index int) *FrozenTrieNode

func (*FrozenTrieNode) String

func (ftn *FrozenTrieNode) String() string

type RankDirectory

type RankDirectory struct {
	Directory *BStr
	Data      *BStr
	// contains filtered or unexported fields
}

func NewRankDir

func NewRankDir(rd, td *BStr, numBits int, l1Size int, l2Size int) *RankDirectory

Jump to

Keyboard shortcuts

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