public abstract class PhraseTerm extends Phrase implements TokenAnnotationSet
Phrase.Parameter| Modifier and Type | Field and Description |
|---|---|
protected long |
annotations
Arbitrary token annotations.
|
protected int |
endOffset |
protected int |
startOffset |
parameters| Modifier | Constructor and Description |
|---|---|
protected |
PhraseTerm()
Constructor.
|
protected |
PhraseTerm(PhraseTerm base)
Constructor.
|
protected |
PhraseTerm(TokenAnnotation... annotation)
Constructor.
|
protected |
PhraseTerm(TokenAnnotation annotation)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsAnnotation(TokenAnnotation value)
Returns true if the specified annotation is set.
|
boolean |
containsParameters(boolean compact)
Does this phrase operand contain any parameters in a non-default state.
|
boolean |
equals(Object other) |
long |
getAnnotations()
Get all set token annotations as a bit mask.
|
int |
getEndOffset()
Get the end offset (0 indexed, exclusive) for this term in the original query string.
|
int |
getStartOffset()
Get the start offset (0 indexed, inclusive) for this term in the original query string.
|
int |
hashCode() |
int |
offsetGap(PhraseTerm previous)
Get the offset gap between
previous and this term. |
Phrase |
rewriteChildren(PhraseHandler handler)
Rewrite any children of this phrase using
handler. |
void |
setAnnotation(TokenAnnotation value)
Set a TokenAnnotation.
|
void |
setAnnotations(long value)
Set the token annotations from a bit mask.
|
void |
setEndOffset(int value)
Set the end offset (0 indexed, exclusive) for this term in the original query string.
|
void |
setParameter(String name,
Object value)
Set parameter
name to value. |
void |
setStartOffset(int value)
Set the start offset (0 indexed, inclusive) for this term in the original query string.
|
void |
unsetAnnotation(TokenAnnotation value)
Unset a TokenAnnotation.
|
clone, containsParameters, copyParameters, getBoost, getParameter, getParameter, getParameter, getParameter, getParameterInternal, isMatchAll, parameters, parseIntParameter, removeParameter, rewrite, setBoost, setParameters, toArray, toString, toString, toStringprotected int startOffset
protected int endOffset
protected long annotations
protected PhraseTerm()
protected PhraseTerm(TokenAnnotation annotation)
protected PhraseTerm(TokenAnnotation... annotation)
protected PhraseTerm(PhraseTerm base)
public void setParameter(String name, Object value)
Phrasename to value.
NOTE: name is case insensitive.
setParameter in class Phrasepublic int getStartOffset()
This value is set during parsing and indicates the start offset into the original query string that this term represents. In general, offsets should not be set/modified by query transformers and it is recommended that start and end offsets are set to zero when cloning.
NOTE: if Phrase.getStartOffset() == Phrase.getEndOffset(), this indicates that the term did not come from a parsed query string.
getStartOffset in class Phrasepublic void setStartOffset(int value)
public int getEndOffset()
This value is set during parsing and indicates the end offset of the original query string that this term represents. In general, offsets should not be set/modified by query transformers and it is recommended that start and end offsets are set to zero when cloning.
NOTE: if Phrase.getStartOffset() == Phrase.getEndOffset(), this indicates that the term did not come from a parsed query string.
getEndOffset in class Phrasepublic void setEndOffset(int value)
public long getAnnotations()
getAnnotations in interface TokenAnnotationSetpublic void setAnnotations(long value)
setAnnotations in interface TokenAnnotationSetpublic void setAnnotation(TokenAnnotation value)
setAnnotation in interface TokenAnnotationSetpublic boolean containsAnnotation(TokenAnnotation value)
containsAnnotation in interface TokenAnnotationSetpublic void unsetAnnotation(TokenAnnotation value)
unsetAnnotation in interface TokenAnnotationSetpublic int offsetGap(PhraseTerm previous)
previous and this term.
NOTE: if this term or the previous term do not contain offsets, 1 is returned.
NOTE: Returns 0 if previous is null.
public boolean containsParameters(boolean compact)
If compact is true this will only return true if at least one parameter
in the compact representation of this phrase exists.
containsParameters in class Phrasepublic Phrase rewriteChildren(PhraseHandler handler)
Phrasehandler.
Returns the modified phrase, which may be null if all children were removed by handler.
This method may have no effect if this Phrase represents a leaf in the tree.
NOTE: child phrases are not recursively traversed.
rewriteChildren in class PhraseCopyright © 2018 Attivio, Inc. All Rights Reserved.
PATENT NOTICE: Attivio, Inc. Software Related Patents. With respect to the Attivio software product(s) being used, the following patents apply: Querying Joined Data Within A Search Engine Index: United States Patent No.(s): 8,073,840. Ordered Processing of Groups of Messages: U.S. Patent No.(s) 8,495,656. Signal processing approach to sentiment analysis for entities in documents: U.S. Patent No.(s) 8,725,494. Other U.S. and International Patents Pending.