Class Match

java.lang.Object
com.yahoo.prelude.semantics.engine.Match

public class Match extends Object
A match
Author:
bratseth
  • Constructor Details

    • Match

      public Match(FlattenedItem item, String replaceValue)
      Creates a match
      Parameters:
      item - the match to add
      replaceValue - the string to replace this match by, usually the item.getIndexedString() which is what the replace value will be if it is passed as null here
  • Method Details

    • getPosition

      public int getPosition()
    • getItem

      public TermItem getItem()
    • getReplaceValue

      public String getReplaceValue()
    • getParent

      public CompositeItem getParent()
      Returns the parent in which the item was matched, or null if the item was root. Note that the item may subsequently have been removed, so it does not necessarily have this parent
    • toItem

      public Item toItem(String label)
      Returns a new item representing this match
    • toItem

      public Item toItem(String label, String term)
      Returns a new item representing this match
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object