Package com.yahoo.prelude.query
Class TaggableSegmentItem
java.lang.Object
com.yahoo.prelude.query.Item
com.yahoo.prelude.query.CompositeItem
com.yahoo.prelude.query.SegmentItem
com.yahoo.prelude.query.TaggableSegmentItem
- All Implemented Interfaces:
BlockItem,HasIndexItem,TaggableItem,Cloneable
- Direct Known Subclasses:
IndexedSegmentItem
Common implementation for Item classes implementing the TaggableItem interface.
Note that this file exist in 3 copies that should be kept in sync:
CompositeTaggableItem.java
SimpleTaggableItem.java
TaggableSegmentItem.java
These should only have trivial differences.
(multiple inheritance or mixins would have been nice).
- Author:
- arnej27959
-
Nested Class Summary
Nested classes/interfaces inherited from class com.yahoo.prelude.query.Item
Item.ItemCreator, Item.ItemType -
Field Summary
Fields inherited from class com.yahoo.prelude.query.Item
connectedBacklink, connectedItem, connectivity, DEFAULT_WEIGHT, documentFrequency, explicitSignificance, significance, uniqueID -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTaggableSegmentItem(String rawWord, String current, boolean isFromQuery, boolean stemmed, Substring origin) -
Method Summary
Modifier and TypeMethodDescriptiondoubledoubleintbooleanbooleanvoidsetConnectivity(Item item, double connectivity) voidsetDocumentFrequency(DocumentFrequency documentFrequency) voidsetExplicitSignificance(boolean explicitSignificance) voidsetSignificance(double significance) Used for setting explicit term significance (in the tf/idf sense) to a single term or phrase, relative to the rest of the query.voidsetUniqueID(int id) Methods inherited from class com.yahoo.prelude.query.SegmentItem
addItem, addItem, clone, disclose, equals, getNormalized, getNumWords, getOrigin, getRawWord, getSegmentingRule, hashCode, isFromQuery, isFromUser, isLocked, isStemmed, isWords, lock, removeItem, removeItem, setFromUser, setSegmentingRule, setStemmed, shouldFoldIntoWand, shouldFoldIntoWand, stringValueMethods inherited from class com.yahoo.prelude.query.CompositeItem
acceptsItemsOfType, adding, appendBodyString, encode, encodeThis, encodingArity, ensureNotInSubtree, extractSingleChild, getItem, getItemCount, getItemIndex, getItemIterator, getTermCount, items, setIndexName, setItem, shouldParenthesizeMethods inherited from class com.yahoo.prelude.query.Item
addAnnotation, appendHeadingString, getAnnotation, getBytes, getCode, getCreator, getItemType, getLabel, getLanguage, getName, getParent, getWeight, hasAnnotation, hasConnectivityBackLink, hasPrefixMatchSemantics, isFilter, isFromSpecialToken, isProtected, isRanked, isRoot, putBytes, putString, setCreator, setFilter, setFromSpecialToken, setHasUniqueID, setLabel, setLanguage, setParent, setPositionData, setProtected, setRanked, setWeight, toString, usePositionDataMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.yahoo.prelude.query.HasIndexItem
getIndexName
-
Constructor Details
-
TaggableSegmentItem
-
-
Method Details
-
getUniqueID
public int getUniqueID()- Specified by:
getUniqueIDin interfaceTaggableItem
-
setUniqueID
public void setUniqueID(int id) - Specified by:
setUniqueIDin interfaceTaggableItem
-
setConnectivity
- Specified by:
setConnectivityin interfaceTaggableItem- Parameters:
item- the item this should be connected to - in practice the previous item in the query.connectivity- a value between 0 (none) and 1 (maximal), defining the connectivity between this and the argument item. The default connectivity is 0.1.
-
getConnectedItem
- Specified by:
getConnectedItemin interfaceTaggableItem
-
getConnectivity
public double getConnectivity()- Specified by:
getConnectivityin interfaceTaggableItem
-
setSignificance
public void setSignificance(double significance) Description copied from interface:TaggableItemUsed for setting explicit term significance (in the tf/idf sense) to a single term or phrase, relative to the rest of the query. This influences ranking features which take term significance into account, and overrides the default partial corpus based term significance computation in the backend.- Specified by:
setSignificancein interfaceTaggableItem
-
setExplicitSignificance
public void setExplicitSignificance(boolean explicitSignificance) - Specified by:
setExplicitSignificancein interfaceTaggableItem
-
hasExplicitSignificance
public boolean hasExplicitSignificance()- Specified by:
hasExplicitSignificancein interfaceTaggableItem
-
getSignificance
public double getSignificance()- Specified by:
getSignificancein interfaceTaggableItem
-
setDocumentFrequency
- Specified by:
setDocumentFrequencyin interfaceTaggableItem
-
getDocumentFrequency
- Specified by:
getDocumentFrequencyin interfaceTaggableItem
-
hasUniqueID
public boolean hasUniqueID()- Specified by:
hasUniqueIDin interfaceTaggableItem- Overrides:
hasUniqueIDin classItem
-