gate.creole.annic
Class Pattern

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

public class Pattern
extends Hit

Pattern is an extension of the HIT class. This provides information about the underlying annotations as well as the information about its left and right context.

Author:
niraj
See Also:
Serialized Form

Field Summary
protected  List<PatternAnnotation> annotations
          annotations
protected  int leftContextStartOffset
          Left context start offset
protected  String patternText
          pattern text
protected  int rightContextEndOffset
          right context end offset
 
Fields inherited from class gate.creole.annic.Hit
annotationSetName, documentID, endOffset, queryString, startOffset
 
Constructor Summary
Pattern(String docID, String annotationSetName, String patternText, int startOffset, int endOffset, int leftContextStartOffset, int rightContextEndOffset, List<PatternAnnotation> annotations, String queryString)
          Constructor
 
Method Summary
 int getLeftContextStartOffset()
          Returns the start offset of the left context
 PatternAnnotation[] getPatternAnnotations()
          Returns all annotations underlying the pattern
 List<PatternAnnotation> getPatternAnnotations(int startOffset, int endOffset)
          Returns the annotations lying between the start and the end offsets
 PatternAnnotation[] getPatternAnnotations(String type)
          Returns the annotations with the given type
 PatternAnnotation[] getPatternAnnotations(String type, String feature)
          Returns the annotations with the given type and the feature
 String getPatternText()
          Returns the text of the pattern
 String getPatternText(int startOffset, int endOffset)
          Returns the text of the pattern between the given offsets
 int getRightContextEndOffset()
          Returns the end offset of the right context
 
Methods inherited from class gate.creole.annic.Hit
getAnnotationSetName, getDocumentID, getEndOffset, getQueryString, getStartOffset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

leftContextStartOffset

protected int leftContextStartOffset
Left context start offset


rightContextEndOffset

protected int rightContextEndOffset
right context end offset


patternText

protected String patternText
pattern text


annotations

protected List<PatternAnnotation> annotations
annotations

Constructor Detail

Pattern

public Pattern(String docID,
               String annotationSetName,
               String patternText,
               int startOffset,
               int endOffset,
               int leftContextStartOffset,
               int rightContextEndOffset,
               List<PatternAnnotation> annotations,
               String queryString)
Constructor

Parameters:
docID -
patternText -
startOffset -
endOffset -
leftContextStartOffset -
rightContextEndOffset -
annotations -
queryString -
Method Detail

getPatternAnnotations

public List<PatternAnnotation> getPatternAnnotations(int startOffset,
                                                     int endOffset)
Returns the annotations lying between the start and the end offsets


getPatternAnnotations

public PatternAnnotation[] getPatternAnnotations()
Returns all annotations underlying the pattern


getPatternAnnotations

public PatternAnnotation[] getPatternAnnotations(String type)
Returns the annotations with the given type


getPatternAnnotations

public PatternAnnotation[] getPatternAnnotations(String type,
                                                 String feature)
Returns the annotations with the given type and the feature


getPatternText

public String getPatternText()
Returns the text of the pattern


getPatternText

public String getPatternText(int startOffset,
                             int endOffset)
Returns the text of the pattern between the given offsets


getLeftContextStartOffset

public int getLeftContextStartOffset()
Returns the start offset of the left context


getRightContextEndOffset

public int getRightContextEndOffset()
Returns the end offset of the right context