Exemplo n.º 1
0
 /// <inheritdoc cref="ISpellChecker.Check"/>
 public void Check()
 {
     foreach (var textLine in _inputReader.GetTextLines())
     {
         StringBuilder sb = new StringBuilder(textLine.Length);
         if (!string.IsNullOrWhiteSpace(textLine))
         {
             var textWords = textLine.Split(' ');
             foreach (var textWord in textWords)
             {
                 if (_dictionary.ContainsWord(textWord))
                 {
                     sb.Append($"{textWord} ");
                 }
                 else
                 {
                     var dictionaryWords = _dictionary.GetDictionaryValuesByWord(textWord);
                     sb.Append($"{_editor.Edit(textWord, dictionaryWords)} ");
                 }
             }
             _outputWriter.WriteLine(sb.ToString().TrimEnd(' '));
         }
         else
         {
             return;
         }
     }
 }