Class UserDictionary
Class for building a User Dictionary. This class allows for custom segmentation of phrases.
Implements
Inherited Members
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[] |