public void Benchmark(BenchmarkContext context)
 {
     foreach (var word in Words)
     {
         var result = Checker.Check(word);
         WordsChecked.Increment();
     }
 }
Exemple #2
0
            public void cant_find_words_in_empty_dictioanry(string word)
            {
                var dictionary = new WordList.Builder().ToImmutable();
                var hunspell   = new HunspellDictionary(dictionary);

                var actual = hunspell.Check(word);

                actual.Should().BeFalse();
            }
Exemple #3
0
            public void can_find_words_in_single_word_dictioanry(string searchWord, string dictionaryWord)
            {
                var expected          = searchWord == dictionaryWord;
                var dictionaryBuilder = new WordList.Builder();

                dictionaryBuilder.InitializeEntriesByRoot(1);
                dictionaryBuilder.EntriesByRoot[dictionaryWord] = WordEntrySet.TakeArray(new[] {
                    new WordEntry(
                        dictionaryWord,
                        FlagSet.Empty,
                        MorphSet.Empty,
                        WordEntryOptions.None)
                });

                var dictionary = dictionaryBuilder.ToImmutable();
                var hunspell   = new HunspellDictionary(dictionary);

                var actual = hunspell.Check(searchWord);

                actual.Should().Be(expected);
            }