Esempio n. 1
0
 public Alert(string alert, string url, RiskLevel risk, ConfidenceLevel confidence, string parameter, string other)
     :
     this(alert, url, risk, confidence)
 {
     this.Other     = other;
     this.Parameter = parameter;
 }
Esempio n. 2
0
 public Alert(string alert, string url, RiskLevel risk, ConfidenceLevel confidence)
     :
     this(alert, url)
 {
     this.Risk       = risk;
     this.Confidence = confidence;
 }
Esempio n. 3
0
        private IntPtr Create(ConfidenceLevel minimumConfidence, DictationTopicConstraint topicConstraint)
        {
            IntPtr result;

            DictationRecognizer.INTERNAL_CALL_Create(this, minimumConfidence, topicConstraint, out result);
            return(result);
        }
Esempio n. 4
0
    /// <summary>
    /// When windows recognizes text, this will be called.
    /// </summary>
    /// <param name="text">the text that was said</param>
    /// <param name="confidence">confidence of the recongized text</param>
    private void OnDictationResult(string text, ConfidenceLevel confidence)
    {
        Debug.Log(string.Format("SpeechToText::OnDictationResult: text: {0}, confidence: {1}", text, confidence));

        // send the string to the lang engine
        Debug.Assert(LE != null);
        LE.RecieveInput(text);
    }
Esempio n. 5
0
    /// <summary>
    /// This event is fired after the user pauses, typically at the end of a sentence. The full recognized string is returned here.
    /// </summary>
    /// <param name="text">The text that was heard by the recognizer.</param>
    /// <param name="confidence">A representation of how confident (rejected, low, medium, high) the recognizer is of this recognition.</param>
    private void DictationRecognizer_DictationResult(string text, ConfidenceLevel confidence)
    {
        // 3.a: Append textSoFar with latest text
        textSoFar.Append(text + ". ");

        // 3.a: Set DictationDisplay text to be textSoFar
        speechText.GetComponent <TextMesh>().text = fixText(textSoFar.ToString());
    }
 internal PhraseRecognizedEventArgs(string text, ConfidenceLevel confidence, SemanticMeaning[] semanticMeanings, DateTime phraseStartTime, TimeSpan phraseDuration)
 {
     this.text = text;
     this.confidence = confidence;
     this.semanticMeanings = semanticMeanings;
     this.phraseStartTime = phraseStartTime;
     this.phraseDuration = phraseDuration;
 }
        /// <summary>
        /// This event is fired after the user pauses, typically at the end of a sentence. The full recognized string is returned here.
        /// </summary>
        /// <param name="text">The text that was heard by the recognizer.</param>
        /// <param name="confidence">A representation of how confident (rejected, low, medium, high) the recognizer is of this recognition.</param>
        private static void DictationRecognizer_DictationResult(string text, ConfidenceLevel confidence)
        {
            textSoFar.Append($"{text}. ");

            dictationResult = textSoFar.ToString();

            InputSystem.RaiseDictationResult(source, dictationResult);
        }
Esempio n. 8
0
 internal PhraseRecognizedEventArgs(string text, ConfidenceLevel confidence, SemanticMeaning[] semanticMeanings, DateTime phraseStartTime, TimeSpan phraseDuration)
 {
     this.text             = text;
     this.confidence       = confidence;
     this.semanticMeanings = semanticMeanings;
     this.phraseStartTime  = phraseStartTime;
     this.phraseDuration   = phraseDuration;
 }
        /// <summary>
        /// This event is fired after the user pauses, typically at the end of a sentence. The full recognized string is returned here.
        /// </summary>
        /// <param Name="text">The text that was heard by the recognizer.</param>
        /// <param Name="confidence">A representation of how confident (rejected, low, medium, high) the recognizer is of this recognition.</param>
        private static void DictationRecognizer_DictationResult(string text, ConfidenceLevel confidence)
        {
            textSoFar.Append(text + ". ");

            dictationResult = textSoFar.ToString();

            InputManager.Instance.RaiseDictationResult(Instance, 0, dictationResult);
        }
