gate.creole.annic
Class PatternAnnotation

java.lang.Object
  extended by gate.creole.annic.PatternAnnotation
All Implemented Interfaces:
Serializable

public class PatternAnnotation
extends Object
implements Serializable

Pattern Annotation is similar to a GATE Annotation except that it doesn't have any annotation ID but it contains its position in the token stream that is created when indexing documents.

Author:
niraj
See Also:
Serialized Form

Constructor Summary
PatternAnnotation()
          Constructor
 
Method Summary
 void addFeature(String key, String val)
          Adds a feature
 int getEndOffset()
          Gets the end offset
 String getFeature(String key)
          Gets the value of a feature
 Map<String,String> getFeatures()
          Gets the Features
 int getPosition()
          Gets the position of this annotation in the token stream.
 int getStartOffset()
          Gets the start offset
 String getText()
          Gets the text of the annotation
 String getType()
          Gets the type of the annotation
 void setEnOffset(int en)
          Sets the end offset
 void setPosition(int pos)
          Sets the position
 void setStOffset(int st)
          Sets the start offset
 void setText(String text)
          Sets the TExt
 void setType(String type)
          Sets the Type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PatternAnnotation

public PatternAnnotation()
Constructor

Method Detail

setType

public void setType(String type)
Sets the Type

Parameters:
type -

setText

public void setText(String text)
Sets the TExt

Parameters:
text -

setStOffset

public void setStOffset(int st)
Sets the start offset

Parameters:
st -

setEnOffset

public void setEnOffset(int en)
Sets the end offset

Parameters:
en -

addFeature

public void addFeature(String key,
                       String val)
Adds a feature

Parameters:
key -
val -

setPosition

public void setPosition(int pos)
Sets the position

Parameters:
pos -

getFeatures

public Map<String,String> getFeatures()
Gets the Features


getFeature

public String getFeature(String key)
Gets the value of a feature


getType

public String getType()
Gets the type of the annotation


getText

public String getText()
Gets the text of the annotation


getStartOffset

public int getStartOffset()
Gets the start offset


getEndOffset

public int getEndOffset()
Gets the end offset


getPosition

public int getPosition()
Gets the position of this annotation in the token stream.