public final class UserDictionary extends Object implements Dictionary
Modifier and Type | Field and Description |
---|---|
static int |
LEFT_ID |
static int |
RIGHT_ID |
static int |
WORD_COST |
INTERNAL_SEPARATOR
Modifier and Type | Method and Description |
---|---|
String |
getBaseForm(int wordId,
char[] surface,
int off,
int len)
Get base form of word
|
TokenInfoFST |
getFST() |
String |
getInflectionForm(int wordId)
Get inflection form of tokens
|
String |
getInflectionType(int wordId)
Get inflection type of tokens
|
int |
getLeftId(int wordId)
Get left id of specified word
|
String |
getPartOfSpeech(int wordId)
Get Part-Of-Speech of tokens
|
String |
getPronunciation(int wordId,
char[] surface,
int off,
int len)
Get pronunciation of tokens
|
String |
getReading(int wordId,
char[] surface,
int off,
int len)
Get reading of tokens
|
int |
getRightId(int wordId)
Get right id of specified word
|
int |
getWordCost(int wordId)
Get word cost of specified word
|
int[][] |
lookup(char[] chars,
int off,
int len)
Lookup words in text
|
int[] |
lookupSegmentation(int phraseID) |
static UserDictionary |
open(Reader reader) |
public static final int WORD_COST
public static final int LEFT_ID
public static final int RIGHT_ID
public static UserDictionary open(Reader reader) throws IOException
IOException
public int[][] lookup(char[] chars, int off, int len) throws IOException
chars
- textoff
- offset into textlen
- length of textIOException
public TokenInfoFST getFST()
public int[] lookupSegmentation(int phraseID)
public int getLeftId(int wordId)
Dictionary
getLeftId
in interface Dictionary
public int getRightId(int wordId)
Dictionary
getRightId
in interface Dictionary
public int getWordCost(int wordId)
Dictionary
getWordCost
in interface Dictionary
public String getReading(int wordId, char[] surface, int off, int len)
Dictionary
getReading
in interface Dictionary
wordId
- word ID of tokenpublic String getPartOfSpeech(int wordId)
Dictionary
getPartOfSpeech
in interface Dictionary
wordId
- word ID of tokenpublic String getBaseForm(int wordId, char[] surface, int off, int len)
Dictionary
getBaseForm
in interface Dictionary
wordId
- word ID of tokenpublic String getPronunciation(int wordId, char[] surface, int off, int len)
Dictionary
getPronunciation
in interface Dictionary
wordId
- word ID of tokenpublic String getInflectionType(int wordId)
Dictionary
getInflectionType
in interface Dictionary
wordId
- word ID of tokenpublic String getInflectionForm(int wordId)
Dictionary
getInflectionForm
in interface Dictionary
wordId
- word ID of tokenCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.