public class CharTrie extends Object
Modifier and Type | Field and Description |
---|---|
protected int[] |
godparentIndex
The Godparent index.
|
protected SerialArrayList<com.simiacryptus.text.NodeData> |
nodes
The Nodes.
|
protected int[] |
parentIndex
The Parent index.
|
Constructor and Description |
---|
CharTrie()
Instantiates a new Char trie.
|
CharTrie(CharTrie charTrie)
Instantiates a new Char trie.
|
CharTrie(SerialArrayList<com.simiacryptus.text.NodeData> nodes)
Instantiates a new Char trie.
|
Modifier and Type | Method and Description |
---|---|
CharTrie |
add(CharTrie z)
Add char trie.
|
boolean |
contains(String text)
Contains boolean.
|
CharTrie |
copy()
Copy char trie.
|
CharTrie |
divide(CharTrie z,
int factor)
Divide char trie.
|
boolean |
equals(Object o) |
TextAnalysis |
getAnalyzer()
Gets analyzer.
|
NodewalkerCodec |
getCodec()
Gets codec.
|
TextGenerator |
getGenerator()
Gets generator.
|
long |
getIndexedSize()
Gets indexed size.
|
int |
getMemorySize()
Gets memory size.
|
int |
getNodeCount()
Gets node count.
|
int |
hashCode() |
TrieNode |
matchEnd(String search)
Match end trie node.
|
TrieNode |
matchPredictor(String search)
Match predictor trie node.
|
<T extends Comparable<T>> |
max(Function<TrieNode,T> fn,
int maxResults)
Max stream.
|
CharTrie |
product(CharTrie z)
Product char trie.
|
CharTrie |
reduce(CharTrie right,
BiFunction<TrieNode,TrieNode,TreeMap<Character,Long>> fn)
Reduce char trie.
|
static BiFunction<CharTrie,CharTrie,CharTrie> |
reducer(BiFunction<TrieNode,TrieNode,TreeMap<Character,Long>> fn)
Reducer bi function.
|
CharTrie |
reduceSimple(CharTrie z,
BiFunction<Long,Long,Long> fn)
Reduce simple char trie.
|
CharTrie |
reverse()
Reverse char trie.
|
CharTrie |
rewrite(BiFunction<TrieNode,Map<Character,TrieNode>,TreeMap<Character,Long>> fn)
Rewrite char trie.
|
TrieNode |
root()
Root trie node.
|
Set<Character> |
tokens()
Tokens set.
|
TrieNode |
traverse(String search)
Locate a node by finding the maximum prefix match apply the given string
|
protected CharTrie |
truncate()
Truncate char trie.
|
protected final SerialArrayList<com.simiacryptus.text.NodeData> nodes
protected int[] parentIndex
protected int[] godparentIndex
public CharTrie(SerialArrayList<com.simiacryptus.text.NodeData> nodes)
nodes
- the nodespublic CharTrie()
public CharTrie(CharTrie charTrie)
charTrie
- the char triepublic static BiFunction<CharTrie,CharTrie,CharTrie> reducer(BiFunction<TrieNode,TrieNode,TreeMap<Character,Long>> fn)
fn
- the fnpublic TrieNode root()
public CharTrie reverse()
public CharTrie rewrite(BiFunction<TrieNode,Map<Character,TrieNode>,TreeMap<Character,Long>> fn)
fn
- the fnpublic CharTrie product(CharTrie z)
z
- the zpublic CharTrie divide(CharTrie z, int factor)
z
- the zfactor
- the factorpublic CharTrie reduceSimple(CharTrie z, BiFunction<Long,Long,Long> fn)
z
- the zfn
- the fnpublic CharTrie reduce(CharTrie right, BiFunction<TrieNode,TrieNode,TreeMap<Character,Long>> fn)
right
- the rightfn
- the fnpublic TrieNode traverse(String search)
search
- the searchpublic int getNodeCount()
public TrieNode matchEnd(String search)
search
- the searchpublic TrieNode matchPredictor(String search)
search
- the searchpublic CharTrie copy()
public int getMemorySize()
public long getIndexedSize()
public NodewalkerCodec getCodec()
public TextGenerator getGenerator()
public TextAnalysis getAnalyzer()
protected CharTrie truncate()
public boolean contains(String text)
text
- the textpublic <T extends Comparable<T>> Stream<TrieNode> max(Function<TrieNode,T> fn, int maxResults)
T
- the type parameterfn
- the fnmaxResults
- the max resultsCopyright © 2019 SimiaCryptus Software. All rights reserved.