/// <summary>Utility method to get the first text result from recognition</summary> /// <param name="results">Recognition result data</param> private String getResultString(Recognition results) { String output = ""; if (results.getResultCount() > 0) { output = results.getResult(0).getText(); //for (int i = 0; i < results.length; i++) // _.add("[" + results[i].getScore() + "]: " + results[i].getText()); } return output; }
/// <summary>Creates a RecoResult array representation of the results passed in to be returned to the front end</summary> /// <param name="results">Recognition result data</param> private RecoResult[] getResultArray(Recognition results) { RecoResult[] resultArray = null; int resultCount = results.getResultCount(); if (resultCount > 0) { resultArray = new RecoResult[resultCount]; System.Diagnostics.Debug.WriteLine("Recognizer.Listener.onResults: Result count: " + resultCount); for (int i = 0; i < resultCount; i++) { resultArray[i] = new RecoResult(); resultArray[i].value = results.getResult(i).getText(); resultArray[i].confidence = results.getResult(i).getScore(); } } return resultArray; }