Class EquivItem

All Implemented Interfaces:
TaggableItem, Cloneable

public class EquivItem extends CompositeTaggableItem
An Item where each child is an alternative which can be matched. Produces the same recall as Or, but differs in that the relevance of a match does not increase if more than one children is matched: With Equiv, matching one child perfectly is a perfect match.

This can only have Word, WordAlternatives, Exact, Int or Phrase children.

Author:
havardpe
  • Constructor Details

    • EquivItem

      public EquivItem()
      Makes an EQUIV item with no children
    • EquivItem

      public EquivItem(Item item)
      Creates an EQUIV with the given item as child. The new EQUIV will take connectivity, significance and weight from the given item.
      Parameters:
      item - will be modified and added as a child
    • EquivItem

      public EquivItem(Item item, Collection<String> words)
      Creates an EQUIV with the given item and a set of alternate words as children. The new EQUIV will take connectivity, significance and weight from the given item.
      Parameters:
      item - will be modified and added as a child
      words - set of words to create WordItems from
  • Method Details

    • getItemType

      public Item.ItemType getItemType()
      Description copied from class: Item
      Return the enumerated type of this item.
      Specified by:
      getItemType in class Item
    • getName

      public String getName()
      Description copied from class: Item
      Returns the name of this item
      Specified by:
      getName in class Item
    • adding

      protected void adding(Item item)
      Overrides:
      adding in class CompositeItem
    • acceptsItemsOfType

      public boolean acceptsItemsOfType(Item.ItemType itemType)
      Overrides:
      acceptsItemsOfType in class CompositeItem
    • acceptsChildrenOfType

      public static boolean acceptsChildrenOfType(Item.ItemType itemType)
      Returns true if this accepts child items of the given type