org.annotation.wordfreak.scheme
Class DerivativeAnnotationScheme

java.lang.Object
  extended byorg.annotation.wordfreak.scheme.AnnotationScheme
      extended byorg.annotation.wordfreak.scheme.DerivativeAnnotationScheme
All Implemented Interfaces:
AnnotatedFileListener, ChooserListener, java.util.EventListener, Plugin, javax.swing.event.TreeModelListener, UndoListener, ViewerListener, WordFreakKeyboardFocusManager.HotKeyListener
Direct Known Subclasses:
ConstituentAnnotationScheme, EntityAnnotationScheme, NamedEntityAnnotationScheme

public abstract class DerivativeAnnotationScheme
extends AnnotationScheme

Derivative annotation scheme is used to create annotation schemes which create annotations based on existing annotations. Constituents are a typical example as they are based on pos-tagged tokens and other contituents.


Nested Class Summary
 
Nested classes inherited from class org.annotation.wordfreak.scheme.AnnotationScheme
AnnotationScheme.POSFeature
 
Field Summary
protected  boolean canCreateChains
           
protected  boolean deleteParagraphs
          Boolean to determine whether paragraphs should be deleted when this scheme is loaded.
protected  java.util.regex.Matcher matcher
           
protected  java.util.regex.Pattern pattern
           
protected  boolean preprocess
          Boolean to determine whether tokenization preprocessing should occur if this scheme is loaded and no tokens are present.
protected  boolean recursive
          Boolean to set weather this scheme will allow recursive tagging.
 
Fields inherited from class org.annotation.wordfreak.scheme.AnnotationScheme
_ADD, _MOVE, _RELOAD, _REMOVE, _UPDATE, ANNOTATE, annotationFilter, annotator, annotatorName, canCreateAnnotations, chooser, chooserWidth, COADJUST, COADJUSTLEFT, COADJUSTRIGHT, codes, coloredWords, colors, colorTable, COMMENT, config, configLoaded, confineToBase, currentFile, DEFAULT_ACTION, defaultType, END, files, findIndex, FLATLEFT, FLATNEXT, FLATPREV, FLATRIGHT, groups, GROWLEFT, GROWRIGHT, guiListener, HOME, icons, index, INSERT, JUMP, L2R, LEFT, listeners, navigator, NEXT, NEXTCHUNK, NORM, one2one, one2oneFeature, one2oneValue, orientation, OUTCOME_CODES, OUTCOME_COLORS, OUTCOME_NAMES, outcomes, PREV, PREVCHUNK, R2L, REMOVE, RIGHT, selectedAnnotations, selEnd, selStart, SHRINKLEFT, SHRINKRIGHT, sortCriteria, sorted, sortedIndex, SPLIT, splita, splitb, type, typeMap, typeName, types, update, UPDATE, view, views
 
Constructor Summary
DerivativeAnnotationScheme(java.lang.String type)
           
DerivativeAnnotationScheme(java.lang.String type, boolean pre)
           
 
Method Summary
protected  void addAnnotation(Annotation ann)
           
protected  void addAnnotation(Annotation ann, Annotation before)
           
 void annotatedFile(AnnotationFile f)
          Selects annotations from f that this scheme can modify.
protected  Annotation annotationFromMouse(java.lang.String type)
           
protected  void createChooser()
          Instantiates a new chooser if one does not already exist and registers the chooser for scheme events and the scheme for chooser events.
 void findExpression(java.lang.String ex, int dir)
           
 void findExpressionAgain(java.lang.String ex, int dir)
           
protected  Command getInsertCommandFromSelection(java.lang.String type)
          Create an annotation from two offsets to List baseAnnotations.
 boolean getPreprocessing()
           
 boolean handlesBaseAnnotation(Annotation a)
           
 void makeVisible(Annotation a)
           
 boolean moveAnnotation(Annotation child, Annotation newParent, Annotation oldParent)
          Requests that the specified child annotation be moved form the specified old parent to the specified new parent.
 void next()
          Advances scheme to the next annotation.
 int offsetToIndex(int offset)
           
 void prev()
          Advances scheme to the previous annotation.
 void process()
           
 void removeAnnotation(Annotation a)
           
 void removeAnnotation(Annotation a, boolean shrink)
           
