public static string ToPercentStr(this ConfidenceLevel level)
 {
     string s = level.ToString().Substring(1);
     if (s.Length > 2)
         s = s.Substring(0, 2) + "." + s.Substring(2);
     return s + "%";
 }
Exemple #2
0
        public override string ToString()
        {
            string formatFoldChange      = Formats.PEAK_FOUND_RATIO;
            string formatConfidenceLevel = Formats.CV;

            return(string.Format(@"{0} ({1} CI:{2} to {3})",
                                 FoldChange.ToString(formatFoldChange),
                                 ConfidenceLevel.ToString(formatConfidenceLevel),
                                 MinFoldChange.ToString(formatFoldChange),
                                 MaxFoldChange.ToString(formatFoldChange)));
        }
    private void DictationRecognizer_DictationResult(string text, ConfidenceLevel confidence)
    {
        Debug.Log($"DictationRecognizer_DictationResult: {text}confidence: {confidence.ToString()}");

        if (confidence == ConfidenceLevel.Rejected || confidence == ConfidenceLevel.Low)
        {
            textToSpeech.SpeakSsml("<?xml version=\"1.0\"?><speak speed=\"80%\" version=\"1.0\" xmlns=\"http://www.w3.org/2001/10/synthesis\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd\" xml:lang=\"en-US\">Sorry, but I don't understand you.</speak>");
        }

        if (!string.IsNullOrWhiteSpace(conversationId))
        {
            BotDirectLineManager.Instance.SendMessageAsync(conversationId, "AzureBootCamp2018", text).Wait();
        }
    }
            private KeywordConfidenceLevel WSAConfidenceToKeywordConfidence(ConfidenceLevel level)
            {
                KeywordConfidenceLevel newLevel = KeywordConfidenceLevel.Unknown;

                switch (level)
                {
                case ConfidenceLevel.High:
                {
                    newLevel = KeywordConfidenceLevel.High;
                    break;
                }

                case ConfidenceLevel.Medium:
                {
                    newLevel = KeywordConfidenceLevel.Medium;
                    break;
                }

                case ConfidenceLevel.Low:
                {
                    newLevel = KeywordConfidenceLevel.Low;
                    break;
                }

                case ConfidenceLevel.Rejected:
                {
                    newLevel = KeywordConfidenceLevel.Rejected;
                    break;
                }

                default:
                {
                    Debug.LogError("Unknown Confidecne Level: " + level.ToString());
                    break;
                }
                }

                return(newLevel);
            }
        public static double ToPercent(this ConfidenceLevel level)
        {
            string s = level.ToString().Substring(1);

            return(int.Parse(s) / Math.Pow(10, s.Length));
        }
Exemple #6
0
 public static int ToPercent(this ConfidenceLevel level) => int.Parse(level.ToString().Substring(1));