public static class PhraseMatcher.Phrase extends Object
Modifier and Type | Class and Description |
---|---|
private static class |
PhraseMatcher.Phrase.Matched |
private static class |
PhraseMatcher.Phrase.MatchedComposite |
private static class |
PhraseMatcher.Phrase.MatchedWord |
static class |
PhraseMatcher.Phrase.MatchIterator |
Modifier and Type | Field and Description |
---|---|
private String |
data |
private PhraseMatcher.Phrase.Matched |
matched
Points to the single or multiple words matched by this phrase
|
Modifier | Constructor and Description |
---|---|
private |
Phrase(CompositeItem owner,
List<String> replace,
int startIndex,
int length,
String data)
Creates a phrase match
|
private |
Phrase(PhraseMatcher.Phrase.Matched matched,
String data) |
|
Phrase(TermItem item,
String replace,
String data) |
Modifier and Type | Method and Description |
---|---|
int |
getBackedLength()
Returns the length of the underlying phrase
|
String |
getData()
Returns the data stored by the automaton for this phrase at this position, or null if none
|
TermItem |
getItem(int index)
Returns the n'th item in this, throws if index out of bounds
|
int |
getLength() |
CompositeItem |
getOwner()
Returns the owner, or null if this is a single item phrase with no owner
|
int |
getStartIndex() |
boolean |
isComplete()
Returns true if this phrase contains all the words of the owner, or if there is no owner
|
PhraseMatcher.Phrase.MatchIterator |
itemIterator()
Returns the items of this phrase as a read-only iterator
|
void |
remove()
Removes the word items of this phrase.
|
void |
replace()
Replaces the words items of this phrase with a phrase item.
|
String |
toString() |
private PhraseMatcher.Phrase.Matched matched
private String data
private Phrase(PhraseMatcher.Phrase.Matched matched, String data)
private Phrase(CompositeItem owner, List<String> replace, int startIndex, int length, String data)
owner
- the composite we have matched withinreplace
- the list of string to replace the matched by, or null to not replace.
This transfers ownership of this list to this class - it can not subsequently be accessed
by the caller. If this list is set, it must have the same length as length
.
No replacement is represented by null items within the list.startIndex
- the first index in composite to matchlength
- the length of the matched termsdata
- the data accompanying this matchpublic CompositeItem getOwner()
public int getStartIndex()
public int getLength()
public String getData()
public TermItem getItem(int index)
public boolean isComplete()
public void replace()
public void remove()
public int getBackedLength()
public PhraseMatcher.Phrase.MatchIterator itemIterator()
Copyright © 2018. All rights reserved.