protected  void removeRedundantChildren(java.util.List anns)
           
protected  void replaceChildrenWithParent(java.util.List anns)
           
 void selectCurrentAnnotation()
          Requests that the current annotation be selected.
 void set(java.lang.String choice, int modifiers, boolean jump, Annotation selectedAnnotation)
          Specifies that the specified choice has been selected with the specified modifier and the specified selected Annotation and that the next annotation should be shown.
 void setAnnotation(Annotation a)
          Specifies the the annotation specified should be the current annotation.
 void setPreprocessing(boolean pre)
           
 void setSelection(AnnotationSelection anns)
          Requests that the specified annotation selection should be set as the current selection.
 void setSelection(AnnotationSelection anns, boolean validate)
          Requests that the specified annotation selection should be set as the current selection and adjusted if the specified validate condition is true.
 void unstyleAnnotation(Annotation a)
           
 
Methods inherited from class org.annotation.wordfreak.scheme.AnnotationScheme
addAnnotationSchemeListener, adjudicationMatch, adjudicationMatch, annotationFromMouse, annotationFromMouse, buildSwatches, closeAnnotatedFile, colorize, createView, dispose, down, end, filter, flatNext, flatPrev, getAdjudicationData, getAnnotation, getAnnotation, getAnnotationFilter, getAnnotationsFromFile, getAnnotationsFromOffsets, getAnnotationSize, getChooser, getColorScheme, getConfineToBase, getCurrentAnnotation, getDefaultType, getNames, getPropertyName, getSelectionMode, getSortedIndex, getValuesForFeature, handlesAnnotation, handlesRelation, hilightChunk, home, hotKeyPressed, indexOfAnnotation, initOutcomes, isOutcome, jumpToMark, linkAnnotation, nextFile, nextOutcome, notifyListeners, notifyListeners, prevFile, prevOutcome, process, redoPerformed, reload, reloadFiles, removeAllAnnotationSchemeListeners, removeAnnotationSchemeListener, set, set, set, setAnnotatedFile, setAnnotationFilter, setAnnotationView, setAnnotator, setAnnotatorName, setChooser, setChunkNavigation, setConfig, setConfineToBase, setFeature, setGuiListener, setJumpAfterAnnotation, setMark, setNavigator, setOneToOne, setOneToOne, setOrientation, setSelectionEnd, setSelectionMode, setSelectionStart, setSelEnd, setSortedIndex, setSortScheme, setTypeName, trackAnnotation, treeNodesChanged, treeNodesInserted, treeNodesRemoved, treeStructureChanged, undoPerformed, up, updateOutcomes, viewCreated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

recursive

protected boolean recursive
Boolean to set weather this scheme will allow recursive tagging.


deleteParagraphs

protected boolean deleteParagraphs
Boolean to determine whether paragraphs should be deleted when this scheme is loaded.


preprocess

protected boolean preprocess
Boolean to determine whether tokenization preprocessing should occur if this scheme is loaded and no tokens are present.


pattern

protected java.util.regex.Pattern pattern

matcher

protected java.util.regex.Matcher matcher

canCreateChains

protected boolean canCreateChains
Constructor Detail

DerivativeAnnotationScheme

public DerivativeAnnotationScheme(java.lang.String type)

DerivativeAnnotationScheme

public DerivativeAnnotationScheme(java.lang.String type,
                                  boolean pre)
Method Detail

setPreprocessing

public void setPreprocessing(boolean pre)

getPreprocessing

public boolean getPreprocessing()

createChooser

protected void createChooser()
Description copied from class: AnnotationScheme
Instantiates a new chooser if one does not already exist and registers the chooser for scheme events and the scheme for chooser events.

Overrides:
createChooser in class AnnotationScheme

annotatedFile

public void annotatedFile(AnnotationFile f)
Description copied from class: AnnotationScheme
Selects annotations from f that this scheme can modify.

