public class JetTest extends Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
batchFlag
true to run in 'batch' mode, with no console display window
|
static ConceptHierarchy |
conceptHierarchy |
static File |
conceptHierarchyFile |
protected static Properties |
config |
protected static String |
dataPath |
protected static Properties |
defaultConfig |
static String |
docId |
static String |
encoding |
static NameAnnotator |
extendedNameTagger |
protected static Grammar |
gram |
static NameTagger |
nameTagger |
static File |
patternFile |
static PatternCollection |
pc |
static HMMTagger |
tagger |
static Set<String> |
validProperties
the set of valid properties in a Jet properties file;
strings ending in "*" indicate that any property name
with the specified prefix is valid.
|
protected static Vector |
views |
| Constructor and Description |
|---|
JetTest() |
| Modifier and Type | Method and Description |
|---|---|
static void |
closeAllViews() |
static String |
getConfig(String property)
return property 'property' from the configuration file.
|
static String |
getConfigFile(String property)
return file name 'property' from the configuration file; if the value is
an absolute path or one beginning "./", return the value of the property;
if it is a relative path, prefix it with the value of 'Jet.dataPath' from the
configuration file.
|
static NumberAnnotator |
getNumberAnnotator()
Returns instance of
Jet.Time.NumberAnnotator for
annotating number expression. |
static org.joda.time.DateTime |
getReferenceTime()
Returns reference time for annotating TIMEX.
|
static org.joda.time.format.DateTimeFormatter |
getReferenceTimeFormat()
Returns format of reference time.
|
static TimeAnnotator |
getTimeAnnotator()
Returns instance of
Jet.Time.TimeAnnotator for annotating
TIMEX. |
static void |
initialize()
load all resources (lexicon, HMMs, patterns, grammar, concepts) as
specified in the .properties file.
|
static void |
initializeFromConfig(File configFile) |
static void |
initializeFromConfig(File configFile,
String jetHome)
read Jet parameter file from file
configFile and load all
specified resources. |
static void |
initializeFromConfig(String configFile) |
static void |
initializeFromConfig(String configFile,
String jetHome) |
static void |
initTimex()
Initialize parameters for annotating TIMEX.
|
static void |
main(String[] args) |
static void |
processFile(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(BufferedReader rdr)
read a document from
rdr. |
static void |
readENEData() |
static void |
readGazetteer()
if the parameter
Gazetteer.fileName is set, load a
gazetteer. |
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 and set the pattern trace switch if the
Pattern.trace switch is set. |
static void |
readTags()
if the parameter
Tags.fileName is set, load a
part-of-speech HMM from that file. |
static boolean |
setEncoding(String charset)
set the character set used for reading external documents.
|
static void |
setReferenceTime(org.joda.time.DateTime reference)
Sets reference time for annotating TIMEX.
|
public static Set<String> validProperties
public static boolean batchFlag
protected static Properties defaultConfig
protected static Properties config
protected static String dataPath
public static PatternCollection pc
public static File patternFile
protected static Grammar gram
public static HMMTagger tagger
public static NameTagger nameTagger
protected static Vector views
public static ConceptHierarchy conceptHierarchy
public static File conceptHierarchyFile
public static String encoding
public static String docId
public static NameAnnotator extendedNameTagger
public static void initializeFromConfig(File configFile, String jetHome)
configFile and load all
specified resources.public static void initializeFromConfig(File configFile)
public static void initializeFromConfig(String configFile)
public static String getConfig(String property)
public static String getConfigFile(String property)
public static void initialize()
public static void readLexicons()
EnglishLex.fileNamepublic static void readTags()
Tags.fileName is set, load a
part-of-speech HMM from that file.public static void readNameTags()
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.public static void readPatterns()
Pattern.fileName and set the pattern trace switch if the
Pattern.trace switch is set.public static void readGrammar()
Grammar.fileName is set, load a grammar
from that file.public static void readChunkModel()
Chunker.fileName is set, load a chunk
model from that file.public static void readConcepts()
Concepts.fileName is set, load a concept
hierarchy from that file.public static void readGazetteer()
Gazetteer.fileName is set, load a
gazetteer.public static void readENEData()
public static void initTimex()
public static org.joda.time.DateTime getReferenceTime()
public static void setReferenceTime(org.joda.time.DateTime reference)
public static org.joda.time.format.DateTimeFormatter getReferenceTimeFormat()
public static TimeAnnotator getTimeAnnotator()
Jet.Time.TimeAnnotator for annotating
TIMEX.public static NumberAnnotator getNumberAnnotator()
Jet.Time.NumberAnnotator for
annotating number expression.public static void processFile(String inputFileName, boolean viewable) throws IOException
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> .IOExceptionpublic static void processFiles(boolean viewable)
JetTest.fileName, invoke
processFile on that file of documents.public static void closeAllViews()
public static Document readDocument(BufferedReader rdr) throws IOException
rdr. The document begins with a line
<DOC> and ends with a line </DOC> .IOExceptionpublic static boolean setEncoding(String charset)
public static void main(String[] args)
Copyright © 2016 New York University. All rights reserved.