Class SegmentItem

    • Constructor Detail

      • SegmentItem

        public SegmentItem​(java.lang.String rawWord,
                           java.lang.String current,
                           boolean isFromQuery,
                           boolean stemmed)
        Creates a new segment item
        Parameters:
        rawWord - the raw form of this segment as received in the request
        current - the current transformed version of the raw form, or the raw form repeated if no normalized form is known
        isFromQuery - whether this segment stems from the query received in the request
        stemmed - whether this is stemmed
      • SegmentItem

        public SegmentItem​(java.lang.String rawWord,
                           java.lang.String current,
                           boolean isFromQuery,
                           boolean stemmed,
                           Substring origin)
        Creates a new segment item
        Parameters:
        rawWord - the raw form of this segment as received in the request
        current - the current transformed version of the raw form, or the raw form repeated if no normalized form is known
        isFromQuery - whether this segment stems from the query received in the request
        stemmed - whether this is stemmed
        origin - TODO
    • Method Detail

      • getRawWord

        public java.lang.String getRawWord()
        Description copied from interface: BlockItem
        The untransformed raw text from the user serving as base for this item.
        Specified by:
        getRawWord in interface BlockItem
      • getNormalized

        public java.lang.String getNormalized()
      • stringValue

        public java.lang.String stringValue()
        Description copied from interface: BlockItem
        Returns the value of this term as a string
        Specified by:
        stringValue in interface BlockItem
      • isFromQuery

        public boolean isFromQuery()
        Description copied from interface: BlockItem
        Is this block of text conceptually from the user query?
        Specified by:
        isFromQuery in interface BlockItem
      • lock

        public void lock()
        Description copied from class: CompositeItem
        Make composite immutable if this is supported.
        Overrides:
        lock in class CompositeItem
      • isLocked

        public boolean isLocked()
        Description copied from class: CompositeItem
        Whether this composite is in a mutable state.
        Overrides:
        isLocked in class CompositeItem
      • getNumWords

        public int getNumWords()
        Specified by:
        getNumWords in interface HasIndexItem
        Returns:
        how many phrase words does this item contain
      • addItem

        public void addItem​(int index,
                            Item item)
        Description copied from class: CompositeItem
        Inserts the item at a position and increases the index of existing items starting on this position by one
        Overrides:
        addItem in class CompositeItem
      • removeItem

        public Item removeItem​(int index)
        Description copied from class: CompositeItem
        Removes the item at the given index
        Overrides:
        removeItem in class CompositeItem
        Parameters:
        index - the index of the item to remove
        Returns:
        the removed item
      • removeItem

        public boolean removeItem​(Item item)
        Description copied from class: CompositeItem
        Removes the given item. Does nothing if the item is not present.
        Overrides:
        removeItem in class CompositeItem
        Parameters:
        item - the item to remove
        Returns:
        whether the item was removed
      • isWords

        public boolean isWords()
        Description copied from interface: BlockItem
        Does this item represent "usual words"?
        Specified by:
        isWords in interface BlockItem
      • isFromUser

        public boolean isFromUser()
      • setFromUser

        public void setFromUser​(boolean isFromUser)
      • disclose

        public void disclose​(com.yahoo.prelude.query.textualrepresentation.Discloser discloser)
        Overrides:
        disclose in class CompositeItem
      • getSegmentingRule

        public SegmentingRule getSegmentingRule()
        Description copied from interface: BlockItem
        If the block has to be resegmented, what operator should be chosen if it is necessary to change operator?
        Specified by:
        getSegmentingRule in interface BlockItem
      • setSegmentingRule

        public void setSegmentingRule​(SegmentingRule segmentingRule)