|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectanl.wordnet.reader.WordNetReader
public class WordNetReader
Basic class to read WordNet data from the WordNet internet site. The user provides the path to the .lst files and Wordnet will read the data and find matching synsets, automatically modifying the .lst files.
Nested Class Summary | |
---|---|
private static class |
WordNetReader.ArchiveMaker
Class to read from the WordNet site. |
Field Summary | |
---|---|
private java.util.Map<java.lang.String,java.lang.String> |
history
Tracks the history of wordnet data read so repeats are not made in .lst files |
Constructor Summary | |
---|---|
WordNetReader()
|
Method Summary | |
---|---|
static void |
main(java.lang.String[] args)
Main method to launch the search and word matching process. |
void |
mapWords(java.util.Map<java.lang.String,java.util.List<java.lang.String>> mappedT,
java.util.Map<java.lang.String,java.lang.String> original,
java.lang.String newFile)
Method writes out matched words and recreating the .lst file with the old searched terms as well as the new terms similar to the original searched terms. |
java.util.Map<java.lang.String,java.lang.String> |
returnWords(java.lang.String file)
Method to read an .lst file and returns the terms to search for similarities in WordNet. |
void |
run(java.lang.String urlBase,
java.lang.String addOn,
java.io.File directory)
Method conducts the entire parsing, search, and recreating the .lst file process |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.Map<java.lang.String,java.lang.String> history
Constructor Detail |
---|
public WordNetReader()
Method Detail |
---|
public java.util.Map<java.lang.String,java.lang.String> returnWords(java.lang.String file)
file
- a .lst file to read
public void mapWords(java.util.Map<java.lang.String,java.util.List<java.lang.String>> mappedT, java.util.Map<java.lang.String,java.lang.String> original, java.lang.String newFile)
mappedT
- a map of the original keyterm and list of new similar termsoriginal
- map of the original termsnewFile
- a .lst filepublic void run(java.lang.String urlBase, java.lang.String addOn, java.io.File directory) throws java.io.IOException, java.text.ParseException
urlBase
- the key url for the WordNet siteaddOn
- additional url info to link to the keyterm searchdirectory
- a directory to read files from
java.io.IOException
java.text.ParseException
public static void main(java.lang.String[] args)
args
- a string array argument with arg[0] should be set to the directory
location of the .lst files
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |