|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.annotation.wordfreak.annotator.Annotator
This is the top level class for automatic annotators or taggers. It primarily provides routines to collect data which is sent to methods of classes extending this class and implementing or overriding it methods.
Field Summary | |
protected AnnotationFilter |
annotationFilter
The filter that should be used during annotation so as to only change existing annotations which meet the filter criteria. |
protected java.lang.String |
dataDirectory
Directory where models that this annotator might require would be found. |
static java.lang.String |
DEFAULT_ANNOTATOR_NAME
|
protected java.util.List |
files
List of AnnotationFile objects currently loaded. |
protected GuiListener |
guiListener
This variable is assigned a value when this annotator is attached to a gui. |
protected java.util.List |
listeners
List of AnnotatorListener objects to be notified of annotator changes. |
protected boolean |
loaded
Indicates whether or not the the annotator is ready to be run. |
protected double |
progress
Double between 0 and 100 indicating progress in annotation. |
protected AnnotationFilter |
trainingFilter
The filter that should be used during training so as to only use existing annotations which meet the filter criteria for training. |
Constructor Summary | |
Annotator(java.lang.String type)
|
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent evt)
|
void |
addAnnotatorListener(AnnotatorListener annotatorListener)
Registers the specified annotator listener for notification from this annotator. |
void |
annotate()
Creates a progress bar and then annotates all the loaded files with this annotator. |
void |
annotatedFile(AnnotationFile f)
Selects annotations from f required for annotator. |
abstract void |
annotating()
Applies the appropiate annotation actions to each loaded annotation file. |
void |
closeAnnotatedFile(AnnotationFile f)
Notifies the listener that the specified file was closed. |
protected void |
done()
This method is called by the annotator when annotating is complete. |
java.lang.String |
getDataDirectory()
Returns the current directory used for storing data needed by the annotator. |
protected void |
hideWaitDialog(javax.swing.JDialog dialog)
Hides the wait-for-tagger-to-load dialog. |
abstract boolean |
loadAnnotator()
Loads the annotator. |
boolean |
loaded()
Returns whether the annotator is ready to be run. |
void |
removeAnnotatorListener(AnnotatorListener annotatorListener)
Un-registers the specified annotator listener from notification from this annotator. |
void |
setAnnotationFilter(AnnotationFilter af)
|
void |
setDataDirectory(java.lang.String dir)
Designates the directory used for storing data needed by the annotator. |
void |
setGuiListener(GuiListener gl)
|
protected void |
setProgress(double progress)
Explicitly sets the amount of progress that the annotator has made. |
void |
setTrainingFilter(AnnotationFilter af)
|
protected javax.swing.JDialog |
showWaitDialog()
Displays waiting-for-tagger-to-load dialog. |
java.lang.String[] |
sortedOutcomes(Annotation a)
Returns a sorted version of the possible outcomes. |
boolean |
supportsTraining()
Specifies whether or not this annotator suports training. |
void |
train(java.lang.String[] paths)
Trains the annotator on the files in paths . |
protected void |
training(java.lang.String[] paths)
|
protected void |
updateProgress(double additionalProgress)
Indicates that the specified amount of additional progress has been made. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String DEFAULT_ANNOTATOR_NAME
protected GuiListener guiListener
protected double progress
protected boolean loaded
protected java.lang.String dataDirectory
protected AnnotationFilter annotationFilter
protected AnnotationFilter trainingFilter
protected java.util.List files
AnnotationFile
objects currently loaded.
protected java.util.List listeners
AnnotatorListener
objects to be notified of annotator changes.
Constructor Detail |
public Annotator(java.lang.String type)
Method Detail |
public void addAnnotatorListener(AnnotatorListener annotatorListener)
annotatorListener
- The listener to be registered for notification.public void removeAnnotatorListener(AnnotatorListener annotatorListener)
annotatorListener
- The listener to be un-registered from notification.public boolean supportsTraining()
public void annotate()
annotating
method, followed by the done
method.
protected void updateProgress(double additionalProgress)
additionalProgress
- The addition progress that an annotator has made.protected void setProgress(double progress)
updateProgress
when possible.
progress
- The amount of progress that the annotaotr has made.updateProgress(double)
protected void done()
public abstract void annotating()
progressInt
should be updated to indicate annotation progress.
public void train(java.lang.String[] paths)
paths
.
protected void training(java.lang.String[] paths)
public abstract boolean loadAnnotator()
public boolean loaded()
public java.lang.String getDataDirectory()
protected javax.swing.JDialog showWaitDialog()
protected void hideWaitDialog(javax.swing.JDialog dialog)
dialog
- The dialog to be hidden. This was returned by showWaitDialog.public void setDataDirectory(java.lang.String dir)
public java.lang.String[] sortedOutcomes(Annotation a)
public void annotatedFile(AnnotationFile f)
f
required for annotator.
This may include annotations needed for the generation of sorted
outcomes. @see #sortedOutComes() sortedOutcomes
annotatedFile
in interface AnnotatedFileListener
f
- The file which was opened.public void closeAnnotatedFile(AnnotationFile f)
AnnotatedFileListener
closeAnnotatedFile
in interface AnnotatedFileListener
f
- The file which was closed.public void setGuiListener(GuiListener gl)
public void setAnnotationFilter(AnnotationFilter af)
public void setTrainingFilter(AnnotationFilter af)
public void actionPerformed(java.awt.event.ActionEvent evt)
actionPerformed
in interface java.awt.event.ActionListener
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |