public class CharTrieIndex extends CharTrie
Modifier and Type | Field and Description |
---|---|
protected SerialArrayList<com.simiacryptus.text.CursorData> |
cursors
The Cursors.
|
protected ArrayList<CharSequence> |
documents
The Documents.
|
godparentIndex, nodes, parentIndex
Constructor and Description |
---|
CharTrieIndex()
Instantiates a new Char trie index.
|
CharTrieIndex(CharTrieIndex copyFrom)
Instantiates a new Char trie index.
|
Modifier and Type | Method and Description |
---|---|
CharTrie |
addAlphabet(CharSequence document)
Add alphabet char trie.
|
int |
addDictionary(CharSequence document)
Adds a document to be indexed.
|
int |
addDocument(CharSequence document)
Adds a document to be indexed.
|
CharTrieIndex |
copy()
Copy char trie.
|
long |
getIndexedSize()
Gets indexed size.
|
int |
getMemorySize()
Gets memory size.
|
CharTrieIndex |
index()
Creates the index tree using the accumulated documents
|
CharTrieIndex |
index(int maxLevels)
Creates the index tree using the accumulated documents
|
CharTrieIndex |
index(int maxLevels,
int minWeight)
Creates the index tree using the accumulated documents
|
static CharTrie |
indexFulltext(Collection<CharSequence> documents,
int maxLevels,
int minWeight)
Index fulltext char trie.
|
static CharTrie |
indexWords(Collection<CharSequence> documents,
int maxLevels,
int minWeight)
Index words char trie.
|
IndexNode |
root()
Root trie node.
|
IndexNode |
traverse(String search)
Locate a node by finding the maximum prefix match apply the given string
|
CharTrie |
truncate()
Removes cursor data, retaining only the tree of tokens and counts.
|
add, contains, divide, equals, getAnalyzer, getCodec, getGenerator, getNodeCount, hashCode, matchEnd, matchPredictor, max, product, reduce, reducer, reduceSimple, reverse, rewrite, tokens
protected final SerialArrayList<com.simiacryptus.text.CursorData> cursors
protected final ArrayList<CharSequence> documents
public CharTrieIndex(CharTrieIndex copyFrom)
copyFrom
- the copy frompublic CharTrieIndex()
public static CharTrie indexWords(Collection<CharSequence> documents, int maxLevels, int minWeight)
documents
- the documentsmaxLevels
- the max levelsminWeight
- the min weightpublic static CharTrie indexFulltext(Collection<CharSequence> documents, int maxLevels, int minWeight)
documents
- the documentsmaxLevels
- the max levelsminWeight
- the min weightpublic int getMemorySize()
CharTrie
getMemorySize
in class CharTrie
public long getIndexedSize()
CharTrie
getIndexedSize
in class CharTrie
public CharTrie truncate()
public CharTrieIndex index()
public CharTrieIndex index(int maxLevels)
maxLevels
- - Maximum depth of the tree to buildpublic CharTrieIndex index(int maxLevels, int minWeight)
maxLevels
- - Maximum depth of the tree to buildminWeight
- - Minimum number of cursors for a node to be index using, exclusive boundpublic int addDictionary(CharSequence document)
document
- the documentpublic int addDocument(CharSequence document)
document
- the documentpublic CharTrie addAlphabet(CharSequence document)
document
- the documentpublic CharTrieIndex copy()
CharTrie
Copyright © 2019 SimiaCryptus Software. All rights reserved.