Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class TSTAutocomplete

    Ternary Search Trie implementation.

    Inheritance
    object
    TSTAutocomplete
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Search.Suggest.Tst
    Assembly: Lucene.Net.Suggest.dll
    Syntax
    public class TSTAutocomplete

    Methods

    BalancedTree(object[], object[], int, int, TernaryTreeNode)

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

    Declaration
    public virtual void BalancedTree(object[] tokens, object[] vals, int lo, int hi, TernaryTreeNode root)
    Parameters
    Type Name Description
    object[] tokens

    Sorted list of keys to be inserted in TST.

    object[] vals
    int lo

    stores the lower index of current list.

    int hi

    stores the higher index of current list.

    TernaryTreeNode root

    a reference object to root of TST.

    See Also
    TernaryTreeNode

    Insert(TernaryTreeNode, string, object, int)

    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.

    Declaration
    public virtual TernaryTreeNode Insert(TernaryTreeNode currentNode, string s, object val, int x)
    Parameters
    Type Name Description
    TernaryTreeNode currentNode

    a reference node where the insertion will take currently.

    string s

    key to be inserted in TST.

    object val
    int x

    index of character in key to be inserted currently.

    Returns
    Type Description
    TernaryTreeNode

    The new reference to root node of TST

    See Also
    TernaryTreeNode

    PrefixCompletion(TernaryTreeNode, string, int)

    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.

    Declaration
    public virtual IList<TernaryTreeNode> PrefixCompletion(TernaryTreeNode root, string s, int x)
    Parameters
    Type Name Description
    TernaryTreeNode root

    a reference to root node of TST.

    string s

    prefix query to be auto-completed.

    int x

    index of current character to be searched while traversing through the prefix in TST.

    Returns
    Type Description
    IList<TernaryTreeNode>

    suggest list of auto-completed keys for the given prefix query.

    See Also
    TernaryTreeNode

    See Also

    TernaryTreeNode
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.