Jet
Class JetTest

java.lang.Object
  extended byJet.JetTest

public class JetTest
extends java.lang.Object

contains the main method for Jet, and the methods for initial loading of linguistic data (grammars, lexicons, patterns, etc.).


Field Summary
static boolean batchFlag
          true to run in 'batch' mode, with no console display window
static ConceptHierarchy conceptHierarchy
           
static java.io.File conceptHierarchyFile
           
protected static java.util.Properties config
           
protected static java.lang.String dataPath
           
protected static java.util.Properties defaultConfig
           
static java.lang.String encoding
           
protected static Grammar gram
           
protected static HMMNameTagger nameTagger
           
static java.io.File patternFile
           
static PatternCollection pc
           
static HMMTagger tagger
           
protected static java.util.Vector views
           
 
Constructor Summary
JetTest()
           
 
Method Summary
static void closeAllViews()
           
static java.lang.String getConfig(java.lang.String property)
          return property 'property' from the configuration file.
static java.lang.String getConfigFile(java.lang.String property)
          return file name 'property' from the configuration file; if the value is a relative path, prefix it with the value of 'Jet.dataPath' from the configuration file.
static void initialize()
          load all resources (lexicon, HMMs, patterns, grammar, concepts) as specified in the .properties file.
static void initializeFromConfig(java.io.File configFile)
          read Jet parameter file from file configFile and load all specified resources.
static void initializeFromConfig(java.lang.String configFile)
           
static void main(java.lang.String[] args)
           
static void processFile(java.lang.String inputFileName, boolean viewable)
          process all the documents on file inputFileName, displaying the results in View windows if viewable is true.
static void processFiles(boolean viewable)
          for each Jet parameter beginning JetTest.fileName, invoke processFile on that file of documents.
static void readChunkModel()
          if the parameter Chunker.fileName is set, load a chunk model from that file.
static void readConcepts()
          if the parameter Concepts.fileName is set, load a concept hierarchy from that file.
static Document readDocument(java.io.BufferedReader rdr)
          read a document from rdr.
static void readGrammar()
          if the parameter Grammar.fileName is set, load a grammar from that file.
static void readLexicons()
          load all lexicons specified by parameters beginning with the string Englishlex.fileName
static void readNameTags()
          if the parameter NameTags.fileName is set, load a name tagger HMM from that file.
static void readPatterns()
          load all pattern files specified by parameters beginning with the string Pattern.fileName
static void readTags()
          if the parameter Tags.fileName is set, load a part-of-speech HMM from that file.
static boolean setEncoding(java.lang.String charset)
          set the character set used for reading external documents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

batchFlag

public static boolean batchFlag
true to run in 'batch' mode, with no console display window


defaultConfig

protected static java.util.Properties defaultConfig

config

protected static java.util.Properties config

dataPath

protected static java.lang.String dataPath

pc

public static PatternCollection pc

patternFile

public static java.io.File patternFile

gram

protected static Grammar gram

tagger

public static HMMTagger tagger

nameTagger

protected static HMMNameTagger nameTagger

views

protected static java.util.Vector views

conceptHierarchy

public static ConceptHierarchy conceptHierarchy

conceptHierarchyFile

public static java.io.File conceptHierarchyFile

encoding

public static java.lang.String encoding
Constructor Detail

JetTest

public JetTest()
Method Detail

initializeFromConfig

public static void initializeFromConfig(java.io.File configFile)
read Jet parameter file from file configFile and load all specified resources.


initializeFromConfig

public static void initializeFromConfig(java.lang.String configFile)

getConfig

public static java.lang.String getConfig(java.lang.String property)
return property 'property' from the configuration file.


getConfigFile

public static java.lang.String getConfigFile(java.lang.String property)
return file name 'property' from the configuration file; if the value is a relative path, prefix it with the value of 'Jet.dataPath' from the configuration file.


initialize

public static void initialize()
load all resources (lexicon, HMMs, patterns, grammar, concepts) as specified in the .properties file.


readLexicons

public static void readLexicons()
load all lexicons specified by parameters beginning with the string Englishlex.fileName


readTags

public static void readTags()
if the parameter Tags.fileName is set, load a part-of-speech HMM from that file.


readNameTags

public static void readNameTags()
if the parameter NameTags.fileName is set, load a name tagger HMM from that file. If parameter NameTags.emitter is set, use the value of that parameter as the name of the emitter class for the HMM, otherwise used WordFeatureHMMemitter as the default.


readPatterns

public static void readPatterns()
load all pattern files specified by parameters beginning with the string Pattern.fileName


readGrammar

public static void readGrammar()
if the parameter Grammar.fileName is set, load a grammar from that file.


readChunkModel

public static void readChunkModel()
if the parameter Chunker.fileName is set, load a chunk model from that file.


readConcepts

public static void readConcepts()
if the parameter Concepts.fileName is set, load a concept hierarchy from that file.


processFile

public static void processFile(java.lang.String inputFileName,
                               boolean viewable)
                        throws java.io.IOException
process all the documents on file inputFileName, displaying the results in View windows if viewable is true. The file should contain one or more documents, each beginning with a line <DOC> and ending with a line </DOC> .

Throws:
java.io.IOException

processFiles

public static void processFiles(boolean viewable)
for each Jet parameter beginning JetTest.fileName, invoke processFile on that file of documents.


closeAllViews

public static void closeAllViews()

readDocument

public static Document readDocument(java.io.BufferedReader rdr)
                             throws java.io.IOException
read a document from rdr. The document begins with a line <DOC> and ends with a line </DOC> .

Returns:
a Document with no annotations
Throws:
java.io.IOException

setEncoding

public static boolean setEncoding(java.lang.String charset)
set the character set used for reading external documents. If a valid character set is specified, return true. If the argument is not valid, print a list of the valid character sets and return false.


main

public static void main(java.lang.String[] args)