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

Field Summary
private  int enOffset
          End Offset
private  Map<String,String> features
          FeatureMap
private  int position
          Position in the token stream
private static long serialVersionUID
          serial version id
private  int stOffset
          Start Offset
private  String text
          Text of the annotation
private  String type
          Annotation Type
 
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
 

Field Detail

serialVersionUID

private static final long serialVersionUID
serial version id

See Also:
Constant Field Values

type

private String type
Annotation Type


text

private String text
Text of the annotation


stOffset

private int stOffset
Start Offset


enOffset

private int enOffset
End Offset


features

private Map<String,String> features
FeatureMap


position

private int position
Position in the token stream

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

Returns:

getFeature

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

Parameters:
key -
Returns:

getType

public String getType()
Gets the type of the annotation

Returns:

getText

public String getText()
Gets the text of the annotation

Returns:

getStartOffset

public int getStartOffset()
Gets the start offset

Returns:

getEndOffset

public int getEndOffset()
Gets the end offset

Returns:

getPosition

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

Returns: