public class Pattern extends Hit
Modifier and Type | Field and Description |
---|---|
protected List<PatternAnnotation> |
annotations
annotations
|
protected int |
leftContextStartOffset
Left context start offset
|
protected String |
patternText
pattern text
|
protected int |
rightContextEndOffset
right context end offset
|
annotationSetName, documentID, endOffset, queryString, startOffset
Constructor and Description |
---|
Pattern(String docID,
String annotationSetName,
String patternText,
int startOffset,
int endOffset,
int leftContextStartOffset,
int rightContextEndOffset,
List<PatternAnnotation> annotations,
String queryString)
Constructor
|
Modifier and Type | Method and Description |
---|---|
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
|
getAnnotationSetName, getDocumentID, getEndOffset, getQueryString, getStartOffset
protected int leftContextStartOffset
protected int rightContextEndOffset
protected String patternText
protected List<PatternAnnotation> annotations
public Pattern(String docID, String annotationSetName, String patternText, int startOffset, int endOffset, int leftContextStartOffset, int rightContextEndOffset, List<PatternAnnotation> annotations, String queryString)
docID
- patternText
- startOffset
- endOffset
- leftContextStartOffset
- rightContextEndOffset
- annotations
- queryString
- public List<PatternAnnotation> getPatternAnnotations(int startOffset, int endOffset)
public PatternAnnotation[] getPatternAnnotations()
public PatternAnnotation[] getPatternAnnotations(String type)
public PatternAnnotation[] getPatternAnnotations(String type, String feature)
public String getPatternText()
public String getPatternText(int startOffset, int endOffset)
public int getLeftContextStartOffset()
public int getRightContextEndOffset()
Copyright © 2024 GATE. All rights reserved.