Class PatternMatchingEntity
- java.lang.Object
-
- com.microsoft.cognitiveservices.speech.intent.PatternMatchingEntity
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPatternMatchingEntity.EntityMatchModeUsed to define the match mode of an entity used for intent recognition.static classPatternMatchingEntity.EntityTypeUsed to define the type of entity used for intent recognition.
-
Field Summary
Fields Modifier and Type Field Description Collection<String>PhrasesA collection of strings used to match the entity for List type entities.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PatternMatchingEntityCreateAnyEntity(String entityId)Creates a pattern matching entity using the specified intent ID.static PatternMatchingEntityCreateIntegerEntity(String entityId)Creates a pattern matching entity using the specified intent ID.static PatternMatchingEntityCreateListEntity(String entityId, PatternMatchingEntity.EntityMatchMode mode, String... phrases)Creates a pattern matching entity using the specified intent ID, EntityMatchMode, phrases.static PatternMatchingEntityCreateListEntity(String entityId, PatternMatchingEntity.EntityMatchMode mode, Collection<String> phrases)Creates a pattern matching entity using the specified intent ID, EntityMatchMode, phrases.StringgetId()Returns the ID for this item.PatternMatchingEntity.EntityMatchModegetMatchMode()Returns theEntityMatchModefor this item.PatternMatchingEntity.EntityTypegetType()Returns theEntityTypefor this item.voidsetId(String id)Sets the ID for this item.voidsetMatchMode(PatternMatchingEntity.EntityMatchMode mode)Sets theEntityMatchModefor this item.voidsetType(PatternMatchingEntity.EntityType type)Sets theEntityTypefor this item.
-
-
-
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.
-
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.
-
getMatchMode
public PatternMatchingEntity.EntityMatchMode getMatchMode()
Returns theEntityMatchModefor this item.- Returns:
- Returns the
EntityMatchModefor this item.
-
setMatchMode
public void setMatchMode(PatternMatchingEntity.EntityMatchMode mode)
Sets theEntityMatchModefor this item.- Parameters:
mode- TheEntityMatchModefor this item.
-
getType
public PatternMatchingEntity.EntityType getType()
Returns theEntityTypefor this item.- Returns:
- Returns the
EntityTypefor this item.
-
setType
public void setType(PatternMatchingEntity.EntityType type)
Sets theEntityTypefor this item.- Parameters:
type- TheEntityTypefor 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- TheEntityMatchModefor 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- TheEntityMatchModefor 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.
-
-