Esempio n. 10
0
    private void dictationRecognizer_DictationResult(string text, ConfidenceLevel confidence)
    {
        // Displays what the App belives was spoken and displays it in console
        Debug.LogFormat("Dictation result: {0}", text);

        // Displays what was said to the UI
        dictationDisplay.text = text;
    }
 /// <summary>
 /// Calculates Z value (z-star) for confidence interval
 /// </summary>
 /// <param name="level">ConfidenceLevel for a confidence interval</param>
 /// <param name="n">Sample size (n >= 3)</param>
 public static double GetZValue(this ConfidenceLevel level, int n)
 {
     if (n <= 2)
     {
         throw new ArgumentOutOfRangeException(nameof(n), "n should be >= 3");
     }
     return(MathHelper.InverseStudent(1 - level.ToPercent(), n - 1));
 }
 private void InvokePhraseRecognizedEvent(string text, ConfidenceLevel confidence, SemanticMeaning[] semanticMeanings, long phraseStartFileTime, long phraseDurationTicks)
 {
     PhraseRecognizedDelegate onPhraseRecognized = this.OnPhraseRecognized;
     if (onPhraseRecognized != null)
     {
         onPhraseRecognized(new PhraseRecognizedEventArgs(text, confidence, semanticMeanings, DateTime.FromFileTime(phraseStartFileTime), TimeSpan.FromTicks(phraseDurationTicks)));
     }
 }
 public SpeechKeywordRecognizedEventArgs(IInputSource inputSource, uint sourceId, ConfidenceLevel confidence, TimeSpan phraseDuration, DateTime phraseStartTime, SemanticMeaning[] semanticMeanings, string recognizedText) : base(inputSource, sourceId)
 {
     Confidence       = confidence;
     PhraseDuration   = phraseDuration;
     PhraseStartTime  = phraseStartTime;
     SemanticMeanings = semanticMeanings;
     RecognizedText   = recognizedText;
 }
Esempio n. 14
0
 private void InvokePhraseRecognizedEvent(string text, ConfidenceLevel confidence, SemanticMeaning[] semanticMeanings, long phraseStartFileTime, long phraseDurationTicks)
 {
     PhraseRecognizer.PhraseRecognizedDelegate onPhraseRecognized = this.OnPhraseRecognized;
     if (onPhraseRecognized != null)
     {
         onPhraseRecognized(new PhraseRecognizedEventArgs(text, confidence, semanticMeanings, DateTime.FromFileTime(phraseStartFileTime), TimeSpan.FromTicks(phraseDurationTicks)));
     }
 }
Esempio n. 15
0
        public void ComputeConfidenceIntervals(ConfidenceLevel level)
        {
            var se    = GetFittingErrors();
            var tstat = TStat(level);

            SlopeError     = se.Item1 * tstat;
            InterceptError = se.Item2 * tstat;
        }
Esempio n. 16
0
    /// <summary>
    /// This handler is called every time the Dictation detects a pause in the speech.
    /// Debugging message is delivered to the Results class.
    /// </summary>
    private void DictationRecognizer_DictationResult(string text, ConfidenceLevel confidence)
    {
        // Update UI with dictation captured
        Results.instance.SetSubtitleContent(text);

        // Start the coroutine that process the dictation through Azure
        //StartCoroutine(Translator.instance.TranslateWithUnityNetworking(text));
    }
Esempio n. 17
0
    /// <summary>
    /// This event is fired after the user pauses, typically at the end of a sentence. The full recognized string is returned here.
    /// </summary>
    /// <param name="text">The text that was heard by the recognizer.</param>
    /// <param name="confidence">A representation of how confident (rejected, low, medium, high) the recognizer is of this recognition.</param>
    private void DictationRecognizer_DictationResult(string text, ConfidenceLevel confidence)
    {
        // 3.a: Append textSoFar with latest text
        textSoFar.Append(text + ". ");

        // 3.a: Set DictationDisplay text to be textSoFar
        DictationDisplay.text = textSoFar.ToString();
    }
