anl.wordnet.reader
Class WordNetReader

java.lang.Object
  extended by anl.wordnet.reader.WordNetReader

public class WordNetReader
extends java.lang.Object

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

history

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 Detail

WordNetReader

public WordNetReader()
Method Detail

returnWords

public 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.

Parameters:
file - a .lst file to read
Returns:
a map of matched terms

mapWords

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)
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.

Parameters:
mappedT - a map of the original keyterm and list of new similar terms
original - map of the original terms
newFile - a .lst file

run

public void run(java.lang.String urlBase,
                java.lang.String addOn,
                java.io.File directory)
         throws java.io.IOException,
                java.text.ParseException
Method conducts the entire parsing, search, and recreating the .lst file process

Parameters:
urlBase - the key url for the WordNet site
addOn - additional url info to link to the keyterm search
directory - a directory to read files from
Throws:
java.io.IOException
java.text.ParseException

main

public static void main(java.lang.String[] args)
Main method to launch the search and word matching process.

Parameters:
args - a string array argument with arg[0] should be set to the directory location of the .lst files