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, toString
protected 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)
Phrase
name
to value
.
NOTE: name
is case insensitive.
setParameter
in class Phrase
public 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 Phrase
public 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 Phrase
public void setEndOffset(int value)
public long getAnnotations()
getAnnotations
in interface TokenAnnotationSet
public void setAnnotations(long value)
setAnnotations
in interface TokenAnnotationSet
public void setAnnotation(TokenAnnotation value)
setAnnotation
in interface TokenAnnotationSet
public boolean containsAnnotation(TokenAnnotation value)
containsAnnotation
in interface TokenAnnotationSet
public void unsetAnnotation(TokenAnnotation value)
unsetAnnotation
in interface TokenAnnotationSet
public 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 Phrase
public Phrase rewriteChildren(PhraseHandler handler)
Phrase
handler
.
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 Phrase
Copyright © 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.