Esempio n. 18
0
        /// <summary>
        /// This event is fired after the user pauses, typically at the end of a sentence. The full recognized string is returned here.
        /// </summary>
        /// <param name="text">The text that was heard by the recognizer.</param>
        /// <param name="confidence">A representation of how confident (rejected, low, medium, high) the recognizer is of this recognition.</param>
        private void DictationRecognizer_DictationResult(string text, ConfidenceLevel confidence)
        {
            textSoFar.Append($"{text}. ");

            dictationResult = textSoFar.ToString();

            MixedRealityToolkit.InputSystem.RaiseDictationResult(inputSource, dictationResult);
        }
Esempio n. 19
0
        protected void OnPhraseRecognized(ConfidenceLevel confidence, TimeSpan phraseDuration, DateTime phraseStartTime, SemanticMeaning[] semanticMeanings, string text)
        {
            // Create input event
            speechKeywordRecognizedEventData.Initialize(this, 0, confidence, phraseDuration, phraseStartTime, semanticMeanings, text);

            // Pass handler through HandleEvent to perform modal/fallback logic
            inputManager.HandleEvent(speechKeywordRecognizedEventData, OnSpeechKeywordRecognizedEventHandler);
        }
Esempio n. 20
0
 /// <summary>
 /// Event fired when dictation completed.
 /// </summary>
 /// <param name="text">Speech to Text</param>
 /// <param name="confidence">Confidence dictation has in it's translation.</param>
 private void OnDictationResult(string text, ConfidenceLevel confidence)
 {
     if (text != null)
     {
         InputField.text.Insert(InputField.caretPosition, text);
         InputField.caretPosition += text.Length;
     }
 }
Esempio n. 21
0
 /// <summary>
 /// A listener for when the DictationRecognizer had finalized its prediction
 /// And has transcribed the recorded text as a result. Adds that to recordedText.
 /// Updates the dictation listeners with all the recorded text so far.
 /// </summary>
 /// <param name="text">The final recorded text returned by the DictationRecognizer</param>
 /// <param name="confidence">How confident the DR is in the text being accurate</param>
 public void DictationRecognizer_DictationResult(string text, ConfidenceLevel confidence)
 {
     recordedText += text + " ";
     foreach (DictationListener dictationListener in DictationListeners)
     {
         dictationListener.UpdateRecorded(recordedText);
     }
 }
Esempio n. 22
0
    /* What to do on a recognized utterance from user */
    private void DictationRecognizer_DictationResult(string text, ConfidenceLevel conf)
    {
        //on a recognized dictation from user...
        wild.finish();
        dictationRecognizer.DictationResult -= DictationRecognizer_DictationResult;

        Debug.Log(TAG + "Dictation result: " + text + " @confidence= " + conf);
    }
Esempio n. 23
0
 //DictationResult:音声が特定の認識精度で認識されたときに発生するイベント
 private void DictationRecognizer_DictationResult(string text, ConfidenceLevel confidence)
 {
     animReticle.SetBool("VoiceInput", true);
     //音声認識アニメーション終了
     ///animReticle.SetBool("VoiceInput", false);
     //Debug.Log("認識した音声:" + text);
     inputText = text;
 }
 private void DictationRecognizer_InvokeResultGeneratedEvent(string keyword, ConfidenceLevel minimumConfidence)
 {
     DictationRecognizer.DictationResultDelegate dictationResult = this.DictationResult;
     if (dictationResult != null)
     {
         dictationResult(keyword, minimumConfidence);
     }
 }
Esempio n. 25
0
        private void DictationRecognizer_InvokeResultGeneratedEvent(string keyword, ConfidenceLevel minimumConfidence)
        {
            var handler = DictationResult;

            if (handler != null)
            {
                handler(keyword, minimumConfidence);
            }
        }
Esempio n. 26
0
 public ConfidenceInterval(double mean, double error, ConfidenceLevel level = ConfidenceLevel.L95)
 {
     Mean   = mean;
     Error  = error;
     Level  = level;
     Margin = error * ZValues[level];
     Lower  = mean - Margin;
     Upper  = mean + Margin;
 }
