void SpeakAction(object o) { RaiseNarrationEventWithPossibleWordCompletion(o, NarrationEventType.Utter); if (_environment.AppSettings.Keyboard.IsTrainingMode) { if (!IsAllSelected) { TrainingPhrasePrevious = TrainingPhrase; TrainingScore = LevenshtienDistanceScore(TextSlice.Text, TrainingPhrase); TrainingKeysUsed = _trainingKeyCount; var duration = DateTime.UtcNow - _trainingStartTime; TrainingWpm = TextSlice.Text.Length / 5.0 / duration.TotalMinutes; TrainingVisibility = Visibility.Visible; SetTrainingPhrase(); } } else { TrainingVisibility = Visibility.Collapsed; } TextSlice = _editor.SelectAll(); _isAutoSpaceNeeded = false; _predictor.RecordHistory(TextSlice.Text, IsInPrivate); TelemetryMessage.Telemetry.TraceEvent(TraceEventType.Information, IdMapper.GetId(EventId.PhrasesSpoken), "1"); var words = TextSlice.Text.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Length; TelemetryMessage.Telemetry.TraceEvent(TraceEventType.Information, IdMapper.GetId(EventId.WordsSpoken), words.ToString()); }
public void RecordHistory(string text, bool isInPrivate) { innerPredictor.RecordHistory(text, isInPrivate); }