public void EnsureThat_RakeKeywordExtractor_Works()
        {
            RakeKeywordExtractor extractor = new RakeKeywordExtractor(StopWordsEnglish);
            var keywords = extractor.GetKeywords("RAKE is short for Rapid Automatic Keyword Extraction algorithm. " +
                                                 "It is a domain independent keyword extraction algorithm, which tries to " +
                                                 "determine key phrases in a body of text by analyzing the frequency of word " +
                                                 "appearance and its co-occurance with other words in the text.", 5);

            string[] expected = new string[] { "rake", "body", "short", "tries", "text" };

            foreach (var keyword in keywords)
            {
                if (!expected.Contains(keyword))
                {
                    Assert.Fail($"{keyword} not found");
                }
            }
        }
Exemplo n.º 2
0
 public ChapterSummarizer(IEnumerable <string> stopwords)
 {
     _keywordExtractor = new RakeKeywordExtractor(stopwords);
 }