Esempio n. 27
0
 /// <summary>
 /// Function that is called when a final text result is received.
 /// </summary>
 /// <param name="text">The final text result</param>
 /// <param name="confidence">Confidence level of the text result</param>
 void OnDictationResult(string text, ConfidenceLevel confidence)
 {
     SmartLogger.LogFormat(DebugFlags.WindowsSpeechToText, "Dictation result: {0}", text);
     m_LastResult = new SpeechToTextResult(text, true);
     if (m_OnTextResult != null)
     {
         m_OnTextResult(m_LastResult);
     }
 }
Esempio n. 28
0
        /// <summary>
        /// This event is fired after the user pauses, typically at the end of a sentence. The full recognized string is returned here.
        /// </summary>
        /// <param name="text">The text that was heard by the recognizer.</param>
        /// <param name="confidence">A representation of how confident (rejected, low, medium, high) the recognizer is of this recognition.</param>
        private void DictationRecognizer_DictationResult(string text, ConfidenceLevel confidence)
        {
            textSoFar.Append(text + ". ");

            dictationResult = textSoFar.ToString();

            speechToTextOutput.text = text;
            LUIS.GetLuisPrediction(text);
        }
Esempio n. 29
0
    /// <summary>
    /// This handler is called every time the Dictation detects a pause in the speech. 
    /// </summary>
    private void DictationRecognizer_DictationResult(string text, ConfidenceLevel confidence)
    {
        // Update UI with dictation captured
        Debug.Log($"User just said: {text}");

        // Send dictation to Bot
        StartCoroutine(SendMessageToBot(text, botId, botName, "message"));
        StopCapturingAudio();
    }
Esempio n. 30
0
    private void DictationRecognizer_DictationResult(string text, ConfidenceLevel confidence)
    {
        GameObject holoMenu = null;

        Debug.Log("String heard: " + text);
        dictationRecognizer.Stop();


        // Cases to set holoMenu to the correct menu
        if (text.ToLower().Equals("main") || text.ToLower().Equals("main menu") || text.ToLower().Equals("maine") || text.ToLower().Equals("mean"))
        {
            holoMenu = mc.m_mainMenu;
        }
        else if (text.ToLower().Equals("biometrics"))
        {
            holoMenu = mc.m_biometricsMenu;
        }
        else if (text.ToLower().Equals("help"))
        {
            holoMenu = mc.m_helpMenu;
        }
        else if (text.ToLower().Equals("music"))
        {
            holoMenu = mc.m_musicMenu;
        }
        else if (text.ToLower().Equals("settings"))
        {
            holoMenu = mc.m_settingsMenu;
        }
        else if (text.ToLower().Equals("brightness"))
        {
            holoMenu = mc.m_brightnessMenu;
        }
        else if (text.ToLower().Equals("volume"))
        {
            holoMenu = mc.m_volumeMenu;
        }
        else if (text.ToLower().Equals("procedure"))
        {
            holoMenu = mc.m_blankTaskMenu;
        }
        else
        {
            Debug.Log("Cmd not recognized.");
            // This does not fail eloquently
        }


        // call function in MenuController to retrieve the specific menu
        if (holoMenu != null)
        {
            mc.Retrieve(holoMenu);
        }

        dictationRecognizer.Dispose();
        PhraseRecognitionSystem.Restart();
    }
Esempio n. 31
0
 /// <summary>
 /// Populates the event with data.
 /// </summary>
 /// <param name="inputSource"></param>
 /// <param name="inputAction"></param>
 /// <param name="confidence"></param>
 /// <param name="phraseDuration"></param>
 /// <param name="phraseStartTime"></param>
 /// <param name="semanticMeanings"></param>
 /// <param name="recognizedText"></param>
 public void Initialize(IMixedRealityInputSource inputSource, MixedRealityInputAction inputAction, ConfidenceLevel confidence, TimeSpan phraseDuration, DateTime phraseStartTime, SemanticMeaning[] semanticMeanings, string recognizedText)
 {
     BaseInitialize(inputSource, inputAction);
     Confidence       = confidence;
     PhraseDuration   = phraseDuration;
     PhraseStartTime  = phraseStartTime;
     SemanticMeanings = semanticMeanings;
     RecognizedText   = recognizedText;
 }
 public void Initialize(IInputSource inputSource, uint sourceId, object tag, ConfidenceLevel confidence, TimeSpan phraseDuration, DateTime phraseStartTime, SemanticMeaning[] semanticMeanings, string recognizedText)
 {
     BaseInitialize(inputSource, sourceId, tag);
     Confidence       = confidence;
     PhraseDuration   = phraseDuration;
     PhraseStartTime  = phraseStartTime;
     SemanticMeanings = semanticMeanings;
     RecognizedText   = recognizedText;
 }
 public ConfidenceInterval(double mean, double error, ConfidenceLevel level = ConfidenceLevel.L95)
 {
     Mean = mean;
     Error = error;
     Level = level;
     Margin = error * ZValues[level];
     Lower = mean - Margin;
     Upper = mean + Margin;
 }
