Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class Trie

    A Trie is used to store a dictionary of words and their stems.

    Actually, what is stored are words with their respective patch commands. A trie can be termed forward (keys read from left to right) or backward (keys read from right to left). This property will vary depending on the language for which a Trie is constructed.

    Inheritance
    System.Object
    Trie
    MultiTrie
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Egothor.Stemmer
    Assembly: Lucene.Net.Analysis.Stempel.dll
    Syntax
    public class Trie

    Constructors

    | Improve this Doc View Source

    Trie(IDataInput)

    Constructor for the Trie object.

    Declaration
    public Trie(IDataInput is)
    Parameters
    Type Name Description
    J2N.IO.IDataInput is

    the input stream

    Exceptions
    Type Condition
    System.IO.IOException

    if an I/O error occurs

    | Improve this Doc View Source

    Trie(Boolean)

    Constructor for the Trie object.

    Declaration
    public Trie(bool forward)
    Parameters
    Type Name Description
    System.Boolean forward

    set to true

    | Improve this Doc View Source

    Trie(Boolean, Int32, IList<String>, IList<Row>)

    Constructor for the Trie object.

    Declaration
    public Trie(bool forward, int root, IList<string> cmds, IList<Row> rows)
    Parameters
    Type Name Description
    System.Boolean forward

    true if read left to right, false if read right to left

    System.Int32 root

    index of the row that is the root node

    System.Collections.Generic.IList<System.String> cmds

    the patch commands to store

    System.Collections.Generic.IList<Row> rows

    a Vector of Vectors. Each inner Vector is a node of this Trie

    Methods

    | Improve this Doc View Source

    Add(String, String)

    Add the given key associated with the given patch command. If either parameter is null this method will return without executing.

    Declaration
    public virtual void Add(string key, string cmd)
    Parameters
    Type Name Description
    System.String key

    the key

    System.String cmd

    the patch command

    | Improve this Doc View Source

    GetAll(String)

    Gets the all attribute of the Trie object

    Declaration
    public virtual string[] GetAll(string key)
    Parameters
    Type Name Description
    System.String key

    Description of the Parameter

    Returns
    Type Description
    System.String[]

    The all value

    | Improve this Doc View Source

    GetCells()

    Return the number of cells in this Trie object.

    Declaration
    public virtual int GetCells()
    Returns
    Type Description
    System.Int32

    the number of cells

    | Improve this Doc View Source

    GetCellsPnt()

    Gets the cellsPnt attribute of the Trie object

    Declaration
    public virtual int GetCellsPnt()
    Returns
    Type Description
    System.Int32

    The cellsPnt value

    | Improve this Doc View Source

    GetCellsVal()

    Gets the cellsVal attribute of the Trie object

    Declaration
    public virtual int GetCellsVal()
    Returns
    Type Description
    System.Int32

    The cellsVal value

    | Improve this Doc View Source

    GetFully(String)

    Return the element that is stored in a cell associated with the given key.

    Declaration
    public virtual string GetFully(string key)
    Parameters
    Type Name Description
    System.String key

    the key

    Returns
    Type Description
    System.String

    the associated element

    | Improve this Doc View Source

    GetLastOnPath(String)

    Return the element that is stored as last on a path associated with the given key.

    Declaration
    public virtual string GetLastOnPath(string key)
    Parameters
    Type Name Description
    System.String key

    the key associated with the desired element

    Returns
    Type Description
    System.String

    the last on path element

    | Improve this Doc View Source

    PrintInfo(TextWriter, String)

    writes debugging info to the printstream

    Declaration
    public virtual void PrintInfo(TextWriter out, string prefix)
    Parameters
    Type Name Description
    System.IO.TextWriter out
    System.String prefix
    | Improve this Doc View Source

    Reduce(Reduce)

    Remove empty rows from the given Trie and return the newly reduced Trie.

    Declaration
    public virtual Trie Reduce(Reduce by)
    Parameters
    Type Name Description
    Reduce by

    the Trie to reduce

    Returns
    Type Description
    Trie

    newly reduced Trie

    | Improve this Doc View Source

    Store(IDataOutput)

    Write this Trie to the given output stream.

    Declaration
    public virtual void Store(IDataOutput os)
    Parameters
    Type Name Description
    J2N.IO.IDataOutput os

    the output stream

    Exceptions
    Type Condition
    System.IO.IOException

    if an I/O error occurs

    • Improve this Doc
    • View Source
    Back to top Copyright © 2021 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.