Aracılığıyla paylaş


PatternMatchingEntity Class

  • java.lang.Object
    • com.microsoft.cognitiveservices.speech.intent.PatternMatchingEntity

Implements

public class PatternMatchingEntity
implements KeyedItem

Represents a pattern matching entity used for intent recognition.

Field Summary

Modifier and Type Field and Description
java.util.Collection<java.lang.String> Phrases

A collection of strings used to match the entity for List type entities.

Method Summary

Modifier and Type Method and Description
static PatternMatchingEntity CreateAnyEntity(String entityId)

Creates a pattern matching entity using the specified intent ID.

static PatternMatchingEntity CreateIntegerEntity(String entityId)

Creates a pattern matching entity using the specified intent ID.

static PatternMatchingEntity CreateListEntity(String entityId, PatternMatchingEntity.EntityMatchMode mode, String[] phrases)

Creates a pattern matching entity using the specified intent ID, EntityMatchMode, phrases.

static PatternMatchingEntity CreateListEntity(String entityId, PatternMatchingEntity.EntityMatchMode mode, Collection<String> phrases)

Creates a pattern matching entity using the specified intent ID, EntityMatchMode, phrases.

java.lang.String getId()

Returns the ID for this item.

EntityMatchMode getMatchMode()

Returns the EntityMatchMode for this item.

EntityType getType()

Returns the EntityType for this item.

void setId(String id)

Sets the ID for this item.

void setMatchMode(PatternMatchingEntity.EntityMatchMode mode)

Sets the EntityMatchMode for this item.

void setType(PatternMatchingEntity.EntityType type)

Sets the EntityType for this item.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Field Details

Phrases

public Collection 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 Details

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, 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, Collection 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.

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.

Returns:

Returns the ID for this item.

getMatchMode

public PatternMatchingEntity.EntityMatchMode getMatchMode()

Returns the EntityMatchMode for this item.

Returns:

Returns the EntityMatchMode for this item.

getType

public PatternMatchingEntity.EntityType getType()

Returns the EntityType for this item.

Returns:

Returns the EntityType 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.

setMatchMode

public void setMatchMode(PatternMatchingEntity.EntityMatchMode mode)

Sets the EntityMatchMode for this item.

Parameters:

mode - The EntityMatchMode for this item.

setType

public void setType(PatternMatchingEntity.EntityType type)

Sets the EntityType for this item.

Parameters:

type - The EntityType for this item.

Applies to