public abstract class SegmentItem extends CompositeItem implements BlockItem
Item.ItemCreator, Item.ItemType
connectedBacklink, connectedItem, connectivity, DEFAULT_WEIGHT, explicitSignificance, significance, uniqueID
Constructor and Description |
---|
SegmentItem(String rawWord,
String current,
boolean isFromQuery,
boolean stemmed)
Creates a new segment item
|
SegmentItem(String rawWord,
String current,
boolean isFromQuery,
boolean stemmed,
Substring origin)
Creates a new segment item
|
Modifier and Type | Method and Description |
---|---|
void |
addItem(int index,
Item item)
Inserts the item at a position and increases the index of existing items
starting on this position by one
|
void |
addItem(Item item) |
SegmentItem |
clone()
Return a deep copy of this object
|
void |
disclose(Discloser discloser) |
String |
getNormalized() |
int |
getNumWords() |
Substring |
getOrigin()
Returns null right now
|
String |
getRawWord()
The untransformed raw text from the user serving as base for
this item.
|
SegmentingRule |
getSegmentingRule()
If the block has to be resegmented, what operator should be chosen if it
is necessary to change operator?
|
boolean |
isFromQuery()
Is this block of text conceptually from the user query?
|
boolean |
isFromUser() |
boolean |
isLocked()
Whether this composite is in a mutable state.
|
boolean |
isStemmed() |
boolean |
isWords()
Does this item represent "usual words"?
|
void |
lock()
Make composite immutable if this is supported.
|
Item |
removeItem(int index)
Removes the item at the given index
|
boolean |
removeItem(Item item)
Removes the given item.
|
void |
setFromUser(boolean isFromUser) |
void |
setSegmentingRule(SegmentingRule segmentingRule) |
String |
stringValue()
Returns the value of this term as a string
|
adding, appendBodyString, encode, encodeThis, encodingArity, ensureNotInSubtree, equals, getItem, getItemCount, getItemIndex, getItemIterator, getTermCount, hashCode, setIndexName, setItem, shouldParenthize
addAnnotation, appendHeadingString, getAnnotation, getBytes, getCode, getCreator, getItemType, getLabel, getLanguage, getName, getParent, getWeight, hasAnnotation, hasConnectivityBackLink, hasUniqueID, isFilter, isFromSpecialToken, isProtected, isRanked, isRoot, putBytes, putString, setCreator, setFilter, setFromSpecialToken, setHasUniqueID, setLabel, setLanguage, setParent, setPositionData, setProtected, setRanked, setWeight, toString, usePositionData
finalize, getClass, notify, notifyAll, wait, wait, wait
getIndexName
public SegmentItem(String rawWord, String current, boolean isFromQuery, boolean stemmed)
rawWord
- the raw form of this segment as received in the requestcurrent
- the current transformed version of the raw form, or the raw form repeated if no normalized form is knownisFromQuery
- whether this segment stems from the query received in the requeststemmed
- whether this is stemmedpublic SegmentItem(String rawWord, String current, boolean isFromQuery, boolean stemmed, Substring origin)
rawWord
- the raw form of this segment as received in the requestcurrent
- the current transformed version of the raw form, or the raw form repeated if no normalized form is knownisFromQuery
- whether this segment stems from the query received in the requeststemmed
- whether this is stemmedorigin
- TODOpublic String getRawWord()
BlockItem
getRawWord
in interface BlockItem
public String getNormalized()
public String stringValue()
BlockItem
stringValue
in interface BlockItem
public boolean isFromQuery()
BlockItem
isFromQuery
in interface BlockItem
public void lock()
CompositeItem
lock
in class CompositeItem
public boolean isLocked()
CompositeItem
isLocked
in class CompositeItem
public int getNumWords()
getNumWords
in interface HasIndexItem
public void addItem(Item item)
addItem
in class CompositeItem
public void addItem(int index, Item item)
CompositeItem
addItem
in class CompositeItem
public Item removeItem(int index)
CompositeItem
removeItem
in class CompositeItem
index
- the index of the item to removepublic boolean removeItem(Item item)
CompositeItem
removeItem
in class CompositeItem
item
- the item to removepublic SegmentItem clone()
clone
in class CompositeItem
public boolean isWords()
BlockItem
public boolean isFromUser()
public void setFromUser(boolean isFromUser)
public Substring getOrigin()
public void disclose(Discloser discloser)
disclose
in class CompositeItem
public SegmentingRule getSegmentingRule()
BlockItem
getSegmentingRule
in interface BlockItem
public void setSegmentingRule(SegmentingRule segmentingRule)
Copyright © 2018. All rights reserved.