Esempio n. 34
0
		public BingAddress(string formattedAddress, Location coordinates, string addressLine, string adminDistrict, string adminDistrict2,
			string countryRegion, string locality, string postalCode, EntityType type, ConfidenceLevel confidence)
			: base(formattedAddress, coordinates, "Bing")
		{
			this.addressLine = addressLine;
			this.adminDistrict = adminDistrict;
			this.adminDistrict2 = adminDistrict2;
			this.countryRegion = countryRegion;
			this.locality = locality;
			this.postalCode = postalCode;
			this.type = type;
			this.confidence = confidence;
		}
Esempio n. 35
0
 public Alert(string alert, string url, RiskLevel risk, ConfidenceLevel confidence,
     string parameter, string other, string attack, string description, string reference, string solution,
     string evidence, int cweId, int wascId)
     : this(alert, url, risk, confidence, parameter, other)
 {
     this.Attack = attack;
     this.Description = description;
     this.Reference = reference;
     this.Solution = solution;
     this.Evidence = evidence;
     this.CWEId = cweId;
     this.WASCId = wascId;
 }
 private void DictationRecognizer_InvokeResultGeneratedEvent(string keyword, ConfidenceLevel minimumConfidence)
 {
     DictationResultDelegate dictationResult = this.DictationResult;
     if (dictationResult != null)
     {
         dictationResult(keyword, minimumConfidence);
     }
 }
 public static IColumn CiUpper(ConfidenceLevel level) => new StatisticColumn($"CI {level.ToPercent()}% Upper",
     s => new ConfidenceInterval(s.Mean, s.StandardError, level).Upper);
 /// <summary>
 /// Overloaded constructor
 /// </summary>
 /// <param name="statistics">Basic statistics for data</param>
 /// <param name="level">Chosen confidence level</param>
 public ConfidenceIntervalStandardNormal(BasicStatistics statistics, ConfidenceLevel level)
 {
     this.statistics = statistics;
     this.level = level;
 }
 /// <summary>
 /// Creates a confidence query string parameter.
 /// </summary>
 /// <param name="confidence">The value to use in the confidence query string parameter. See remarks.</param>
 /// <returns>A confidence query string parameter.</returns>
 /// <remarks>
 /// This could be used, for example, to specify the level of confidence required during certain merge operations.
 /// </remarks>
 public static QueryParameter Confidence(ConfidenceLevel confidence)
 {
     return new QueryParameter(true, CONFIDENCE, XmlQNameEnumUtil.GetNameValue(confidence));
 }
 /// <summary>
 /// <para>Create a DictationRecognizer with the specified minimum confidence and dictation topic constraint. Phrases under the specified minimum level will be ignored.</para>
 /// </summary>
 /// <param name="minimumConfidence">The confidence level at which the recognizer will begin accepting phrases.</param>
 /// <param name="topic">The dictation topic that this dictation recognizer should optimize its recognition for.</param>
 /// <param name="confidenceLevel"></param>
 public DictationRecognizer(ConfidenceLevel minimumConfidence, DictationTopicConstraint topic)
 {
     this.m_Recognizer = this.Create(minimumConfidence, topic);
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="statsVariable1">Statistics object for variable 1</param>
 /// <param name="statsVariable2">Statistics object for variable 2</param>
 public ConfidenceIntervalForMeanDifference(BasicStatistics statsVariable1, BasicStatistics statsVariable2)
 {
     this.statsVariable1 = statsVariable1;
     this.statsVariable2 = statsVariable2;
     this.level = ConfidenceLevel.NinetyFive;
 }
Esempio n. 42
0
 public Alert(string alert, string url, RiskLevel risk, ConfidenceLevel confidence, string parameter, string other)
     : this(alert, url, risk, confidence)
 {
     this.Other = other;
     this.Parameter = parameter;
 }
Esempio n. 43
0
 public Alert(string alert, string url, RiskLevel risk, ConfidenceLevel confidence)
     : this(alert, url)
 {
     this.Risk = risk;
     this.Confidence = confidence;
 }
 /// <summary>
 /// Overloaded constructor
 /// </summary>
 /// <param name="statsVariable1">Statistics object for variable 1</param>
 /// <param name="statsVariable2">Statistics object for variable 2</param>
 /// <param name="level">Chosen confidence level</param>
 public ConfidenceIntervalForMeanDifference(BasicStatistics statsVariable1, BasicStatistics statsVariable2, ConfidenceLevel level)
 {
     this.statsVariable1 = statsVariable1;
     this.statsVariable2 = statsVariable2;
     this.level = level;
 }
 public static IColumn CiLower(ConfidenceLevel level) => new StatisticColumn($"CI {level.ToPercent()}% Lower",
     s => new ConfidenceInterval(s.Mean, s.StandardError, level).Lower, Priority.Additional);
 private static extern void INTERNAL_CALL_Create(DictationRecognizer self, ConfidenceLevel minimumConfidence, DictationTopicConstraint topicConstraint, out IntPtr value);
 private static extern void INTERNAL_CALL_CreateFromKeywords(PhraseRecognizer self, string[] keywords, ConfidenceLevel minimumConfidence, out IntPtr value);
 /// <summary>
 /// <para>Create a DictationRecognizer with the specified minimum confidence and dictation topic constraint. Phrases under the specified minimum level will be ignored.</para>
 /// </summary>
 /// <param name="minimumConfidence">The confidence level at which the recognizer will begin accepting phrases.</param>
 /// <param name="topic">The dictation topic that this dictation recognizer should optimize its recognition for.</param>
 /// <param name="confidenceLevel"></param>
 public DictationRecognizer(ConfidenceLevel confidenceLevel) : this(confidenceLevel, DictationTopicConstraint.Dictation)
 {
 }
 private static extern void INTERNAL_CALL_CreateFromGrammarFile(PhraseRecognizer self, string grammarFilePath, ConfidenceLevel minimumConfidence, out IntPtr value);
 private IntPtr Create(ConfidenceLevel minimumConfidence, DictationTopicConstraint topicConstraint)
 {
     IntPtr ptr;
     INTERNAL_CALL_Create(this, minimumConfidence, topicConstraint, out ptr);
     return ptr;
 }
 protected IntPtr CreateFromKeywords(string[] keywords, ConfidenceLevel minimumConfidence)
 {
     IntPtr ptr;
     INTERNAL_CALL_CreateFromKeywords(this, keywords, minimumConfidence, out ptr);
     return ptr;
 }
 /// <summary>
 /// Constructor: assumes 95% confidence level
 /// </summary>
 /// <param name="statistics">Basic statistics for data</param>
 public ConfidenceIntervalStandardNormal(BasicStatistics statistics)
 {
     this.statistics = statistics;
     this.level = ConfidenceLevel.NinetyFive;
 }
 protected IntPtr CreateFromGrammarFile(string grammarFilePath, ConfidenceLevel minimumConfidence)
 {
     IntPtr ptr;
     INTERNAL_CALL_CreateFromGrammarFile(this, grammarFilePath, minimumConfidence, out ptr);
     return ptr;
 }
 public ConfidenceInterval GetConfidenceInterval(ConfidenceLevel level) => new ConfidenceInterval(Mean, StandardError, level);
Esempio n. 55
0
 /**
  * Build up this conclusion with a confidence level.
  *
  * @param confidence The confidence level.
  * @return this.
  */
 public Conclusion SetConfidence(ConfidenceLevel confidence)
 {
     KnownConfidence = confidence;
     return this;
 }