public final class UserDictionary extends java.lang.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 |
---|---|
java.lang.String |
getBaseForm(int wordId,
char[] surface,
int off,
int len)
Get base form of word
|
TokenInfoFST |
getFST() |
java.lang.String |
getInflectionForm(int wordId)
Get inflection form of tokens
|
java.lang.String |
getInflectionType(int wordId)
Get inflection type of tokens
|
int |
getLeftId(int wordId)
Get left id of specified word
|
java.lang.String |
getPartOfSpeech(int wordId)
Get Part-Of-Speech of tokens
|
java.lang.String |
getPronunciation(int wordId,
char[] surface,
int off,
int len)
Get pronunciation of tokens
|
java.lang.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(java.io.Reader reader) |
public static final int WORD_COST
public static final int LEFT_ID
public static final int RIGHT_ID
public static UserDictionary open(java.io.Reader reader) throws java.io.IOException
java.io.IOException
public int[][] lookup(char[] chars, int off, int len) throws java.io.IOException
chars
- textoff
- offset into textlen
- length of textjava.io.IOException
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 java.lang.String getReading(int wordId, char[] surface, int off, int len)
Dictionary
getReading
in interface Dictionary
wordId
- word ID of tokenpublic java.lang.String getPartOfSpeech(int wordId)
Dictionary
getPartOfSpeech
in interface Dictionary
wordId
- word ID of tokenpublic java.lang.String getBaseForm(int wordId, char[] surface, int off, int len)
Dictionary
getBaseForm
in interface Dictionary
wordId
- word ID of tokenpublic java.lang.String getPronunciation(int wordId, char[] surface, int off, int len)
Dictionary
getPronunciation
in interface Dictionary
wordId
- word ID of tokenpublic java.lang.String getInflectionType(int wordId)
Dictionary
getInflectionType
in interface Dictionary
wordId
- word ID of tokenpublic java.lang.String getInflectionForm(int wordId)
Dictionary
getInflectionForm
in interface Dictionary
wordId
- word ID of tokenCopyright © 2000–2019 The Apache Software Foundation. All rights reserved.