Beispiel #1
0
        private List <WordReference <T> > GetTheSearchResultsForTheSynonyms(TextIndex <T> textIndex, string suggestedWord)
        {
            var synonyms = wordBreaker.BreakWords(suggestedWord);

            var subResults = new List <WordReference <T> >();

            foreach (var synonym in synonyms)
            {
                var searchResults = textIndex[synonym.WordText];
                if (subResults.Count() == 0)
                {
                    subResults.AddRange(searchResults);
                }
                else
                {
                    subResults = subResults.Intersect(searchResults, wordReferenceEqualityComparer).ToList();
                }
            }
            return(subResults);
        }
 private IEnumerable <Word> GetTheWordsToIndex(Phrase <T> phrase)
 {
     return(wordBreaker.BreakWords(phrase.Text));
 }