Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class UserDictionary

    Class for building a User Dictionary. This class allows for custom segmentation of phrases.

    Inheritance
    object
    UserDictionary
    Implements
    IDictionary
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Analysis.Ja.Dict
    Assembly: Lucene.Net.Analysis.Kuromoji.dll
    Syntax
    public sealed class UserDictionary : IDictionary

    Constructors

    UserDictionary(TextReader)

    Class for building a User Dictionary. This class allows for custom segmentation of phrases.

    Declaration
    public UserDictionary(TextReader reader)
    Parameters
    Type Name Description
    TextReader reader

    Fields

    LEFT_ID

    Class for building a User Dictionary. This class allows for custom segmentation of phrases.

    Declaration
    public const int LEFT_ID = 5
    Field Value
    Type Description
    int

    RIGHT_ID

    Class for building a User Dictionary. This class allows for custom segmentation of phrases.

    Declaration
    public const int RIGHT_ID = 5
    Field Value
    Type Description
    int

    WORD_COST

    Class for building a User Dictionary. This class allows for custom segmentation of phrases.

    Declaration
    public const int WORD_COST = -100000
    Field Value
    Type Description
    int

    Properties

    FST

    Class for building a User Dictionary. This class allows for custom segmentation of phrases.

    Declaration
    public TokenInfoFST FST { get; }
    Property Value
    Type Description
    TokenInfoFST

    Methods

    GetBaseForm(int, char[], int, int)

    Get base form of word.

    Declaration
    public string GetBaseForm(int wordId, char[] surface, int off, int len)
    Parameters
    Type Name Description
    int wordId

    Word ID of token.

    char[] surface
    int off
    int len
    Returns
    Type Description
    string

    Base form (only different for inflected words, otherwise null).

    GetInflectionForm(int)

    Get inflection form of tokens.

    Declaration
    public string GetInflectionForm(int wordId)
    Parameters
    Type Name Description
    int wordId

    Word ID of token.

    Returns
    Type Description
    string

    Inflection form, or null.

    GetInflectionType(int)

    Get inflection type of tokens.

    Declaration
    public string GetInflectionType(int wordId)
    Parameters
    Type Name Description
    int wordId

    Word ID of token.

    Returns
    Type Description
    string

    Inflection type, or null.

    GetLeftId(int)

    Get left id of specified word.

    Declaration
    public int GetLeftId(int wordId)
    Parameters
    Type Name Description
    int wordId

    Word ID of token.

    Returns
    Type Description
    int

    Left id.

    GetPartOfSpeech(int)

    Get Part-Of-Speech of tokens

    Declaration
    public string GetPartOfSpeech(int wordId)
    Parameters
    Type Name Description
    int wordId

    Word ID of token.

    Returns
    Type Description
    string

    Part-Of-Speech of the token.

    GetPronunciation(int, char[], int, int)

    Get pronunciation of tokens

    Declaration
    public string GetPronunciation(int wordId, char[] surface, int off, int len)
    Parameters
    Type Name Description
    int wordId

    Word ID of token.

    char[] surface
    int off
    int len
    Returns
    Type Description
    string

    Pronunciation of the token.

    GetReading(int, char[], int, int)

    Get reading of tokens.

    Declaration
    public string GetReading(int wordId, char[] surface, int off, int len)
    Parameters
    Type Name Description
    int wordId

    Word ID of token.

    char[] surface
    int off
    int len
    Returns
    Type Description
    string

    Reading of the token.

    GetRightId(int)

    Get right id of specified word.

    Declaration
    public int GetRightId(int wordId)
    Parameters
    Type Name Description
    int wordId

    Word ID of token.

    Returns
    Type Description
    int

    Right id.

    GetWordCost(int)

    Get word cost of specified word

    Declaration
    public int GetWordCost(int wordId)
    Parameters
    Type Name Description
    int wordId

    Word ID of token.

    Returns
    Type Description
    int

    Word's cost.

    Lookup(char[], int, int)

    Lookup words in text.

    Declaration
    public int[][] Lookup(char[] chars, int off, int len)
    Parameters
    Type Name Description
    char[] chars

    Text.

    int off

    Offset into text.

    int len

    Length of text.

    Returns
    Type Description
    int[][]

    Array of {wordId, position, length}.

    LookupSegmentation(int)

    Class for building a User Dictionary. This class allows for custom segmentation of phrases.

    Declaration
    public int[] LookupSegmentation(int phraseID)
    Parameters
    Type Name Description
    int phraseID
    Returns
    Type Description
    int[]

    Implements

    IDictionary
    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.