private Result <IEnumerable <string> > GetWordsFromSource(IWordSource source) { return(Text.GetWords() .Then(words => words .Select(w => w.ToLowerInvariant()) .Select(w => Regex.Replace(w, @"(\W|\d)", string.Empty, RegexOptions.Compiled)) .Where(w => !stopWords.GetWords().GetValueOrThrow().Contains(w)))); }
public IEnumerable <Word> GetWords(int quantityWords) { var words = wordsource.GetWords(quantityWords); return(words); }