Package trie implements a byte trie with edge compression.
Package trie is a pointer based Trie implementation. Since 0.1.0
Go Implementation of a Thread Safe Trie Data Structure and (some of) Trie Operations
Package trie implements several types of performant Tries (e.g. rune-wise, path-wise). The implementations are optimized for Get performance and to allocate 0 bytes of heap memory (i.e. garbage) per Get. The Tries do not synchronize access (not thread-safe). A typical use case is to perform Puts and Deletes upfront to populate the Trie, then perform Gets very quickly.
Package trie implements several types of performant Tries (e.g. rune-wise, path-wise). The implementations are optimized for Get performance and to allocate 0 bytes of heap memory (i.e. garbage) per Get. The Tries do not synchronize access (not thread-safe). A typical use case is to perform Puts and Deletes upfront to populate the Trie, then perform Gets very quickly.
Package triegen implements a code generator for a trie for associating unsigned integer values with UTF-8 encoded runes. Many of the go.text packages use tries for storing per-rune information. A trie is especially useful if many of the runes have the same value. If this is the case, many blocks can be expected to be shared allowing for information on many runes to be stored in little space. As most of the lookups are done directly on []byte slices, the tries use the UTF-8 bytes directly for the lookup. This saves a conversion from UTF-8 to runes and contributes a little bit to better performance. It also naturally provides a fast path for ASCII. Space is also an issue. There are many code points defined in Unicode and as a result tables can get quite large. So every byte counts. The triegen package automatically chooses the smallest integer values to represent the tables. Compacters allow further compression of the trie by allowing for alternative representations of individual trie blocks. triegen allows generating multiple tries as a single structure. This is useful when, for example, one wants to generate tries for several languages that have a lot of values in common. Some existing libraries for internationalization store all per-language data as a dynamically loadable chunk. The go.text packages are designed with the assumption that the user typically wants to compile in support for all supported languages, in line with the approach common to Go to create a single standalone binary. The multi-root trie approach can give significant storage savings in this scenario. triegen generates both tables and code. The code is optimized to use the automatically chosen data types. The following code is generated for a Trie or multiple Tries named "foo": type fooTrie The trie type. func newFooTrie(x int) *fooTrie Trie constructor, where x is the index of the trie passed to Gen. func (t *fooTrie) lookup(s []byte) (v uintX, sz int) The lookup method, where uintX is automatically chosen. func lookupString, lookupUnsafe and lookupStringUnsafe Variants of the above. var fooValues and fooIndex and any tables generated by Compacters. The core trie data. var fooTrieHandles Indexes of starter blocks in case of multiple trie roots. It is recommended that users test the generated trie by checking the returned value for every rune. Such exhaustive tests are possible as the the number of runes in Unicode is limited. Example_build shows how to build a simple trie. It assigns the value 1 to 100 random runes generated by randomRunes. Example_lookup demonstrates how to use the trie generated by Example_build.
Package trie implements several types of performant Tries (e.g. rune-wise, path-wise). The implementations are optimized for Get performance and to allocate 0 bytes of heap memory (i.e. garbage) per Get. The Tries do not synchronize access (not thread-safe). A typical use case is to perform Puts and Deletes upfront to populate the Trie, then perform Gets very quickly.
Implementation of an R-Way Trie data structure. A Trie has a root Node which is the base of the tree. Each subsequent Node has a letter and children, which are nodes that have letter values associated with them.
Package trie implements trie tree (or prefix tree) data structure useful for things like prefix search/autocompletion. For now, it supports Insert, HasWord, HasPrefix and WordsByPrefix methods.
Package trie implements several types of performant Tries (e.g. rune-wise, path-wise). The implementations are optimized for Get performance and to allocate 0 bytes of heap memory (i.e. garbage) per Get. The Tries do not synchronize access (not thread-safe). A typical use case is to perform Puts and Deletes upfront to populate the Trie, then perform Gets very quickly.
Package gtrie is an implementation of an R-Way Trie value structure. This package supports more useful functions based on derekparker/trie (https://godoc.org/github.com/derekparker/trie). A Trie has a root trieNode which is the base of the tree. Each subsequent trieNode has a letter and children, which are nodes that have letter values associated with them.
Package trie implements several types of performant Tries (e.g. rune-wise, path-wise). The implementations are optimized for Get performance and to allocate 0 bytes of heap memory (i.e. garbage) per Get. The Tries do not synchronize access (not thread-safe). A typical use case is to perform Puts and Deletes upfront to populate the Trie, then perform Gets very quickly.
Implementation of an R-Way Trie data structure. A Trie has a root Node which is the base of the tree. Each subsequent Node has a letter and children, which are nodes that have letter values associated with them.
Package trie contains a primitive implementation of the Trie data structure. Copyright 2017 Aleksandr Bezobchuk.
Package trie provides a data structure for autocompletion searching of strings.
Package trie implements a thread-safe trie, also known as digital tree or prefix tree. It can be used as a drop-in replacement for usual Go maps with string keys.
Package trie implements a search tree that stores strings that can be searched by a prefix. This would generally be used for an autocomplete feature where a input would return likely matches. Both reads and write are thread safe; however, one one write may occur at any one time. Concurrent reads are not constrained. Usage would start by creating the Trie The main use case is for autocomplete. The Trie contains potential words, and a prefix is supplied to the Like() method. All the words that start with the prefix are returned as a slice. You may specify the number of words you want returned. The Trie starts empty, so you would need to populate it to get any value back. You may add new strings to the Trie by invoking Insert(). Subsequent inserts of the same string to the Trie will not increase the memory space, only the existence of the word will be stored. You may check whether the word exists in the Trie by invoking Contains(). Trie stores all strings as lowercase. Asking whether a Trie contains "foobar" or "FOOBAR" would yield the same results. You may see how many unique words are stored in the Trie by invoking Count(). If you need to remove a word from the Trie, invoke Remove().
Trie is a prefix index package for golang. Branch - A Branch might have a LeafValue or not and might have other Branches splitting off. It has a flag `End` that marks the end of a term that has been inserted. Entry - an entry refers to a _complete_ term that is inserted, removed from, or matched in the index. It requires `End` on the Branch to be set to `true`, which makes it different from a Prefix - which does not require the Branch to have End set to `true` to match.
Package trie implements several types of performant Tries (e.g. rune-wise, path-wise). The implementations are optimized for Get performance and to allocate 0 bytes of heap memory (i.e. garbage) per Get. The Tries do not synchronize access (not thread-safe). A typical use case is to perform Puts and Deletes upfront to populate the Trie, then perform Gets very quickly.
Implementation of an R-Way Trie data structure. A Trie has a root Node which is the base of the tree. Each subsequent Node has a letter and children, which are nodes that have letter values associated with them.
Package trie implements several types of performant Tries (e.g. rune-wise, path-wise). The implementations are optimized for Get performance and to allocate 0 bytes of heap memory (i.e. garbage) per Get. The Tries do not synchronize access (not thread-safe). A typical use case is to perform Puts and Deletes upfront to populate the Trie, then perform Gets very quickly.
Implementation of an R-Way Trie data structure. A Trie has a root Node which is the base of the tree. Each subsequent Node has a letter and children, which are nodes that have letter values associated with them.