|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface SequenceMatchResult<T>
The result of a match against a sequence.
Similar to Java's MatchResult except it is for sequences
over arbitrary types T instead of just characters.
This interface contains query methods used to determine the
results of a match against a regular expression against an sequence.
The match boundaries, groups and group boundaries can be seen
but not modified through a SequenceMatchResult.
SequenceMatcher| Nested Class Summary | |
|---|---|
static class |
SequenceMatchResult.GroupToIntervalFunc<MR extends java.util.regex.MatchResult>
|
static class |
SequenceMatchResult.MatchedGroupInfo<T>
Information about a matched group |
| Field Summary | |
|---|---|
static java.util.Comparator<? super java.util.regex.MatchResult> |
DEFAULT_COMPARATOR
|
static int |
GROUP_AFTER_MATCH
|
static int |
GROUP_BEFORE_MATCH
|
static java.util.Comparator<java.util.regex.MatchResult> |
LENGTH_COMPARATOR
|
static java.util.Comparator<java.util.regex.MatchResult> |
OFFSET_COMPARATOR
|
static java.util.Comparator<java.util.regex.MatchResult> |
ORDER_COMPARATOR
|
static java.util.Comparator<java.util.regex.MatchResult> |
SCORE_COMPARATOR
|
static java.util.Comparator<java.util.regex.MatchResult> |
SCORE_LENGTH_ORDER_OFFSET_COMPARATOR
|
static SequenceMatchResult.GroupToIntervalFunc |
TO_INTERVAL
|
| Fields inherited from interface edu.stanford.nlp.util.HasInterval |
|---|
CONTAINS_FIRST_ENDPOINTS_COMPARATOR, ENDPOINTS_COMPARATOR, NESTED_FIRST_ENDPOINTS_COMPARATOR |
| Method Summary | |
|---|---|
java.util.List<? extends T> |
elements()
Returns the original sequence the match was performed on. |
int |
end(java.lang.String groupVar)
Returns the index of the next element after the subsequence captured by the given group during this match. |
int |
getOrder()
|
java.lang.String |
group(java.lang.String groupVar)
Returns the String representing the matched group. |
SequenceMatchResult.MatchedGroupInfo<T> |
groupInfo()
|
SequenceMatchResult.MatchedGroupInfo<T> |
groupInfo(int group)
|
SequenceMatchResult.MatchedGroupInfo<T> |
groupInfo(java.lang.String var)
|
java.lang.Object |
groupMatchResult(int groupid,
int index)
Returns an Object representing the result for the match for a particular node in a group. |
java.lang.Object |
groupMatchResult(java.lang.String groupVar,
int index)
Returns an Object representing the result for the match for a particular node in a group. |
java.util.List<java.lang.Object> |
groupMatchResults()
Returns a list of Objects representing the match results for the entire sequence. |
java.util.List<java.lang.Object> |
groupMatchResults(int group)
Returns a list of Objects representing the match results for the nodes in the group. |
java.util.List<java.lang.Object> |
groupMatchResults(java.lang.String groupVar)
Returns a list of Objects representing the match results for the nodes in the group. |
java.util.List<? extends T> |
groupNodes()
Returns the entire matched subsequence as a list. |
java.util.List<? extends T> |
groupNodes(int group)
Returns the matched group as a list. |
java.util.List<? extends T> |
groupNodes(java.lang.String groupVar)
Returns the matched group as a list. |
java.lang.Object |
groupValue()
|
java.lang.Object |
groupValue(int group)
|
java.lang.Object |
groupValue(java.lang.String var)
|
java.lang.Object |
nodeMatchResult(int index)
Returns an Object representing the result for the match for a particular node. |
double |
score()
|
int |
start(java.lang.String groupVar)
Returns the start index of the subsequence captured by the given group during this match. |
BasicSequenceMatchResult<T> |
toBasicSequenceMatchResult()
|
| Methods inherited from interface java.util.regex.MatchResult |
|---|
end, end, group, group, groupCount, start, start |
| Methods inherited from interface edu.stanford.nlp.util.HasInterval |
|---|
getInterval |
| Field Detail |
|---|
static final int GROUP_BEFORE_MATCH
static final int GROUP_AFTER_MATCH
static final SequenceMatchResult.GroupToIntervalFunc TO_INTERVAL
static final java.util.Comparator<java.util.regex.MatchResult> SCORE_COMPARATOR
static final java.util.Comparator<java.util.regex.MatchResult> ORDER_COMPARATOR
static final java.util.Comparator<java.util.regex.MatchResult> LENGTH_COMPARATOR
static final java.util.Comparator<java.util.regex.MatchResult> OFFSET_COMPARATOR
static final java.util.Comparator<java.util.regex.MatchResult> SCORE_LENGTH_ORDER_OFFSET_COMPARATOR
static final java.util.Comparator<? super java.util.regex.MatchResult> DEFAULT_COMPARATOR
| Method Detail |
|---|
double score()
java.util.List<? extends T> elements()
java.util.List<? extends T> groupNodes()
java.lang.IllegalStateException - If no match has yet been attempted,
or if the previous match operation failedjava.util.List<? extends T> groupNodes(int group)
group - The index of a capturing group in this matcher's pattern
java.lang.IllegalStateException - If no match has yet been attempted,
or if the previous match operation failed
java.lang.IndexOutOfBoundsException - If there is no capturing group in the pattern
with the given indexBasicSequenceMatchResult<T> toBasicSequenceMatchResult()
java.util.List<? extends T> groupNodes(java.lang.String groupVar)
groupVar - The name of the capturing group in this matcher's pattern
java.lang.IllegalStateException - If no match has yet been attempted,
or if the previous match operation failedjava.lang.String group(java.lang.String groupVar)
String representing the matched group.
groupVar - The name of the capturing group in this matcher's pattern
String
or null if there is no capturing group in the pattern
with the given name
java.lang.IllegalStateException - If no match has yet been attempted,
or if the previous match operation failedint start(java.lang.String groupVar)
groupVar - The name of the capturing group in this matcher's pattern
java.lang.IllegalStateException - If no match has yet been attempted,
or if the previous match operation failedint end(java.lang.String groupVar)
groupVar - The name of the capturing group in this matcher's pattern
java.lang.IllegalStateException - If no match has yet been attempted,
or if the previous match operation failedint getOrder()
java.lang.Object nodeMatchResult(int index)
index - The index of the element in the original sequence.
java.lang.IllegalStateException - If no match has yet been attempted,
or if the previous match operation failed
java.lang.IndexOutOfBoundsException - If the index is out of range
java.lang.Object groupMatchResult(int groupid,
int index)
groupid - The index of a capturing group in this matcher's patternindex - The index of the element in the captured subsequence.
java.lang.IllegalStateException - If no match has yet been attempted,
or if the previous match operation failed
java.lang.IndexOutOfBoundsException - If there is no capturing group in the pattern
with the given groupid or if the index is out of range
java.lang.Object groupMatchResult(java.lang.String groupVar,
int index)
groupVar - The name of the capturing group in this matcher's patternindex - The index of the element in the captured subsequence.
java.lang.IllegalStateException - If no match has yet been attempted,
or if the previous match operation failed
java.lang.IndexOutOfBoundsException - if the index is out of rangejava.util.List<java.lang.Object> groupMatchResults()
java.lang.IllegalStateException - If no match has yet been attempted,
or if the previous match operation failedjava.util.List<java.lang.Object> groupMatchResults(int group)
group - The index of a capturing group in this matcher's pattern
java.lang.IllegalStateException - If no match has yet been attempted,
or if the previous match operation failed
java.lang.IndexOutOfBoundsException - If there is no capturing group in the pattern
with the given indexjava.util.List<java.lang.Object> groupMatchResults(java.lang.String groupVar)
groupVar - The name of the capturing group in this matcher's pattern
java.lang.IllegalStateException - If no match has yet been attempted,
or if the previous match operation failedjava.lang.Object groupValue()
java.lang.Object groupValue(int group)
java.lang.Object groupValue(java.lang.String var)
SequenceMatchResult.MatchedGroupInfo<T> groupInfo()
SequenceMatchResult.MatchedGroupInfo<T> groupInfo(int group)
SequenceMatchResult.MatchedGroupInfo<T> groupInfo(java.lang.String var)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||