Package net.didion.jwnl.utilities
Class DictionaryToMap
- java.lang.Object
-
- net.didion.jwnl.utilities.DictionaryToMap
-
public class DictionaryToMap extends java.lang.Object
DictionaryToMap allows you to populate and create an in-memory map of the WordNet library. The goal of this utility is to provide a performance boost to applications using a high quantity of API calls to the JWNL library (such as word sense disambiguation algorithms, or dictionary services).
-
-
Field Summary
Fields Modifier and Type Field Description private DictionaryCatalogSet
_destFiles
-
Constructor Summary
Constructors Constructor Description DictionaryToMap(java.lang.String destDirectory, java.lang.String propFile)
Initalize with the given map destination directory, using the properties file(usually file_properties.xml)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
convert()
Converts the current Dictionary to a MapBackedDictionary.private java.util.Iterator
getIterator(POS pos, DictionaryFileType fileType)
static void
main(java.lang.String[] args)
private void
serialize(POS pos, DictionaryFileType fileType)
-
-
-
Field Detail
-
_destFiles
private DictionaryCatalogSet _destFiles
-
-
Constructor Detail
-
DictionaryToMap
public DictionaryToMap(java.lang.String destDirectory, java.lang.String propFile) throws JWNLException, java.io.IOException
Initalize with the given map destination directory, using the properties file(usually file_properties.xml)- Parameters:
destDirectory
- - destination directory for in-memory map filespropFile
- - properties file of file-based WordNet- Throws:
JWNLException
java.io.IOException
-
-
Method Detail
-
convert
public void convert() throws JWNLException, java.io.IOException
Converts the current Dictionary to a MapBackedDictionary.- Throws:
JWNLException
java.io.IOException
-
getIterator
private java.util.Iterator getIterator(POS pos, DictionaryFileType fileType) throws JWNLException
- Throws:
JWNLException
-
serialize
private void serialize(POS pos, DictionaryFileType fileType) throws JWNLException, java.io.IOException
- Throws:
JWNLException
java.io.IOException
-
main
public static void main(java.lang.String[] args)
-
-