RecognizerResult Class

  • java.lang.Object
    • com.microsoft.bot.builder.RecognizerResult

Implements

public class RecognizerResult
implements RecognizerConvert

Contains recognition results generated by an Recognizer.

Constructor Summary

Constructor Description
RecognizerResult()

Method Summary

Modifier and Type Method and Description
void convert(Object result)

Convert recognizer result.

java.lang.String getAlteredText()

Gets the input text as modified by the recognizer, for example for spelling correction.

com.fasterxml.jackson.databind.JsonNode getEntities()

Gets the recognized top-level entities.

java.util.Map<java.lang.String,IntentScore> getIntents()

Gets the recognized intents, with the intent as key and the confidence as value.

java.util.Map<java.lang.String,com.fasterxml.jackson.databind.JsonNode> getProperties()

Gets properties that are not otherwise defined by the RecognizerResult type but that might appear in the REST JSON object.

java.lang.String getText()

Gets the input text to recognize.

NamedIntentScore getTopScoringIntent()

Return the top scoring intent and its score.

void setAlteredText(String withAlteredText)

Sets the input text as modified by the recognizer, for example for spelling correction.

void setEntities(JsonNode withEntities)

Sets the recognized top-level entities.

void setIntents(Map<String,IntentScore> withIntents)

Sets the recognized intents, with the intent as key and the confidence as value.

void setProperties(String key, JsonNode value)

Sets properties that are not otherwise defined by the RecognizerResult type but that might appear in the REST JSON object.

void setText(String withText)

Sets the input text to recognize.

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

Constructor Details

RecognizerResult

public RecognizerResult()

Method Details

convert

public void convert(Object result)

Convert recognizer result.

Parameters:

result - Result to convert.

getAlteredText

public String getAlteredText()

Gets the input text as modified by the recognizer, for example for spelling correction.

Returns:

Text modified by recognizer.

getEntities

public JsonNode getEntities()

Gets the recognized top-level entities.

Returns:

Object with each top-level recognized entity as a key.

getIntents

public Map getIntents()

Gets the recognized intents, with the intent as key and the confidence as value.

Returns:

Mapping from intent to information about the intent.

getProperties

public Map getProperties()

Gets properties that are not otherwise defined by the RecognizerResult type but that might appear in the REST JSON object.

Returns:

The extended properties for the object.

getText

public String getText()

Gets the input text to recognize.

Returns:

The original text.

getTopScoringIntent

public RecognizerResult.NamedIntentScore getTopScoringIntent()

Return the top scoring intent and its score.

Returns:

The top scoring intent and score.

Throws:

java.lang.IllegalArgumentException - No intents available.

setAlteredText

public void setAlteredText(String withAlteredText)

Sets the input text as modified by the recognizer, for example for spelling correction.

Parameters:

withAlteredText - Text modified by recognizer.

setEntities

public void setEntities(JsonNode withEntities)

Sets the recognized top-level entities.

Parameters:

withEntities - Object with each top-level recognized entity as a key.

setIntents

public void setIntents(Map withIntents)

Sets the recognized intents, with the intent as key and the confidence as value.

Parameters:

withIntents - Mapping from intent to information about the intent.

setProperties

public void setProperties(String key, JsonNode value)

Sets properties that are not otherwise defined by the RecognizerResult type but that might appear in the REST JSON object.

With this, properties not represented in the defined type are not dropped when the JSON object is deserialized, but are instead stored in this property. Such properties will be written to a JSON object when the instance is serialized.

Parameters:

key - The property key.
value - The property value.

setText

public void setText(String withText)

Sets the input text to recognize.

Parameters:

withText - The text to recognize.

Applies to