Recognition class

ru.yandex.speechkit

public class Recognition 

The complete recognition result returned by Recognizer.

The recognition result contains a list of the best recognition hypotheses (with confidence scores), in order of descending confidence (the "N-best list"). In other words, the most probable recognition result is first.

The most probable result might not be reliable enough to use it as the only confident recognition result. There is a special internal flag for indicating that the best result is sufficiently confident. If the flag is set (you can check this using isResultConfident()), you can get a reliable result using getResult().

In any case, the N-best list of hypotheses is available using getAllResults().

Constructors

Recognition(RecognitionHypothesis results, boolean hasConfidentResult)

Methods

List< String >asList()

Provides the result as a list of hypothesis strings.

RecognitionHypothesis[]getAllResults()

Returns the vector of the recognition hypothesis.

RecognitionHypothesisgetResult()

Returns the confident recognition result.

booleanisResultConfident()

Checks if a confident recognition result is available.

Constructor descriptions

Recognition

public Recognition (RecognitionHypothesis results, boolean hasConfidentResult)

Method descriptions

asList

public List< String > asList ()

Provides the result as a list of hypothesis strings.

This format is helpful for showing the results in the UI.
Note.

Note that the confidence information is lost in this case.

Returns:

list of text-only recognition hypotheses, in order of descending confidence.

getAllResults

public RecognitionHypothesis[] getAllResults ()

Returns the vector of the recognition hypothesis.

Returns:

the vector of the recognition hypothesis.

getResult

public RecognitionHypothesis getResult ()

Returns the confident recognition result.

Returns:

the confident recognition result.

isResultConfident

public boolean isResultConfident ()

Checks if a confident recognition result is available.

Returns:

true if there is a confident result, false otherwise.