public static class RAMDictionary.DictionaryData extends Object implements Serializable
| Modifier and Type | Class and Description |
|---|---|
class |
RAMDictionary.DictionaryData.WordBuilder
A utility class that allows us to build word objects
|
| Modifier and Type | Field and Description |
|---|---|
protected Map<POS,Map<IExceptionEntryID,IExceptionEntry>> |
exceptions |
protected Map<POS,Map<IIndexWordID,IIndexWord>> |
idxWords |
protected Map<ISenseKey,ISenseEntry> |
senses |
protected Map<POS,Map<ISynsetID,ISynset>> |
synsets |
protected IVersion |
version |
protected Map<ISenseKey,IWord> |
words |
| Constructor and Description |
|---|
DictionaryData()
Constructs an empty dictionary data object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
compact()
Compacts this dictionary data object by resizing the internal maps,
and removing redundant objects where possible.
|
protected <K,V> Map<K,V> |
compactMap(Map<K,V> map)
Compacts a regular map.
|
void |
compactObjects()
Replaces redundant objects where possible
|
protected <K,V> void |
compactPOSMap(Map<POS,Map<K,V>> map)
Compacts a part-of-speech map
|
void |
compactSize()
Resizes the internal data maps to be the exact size to contain their
data.
|
protected IIndexWord |
makeIndexWord(IIndexWord old)
Creates a new index word that replicates the specified index word.
|
protected <K,V> Map<K,V> |
makeMap(int initialSize,
Map<K,V> contents)
Creates the actual sub-maps for the part-of-speech maps.
|
protected <K,V> Map<POS,Map<K,V>> |
makePOSMap()
This method is used when constructing the dictionary data object.
|
protected ISynset |
makeSynset(ISynset old)
Creates a new synset object that replaces all the old internal
ISynsetID objects with those from the denoted synsets,
thus throwing away redundant sysnet ids. |
protected IWord |
makeWord(ISynset newSynset,
ISynset oldSynset,
IWord old)
Creates a new word object that replaces all the old internal
IWordID objects with those from the denoted words, thus
throwing away redundant word ids. |
protected IVersion version
protected Map<POS,Map<IIndexWordID,IIndexWord>> idxWords
protected Map<POS,Map<IExceptionEntryID,IExceptionEntry>> exceptions
protected Map<ISenseKey,ISenseEntry> senses
public DictionaryData()
protected <K,V> Map<POS,Map<K,V>> makePOSMap()
K - the type of the keys for the sub-mapsV - the type of the values for the sub-mapsprotected <K,V> Map<K,V> makeMap(int initialSize, Map<K,V> contents)
LinkedHashMap maps.K - the type of the keys for the sub-mapsV - the type of the values for the sub-mapsinitialSize - the initial size of the map; this parameter is ignored if
the contents parameter is non-
null.contents - the items to be inserted in the map, may be
null. If non-null, the
initialSize parameter is ignoredIllegalArgumentException - if the initial size is invalid (less than 1) and the
specified contents are nullpublic void compact()
public void compactSize()
protected <K,V> void compactPOSMap(Map<POS,Map<K,V>> map)
map - the part-of-speech keyed map to be compactedprotected <K,V> Map<K,V> compactMap(Map<K,V> map)
map - the map to be compacted, may not be null.NullPointerException - if the specified map is nullpublic void compactObjects()
protected ISynset makeSynset(ISynset old)
ISynsetID objects with those from the denoted synsets,
thus throwing away redundant sysnet ids.old - the synset to be replicatedNullPointerException - if the specified synset is nullprotected IWord makeWord(ISynset newSynset, ISynset oldSynset, IWord old)
IWordID objects with those from the denoted words, thus
throwing away redundant word ids.newSynset - the synset for which the word is being madeoldSynset - the old synset from which the word should be madeold - the word to be replicatedNullPointerException - if any argument is nullprotected IIndexWord makeIndexWord(IIndexWord old)
old - the index word to be replicatedNullPointerException - if the specified index word is nullCopyright © 2018. All rights reserved.