/// <summary> /// Initializes a new instance of the <see cref="TopicKeywordExtractor"/> class. /// </summary> /// <param name="filter">The filter<see cref="NRakeCore.StopWordFilters.IStopWordFilter"/></param> public TopicKeywordExtractor(NRakeCore.StopWordFilters.IStopWordFilter filter) : this() { KeywordExtractor = new NRakeCore.KeywordExtractor(filter); }
/// <summary> /// Initializes a new instance of the <see cref="Phrase"/> class. /// </summary> /// <param name="keyword">The keyword<see cref="string"/></param> /// <param name="aggregatedLeagueTable">The aggregatedLeagueTable<see cref="SortedList{string, double}"/></param> /// <param name="topics">The topics<see cref="Topics"/></param> /// <param name="stopFilter">The stopFilter<see cref="NRakeCore.StopWordFilters.IStopWordFilter"/></param> /// <param name="rank">The rank<see cref="int"/></param> public Phrase(string keyword, SortedList <string, double> aggregatedLeagueTable, Topics topics, NRakeCore.StopWordFilters.IStopWordFilter stopFilter, int rank) : this(keyword, aggregatedLeagueTable, rank) { Topics.AddRange(topics.Where(topic => TopicKeywords(topic, stopFilter).Contains(keyword)).ToArray()); }
/// <summary> /// Initializes a new instance of the <see cref="TopicKeywordExtractor"/> class. /// </summary> /// <param name="topics">The topics<see cref="List{Topic}"/></param> /// <param name="filter">The filter<see cref="NRakeCore.StopWordFilters.IStopWordFilter"/></param> public TopicKeywordExtractor(List <Topic> topics, NRakeCore.StopWordFilters.IStopWordFilter filter) : this(topics) { KeywordExtractor = new NRakeCore.KeywordExtractor(filter); }
/// <summary> /// The TopicKeywords /// </summary> /// <param name="topic">The topic<see cref="Topic"/></param> /// <param name="stopFilter">The stopFilter<see cref="NRakeCore.StopWordFilters.IStopWordFilter"/></param> /// <returns>The <see cref="string[]"/></returns> private string[] TopicKeywords(Topic topic, NRakeCore.StopWordFilters.IStopWordFilter stopFilter) { var tke = new KeywordExtractor(stopFilter); return(tke.FindKeyPhrases(topic.GetText())); }