public class TokenInfoDictionary extends Object implements Dictionary
Modifier and Type | Field and Description |
---|---|
static String |
FEATURE_MAP_FILENAME |
static String |
POS_MAP_FILENAME |
protected StringValueMapBuffer |
posValues |
protected StringValueMapBuffer |
stringValues |
static String |
TARGETMAP_FILENAME |
static String |
TOKEN_INFO_DICTIONARY_FILENAME |
protected TokenInfoBuffer |
tokenInfoBuffer |
protected WordIdMap |
wordIdMap |
Constructor and Description |
---|
TokenInfoDictionary() |
Modifier and Type | Method and Description |
---|---|
String |
getAllFeatures(int wordId)
Gets all features of the specified word id
|
String[] |
getAllFeaturesArray(int wordId)
Gets all features of the specified word id as a String array
|
String |
getFeature(int wordId,
int... fields)
Gets one or more specific features of a token
This is an expert API
|
int |
getLeftId(int wordId)
Gets the left id of the specified word
|
int |
getRightId(int wordId)
Gets the right id of the specified word
|
int |
getWordCost(int wordId)
Gets the word cost of the specified word
|
int[] |
lookupWordIds(int sourceId) |
static TokenInfoDictionary |
newInstance(ResourceResolver resolver) |
public static final String TOKEN_INFO_DICTIONARY_FILENAME
public static final String FEATURE_MAP_FILENAME
public static final String POS_MAP_FILENAME
public static final String TARGETMAP_FILENAME
protected TokenInfoBuffer tokenInfoBuffer
protected StringValueMapBuffer posValues
protected StringValueMapBuffer stringValues
protected WordIdMap wordIdMap
public int[] lookupWordIds(int sourceId)
public int getLeftId(int wordId)
Dictionary
getLeftId
in interface Dictionary
wordId
- word id to get left id cost forpublic int getRightId(int wordId)
Dictionary
getRightId
in interface Dictionary
wordId
- word id to get right id cost forpublic int getWordCost(int wordId)
Dictionary
getWordCost
in interface Dictionary
wordId
- word id to get word cost forpublic String[] getAllFeaturesArray(int wordId)
Dictionary
getAllFeaturesArray
in interface Dictionary
wordId
- word id to get features forpublic String getAllFeatures(int wordId)
Dictionary
getAllFeatures
in interface Dictionary
wordId
- word id to get features forpublic String getFeature(int wordId, int... fields)
Dictionary
This is an expert API
getFeature
in interface Dictionary
wordId
- word id to get features forfields
- array of feature ids. If this array is empty, all features are returnedpublic static TokenInfoDictionary newInstance(ResourceResolver resolver) throws IOException
IOException
Copyright © 2020. All rights reserved.