Specified by:
annotatedFile in interface AnnotatedFileListener
Overrides:
annotatedFile in class AnnotationScheme

next

public void next()
Description copied from class: AnnotationScheme
Advances scheme to the next annotation.

Specified by:
next in interface ChooserListener
Overrides:
next in class AnnotationScheme

prev

public void prev()
Description copied from class: AnnotationScheme
Advances scheme to the previous annotation.

Specified by:
prev in interface ChooserListener
Overrides:
prev in class AnnotationScheme

setAnnotation

public void setAnnotation(Annotation a)
Description copied from interface: ChooserListener
Specifies the the annotation specified should be the current annotation.

Specified by:
setAnnotation in interface ChooserListener
Overrides:
setAnnotation in class AnnotationScheme

selectCurrentAnnotation

public void selectCurrentAnnotation()
Description copied from interface: ViewerListener
Requests that the current annotation be selected.

Specified by:
selectCurrentAnnotation in interface ViewerListener
Overrides:
selectCurrentAnnotation in class AnnotationScheme

setSelection

public void setSelection(AnnotationSelection anns)
Description copied from interface: ViewerListener
Requests that the specified annotation selection should be set as the current selection. The selection will be adjusted to ensure that only a valid selection is made.

Specified by:
setSelection in interface ViewerListener
Overrides:
setSelection in class AnnotationScheme

setSelection

public void setSelection(AnnotationSelection anns,
                         boolean validate)
Description copied from interface: ViewerListener
Requests that the specified annotation selection should be set as the current selection and adjusted if the specified validate condition is true.

Specified by:
setSelection in interface ViewerListener
Overrides:
setSelection in class AnnotationScheme

makeVisible

public void makeVisible(Annotation a)

offsetToIndex

public int offsetToIndex(int offset)
Overrides:
offsetToIndex in class AnnotationScheme

unstyleAnnotation

public void unstyleAnnotation(Annotation a)

removeAnnotation

public void removeAnnotation(Annotation a)
Overrides:
removeAnnotation in class AnnotationScheme

removeAnnotation

public void removeAnnotation(Annotation a,
                             boolean shrink)
Overrides:
removeAnnotation in class AnnotationScheme

moveAnnotation

public boolean moveAnnotation(Annotation child,
                              Annotation newParent,
                              Annotation oldParent)
Description copied from interface: ViewerListener
Requests that the specified child annotation be moved form the specified old parent to the specified new parent.

Specified by:
moveAnnotation in interface ViewerListener
Overrides:
moveAnnotation in class AnnotationScheme

addAnnotation

protected void addAnnotation(Annotation ann)

addAnnotation

protected void addAnnotation(Annotation ann,
                             Annotation before)

removeRedundantChildren

protected void removeRedundantChildren(java.util.List anns)

replaceChildrenWithParent

protected void replaceChildrenWithParent(java.util.List anns)

getInsertCommandFromSelection

protected Command getInsertCommandFromSelection(java.lang.String type)
Create an annotation from two offsets to List baseAnnotations.


annotationFromMouse

protected Annotation annotationFromMouse(java.lang.String type)

process

public void process()

handlesBaseAnnotation

public boolean handlesBaseAnnotation(Annotation a)
Overrides:
handlesBaseAnnotation in class AnnotationScheme

findExpression

public void findExpression(java.lang.String ex,
                           int dir)
Overrides:
findExpression in class AnnotationScheme

findExpressionAgain

public void findExpressionAgain(java.lang.String ex,
                                int dir)
Overrides:
findExpressionAgain in class AnnotationScheme

set

public void set(java.lang.String choice,
                int modifiers,
                boolean jump,
                Annotation selectedAnnotation)
Description copied from interface: ChooserListener
Specifies that the specified choice has been selected with the specified modifier and the specified selected Annotation and that the next annotation should be shown.

Specified by:
set in interface ChooserListener
Overrides:
set in class AnnotationScheme


Copyright © 2004 Thomas Morton and Jeremy LaCivita. All Rights Reserved.