public class WordAlternativesItem extends TermItem
Modifier and Type | Class and Description |
---|---|
static class |
WordAlternativesItem.Alternative |
Item.ItemCreator, Item.ItemType
Modifier and Type | Field and Description |
---|---|
private List<WordAlternativesItem.Alternative> |
alternatives |
private int |
maxIndex |
connectedBacklink, connectedItem, connectivity, DEFAULT_WEIGHT, explicitSignificance, significance, uniqueID
Constructor and Description |
---|
WordAlternativesItem(String indexName,
boolean isFromQuery,
Substring origin,
Collection<WordAlternativesItem.Alternative> terms) |
Modifier and Type | Method and Description |
---|---|
void |
addTerm(String term,
double exactness)
Add a new alternative iff the term string is not already present with an
equal or higher exactness score.
|
void |
encodeThis(ByteBuffer target) |
List<WordAlternativesItem.Alternative> |
getAlternatives()
Return an immutable snapshot of the contained terms.
|
String |
getIndexedString()
Return the searchable term contents of this item.
|
Item.ItemType |
getItemType()
Return the enumerated type of this item.
|
String |
getName()
Returns the name of this item
|
int |
getNumWords() |
String |
getRawWord()
Returns the raw form of the text leading to this term, exactly as received, including original casing
|
boolean |
isStemmed() |
boolean |
isWords()
Does this item represent "usual words"?
|
void |
setAlternatives(Collection<WordAlternativesItem.Alternative> terms) |
private void |
setMaxIndex() |
void |
setValue(String value)
Sets the value of this item from a string.
|
String |
stringValue()
Returns the value of this term as a string
|
private static com.google.common.collect.ImmutableList<WordAlternativesItem.Alternative> |
uniqueAlternatives(Collection<WordAlternativesItem.Alternative> terms) |
appendBodyString, disclose, encode, getOrigin, getSegmentingRule, getTermCount, isFromQuery, isNormalizable, setNormalizable, setOrigin, setSegmentingRule
appendIndexString, equals, getIndexName, hashCode, setIndexName
getConnectedItem, getConnectivity, getSignificance, getUniqueID, hasExplicitSignificance, hasUniqueID, setConnectivity, setExplicitSignificance, setSignificance, setUniqueID
addAnnotation, appendHeadingString, clone, getAnnotation, getBytes, getCode, getCreator, getLabel, getLanguage, getParent, getWeight, hasAnnotation, hasConnectivityBackLink, isFilter, isFromSpecialToken, isProtected, isRanked, isRoot, putBytes, putString, setCreator, setFilter, setFromSpecialToken, setHasUniqueID, setLabel, setLanguage, setParent, setPositionData, setProtected, setRanked, setWeight, shouldParenthize, toString, usePositionData
finalize, getClass, notify, notifyAll, wait, wait, wait
getIndexName
private List<WordAlternativesItem.Alternative> alternatives
private int maxIndex
public WordAlternativesItem(String indexName, boolean isFromQuery, Substring origin, Collection<WordAlternativesItem.Alternative> terms)
public void setAlternatives(Collection<WordAlternativesItem.Alternative> terms)
private static com.google.common.collect.ImmutableList<WordAlternativesItem.Alternative> uniqueAlternatives(Collection<WordAlternativesItem.Alternative> terms)
private void setMaxIndex()
public String stringValue()
BlockItem
public boolean isStemmed()
public int getNumWords()
public void setValue(String value)
TermItem
public String getRawWord()
TermItem
getRawWord
in interface BlockItem
getRawWord
in class TermItem
public boolean isWords()
BlockItem
public String getIndexedString()
IndexedItem
getIndexedString
in interface IndexedItem
getIndexedString
in class SimpleIndexedItem
public Item.ItemType getItemType()
Item
getItemType
in class Item
public List<WordAlternativesItem.Alternative> getAlternatives()
public void encodeThis(ByteBuffer target)
encodeThis
in class SimpleIndexedItem
public void addTerm(String term, double exactness)
term
- one of several string interpretations of the input wordexactness
- how close the term string matches what the user inputCopyright © 2018. All rights reserved.