C# Class Lucene.Net.Search.Suggest.Tst.TSTAutocomplete

Ternary Search Trie implementation.
Afficher le fichier Open project: apache/lucenenet

Méthodes publiques

Méthode Description
BalancedTree ( object tokens, object vals, int lo, int hi, TernaryTreeNode root ) : void

Inserting keys in TST in the order middle,small,big (lexicographic measure) recursively creates a balanced tree which reduces insertion and search times significantly.

Insert ( TernaryTreeNode currentNode, string s, object val, int x ) : TernaryTreeNode

Inserts a key in TST creating a series of Binary Search Trees at each node. The key is actually stored across the eqKid of each node in a successive manner.

PrefixCompletion ( TernaryTreeNode root, string s, int x ) : List

Auto-completes a given prefix query using Depth-First Search with the end of prefix as source node each time finding a new leaf to get a complete key to be added in the suggest list.

Private Methods

Méthode Description
TSTAutocomplete ( ) : System.Collections.Generic

Method Details

BalancedTree() public méthode

Inserting keys in TST in the order middle,small,big (lexicographic measure) recursively creates a balanced tree which reduces insertion and search times significantly.
public BalancedTree ( object tokens, object vals, int lo, int hi, TernaryTreeNode root ) : void
tokens object /// Sorted list of keys to be inserted in TST.
vals object
lo int /// stores the lower index of current list.
hi int /// stores the higher index of current list.
root TernaryTreeNode /// a reference object to root of TST.
Résultat void

Insert() public méthode

Inserts a key in TST creating a series of Binary Search Trees at each node. The key is actually stored across the eqKid of each node in a successive manner.
public Insert ( TernaryTreeNode currentNode, string s, object val, int x ) : TernaryTreeNode
currentNode TernaryTreeNode /// a reference node where the insertion will take currently.
s string /// key to be inserted in TST.
val object
x int /// index of character in key to be inserted currently.
Résultat TernaryTreeNode

PrefixCompletion() public méthode

Auto-completes a given prefix query using Depth-First Search with the end of prefix as source node each time finding a new leaf to get a complete key to be added in the suggest list.
public PrefixCompletion ( TernaryTreeNode root, string s, int x ) : List
root TernaryTreeNode /// a reference to root node of TST.
s string /// prefix query to be auto-completed.
x int /// index of current character to be searched while traversing through /// the prefix in TST.
Résultat List