public override TextUtils.TextIndexList Ranges(string text) { WordsSelector ws = new WordsSelector() { IsCaseSensitive = IsCaseSensitive, Words = mWords }; return(ws.SelectIndexes(text)); }
public BackwardChoiceExercise(Word word) { var translation = selectCorectTranslation(word); Question = new ChoiceQuestion { Text = translation.Spelling }; var wordSelector = new WordsSelector(App.WordStorage, null); var words = wordSelector.SelectWordsForTranslation(translation, 3) .Select(x=>new ChoiceAnswer { Text = x.Spelling, IsCorrect = false }) .ToList(); correctAnswer = new ChoiceAnswer { Text = word.Spelling, IsCorrect = true }; words.Add(correctAnswer); foreach (var answer in WordsSelector.takeRandom(words)) { Answers.Add(answer); } playSound = new PlaySound(word, App.TextToSpeech); }
public void StartNewTraining(Vocabulary vocabulary) { System.Diagnostics.Debug.WriteLine("Starting new training..."); DateTime from = DateTime.Now; WordsSelector ws = new WordsSelector(App.WordStorage, vocabulary); words.Clear(); words.AddRange(ws.SelectWordsForTraining(10)); System.Diagnostics.Debug.WriteLine("Trainign created in {0}ms", (DateTime.Now - from).TotalMilliseconds); this.NewWordsSeenCount = 0; this.CorrectAnswersCount = 0; WordsCount = 0; //words.Count; wordIndex = -1; }