Class PatternMatchingEntity

  • All Implemented Interfaces:
    KeyedItem

    public class PatternMatchingEntity
    extends Object
    implements KeyedItem
    Represents a pattern matching entity used for intent recognition.
    • Field Detail

      • Phrases

        public Collection<String> Phrases
        A collection of strings used to match the entity for List type entities. Strict Mode means the entity must appear in the list.
    • Method Detail

      • getId

        public String getId()
        Returns the ID for this item. This will be used to retrieve the entity if it is included in the IntentRecognitionResult.
        Specified by:
        getId in interface KeyedItem
        Returns:
        Returns the ID for this item.
      • setId

        public void setId​(String id)
        Sets the ID for this item. This will be used to retrieve the entity if it is included in the IntentRecognitionResult.
        Parameters:
        id - The ID for this item.
      • CreateAnyEntity

        public static PatternMatchingEntity CreateAnyEntity​(String entityId)
        Creates a pattern matching entity using the specified intent ID.
        Parameters:
        entityId - A String that represents a unique Id for this entity.
        Returns:
        The Pattern Matching Entity being created.
      • CreateIntegerEntity

        public static PatternMatchingEntity CreateIntegerEntity​(String entityId)
        Creates a pattern matching entity using the specified intent ID. The PrebuiltInteger Entity will match words representing numbers in lexical, digit, and ordinal formats.
        Parameters:
        entityId - A String that represents a unique Id for this entity.
        Returns:
        The Pattern Matching Entity being created.
      • CreateListEntity

        public static PatternMatchingEntity CreateListEntity​(String entityId,
                                                             PatternMatchingEntity.EntityMatchMode mode,
                                                             Collection<String> phrases)
        Creates a pattern matching entity using the specified intent ID, EntityMatchMode, phrases. This entity type will match based on the phrases provided.
        Parameters:
        entityId - A string that represents a unique Id for this entity.
        mode - The EntityMatchMode for the List entity. Strict means the captured entity must appear in the phrases list.
        phrases - A list of phrases used to match the list entity.
        Returns:
        The Pattern Matching Entity being created.
      • CreateListEntity

        public static PatternMatchingEntity CreateListEntity​(String entityId,
                                                             PatternMatchingEntity.EntityMatchMode mode,
                                                             String... phrases)
        Creates a pattern matching entity using the specified intent ID, EntityMatchMode, phrases. This entity type will match based on the phrases provided.
        Parameters:
        entityId - A string that represents a unique Id for this entity.
        mode - The EntityMatchMode for the List entity. Strict means the captured entity must appear in the phrases list.
        phrases - A list of phrases used to match the list entity.
        Returns:
        The Pattern Matching Entity being created.