public abstract class AbstractDictionaryElementFactory extends java.lang.Object implements DictionaryElementFactory
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CACHE_STRINGS_KEY
Whether to cache strings in .intern like manner.
|
protected boolean |
cacheStrings |
protected Dictionary |
dictionary |
protected java.util.Map<POS,java.lang.Long> |
maxOffset |
protected Pool<java.lang.String> |
stringCache |
Constructor and Description |
---|
AbstractDictionaryElementFactory(Dictionary dictionary,
java.util.Map<java.lang.String,Param> params) |
Modifier and Type | Method and Description |
---|---|
Exc |
createException(POS pos,
java.lang.String lemma,
java.util.List<java.lang.String> exceptions)
Creates an exception in the dictionary.
|
IndexWord |
createIndexWord(POS pos,
java.lang.String lemma,
Synset synset)
Creates index word.
|
protected long |
createNewOffset(POS pos) |
Synset |
createSynset(POS pos)
Creates synset of the specified part of speech.
|
protected Word |
createWord(Synset synset,
java.lang.String lemma)
Creates a word.
|
Dictionary |
getDictionary()
Returns the dictionary this object belongs to.
|
protected static void |
initVerbFrameFlags(Synset synset,
java.util.BitSet vFrames,
int frameNumber,
int wordIndex) |
void |
setDictionary(Dictionary dictionary)
Sets the dictionary this object belongs to.
|
void |
startCaching() |
void |
stopCaching() |
protected final Dictionary dictionary
protected final java.util.Map<POS,java.lang.Long> maxOffset
public static final java.lang.String CACHE_STRINGS_KEY
protected boolean cacheStrings
protected Pool<java.lang.String> stringCache
public AbstractDictionaryElementFactory(Dictionary dictionary, java.util.Map<java.lang.String,Param> params)
public Exc createException(POS pos, java.lang.String lemma, java.util.List<java.lang.String> exceptions) throws JWNLException
DictionaryElementFactory
createException
in interface DictionaryElementFactory
pos
- exception part of speechlemma
- exception lemmaexceptions
- list of base formsJWNLException
- JWNLExceptionpublic Synset createSynset(POS pos) throws JWNLException
DictionaryElementFactory
createSynset
in interface DictionaryElementFactory
pos
- part of speechJWNLException
- JWNLExceptionpublic IndexWord createIndexWord(POS pos, java.lang.String lemma, Synset synset) throws JWNLException
DictionaryElementFactory
createIndexWord
in interface DictionaryElementFactory
pos
- part of speechlemma
- lemmasynset
- synsetJWNLException
- JWNLExceptionprotected static void initVerbFrameFlags(Synset synset, java.util.BitSet vFrames, int frameNumber, int wordIndex)
protected Word createWord(Synset synset, java.lang.String lemma)
synset
- synsetlemma
- lemmapublic void setDictionary(Dictionary dictionary) throws JWNLException
Owned
setDictionary
in interface Owned
dictionary
- the dictionary this object belongs toJWNLException
- JWNLExceptionpublic Dictionary getDictionary()
Owned
getDictionary
in interface Owned
public void startCaching()
public void stopCaching()
protected long createNewOffset(POS pos)