public static string CollectRecommendations() { string toReturn = ""; if(likeGameDataList.Count <= 0) { return toReturn; } KeywordExtractor extractor = new KeywordExtractor(); string[] res = new string[100]; //<--magic numbers, ahh!, but I'll always only pick the first so its ok for (int j = 0; j < 100; j++) res [j] = ""; //for entire like list, uses nrake and adds to the string the first term from each //for now only take one of these! --> make it random I guess //the following only executes once, so we're just taking one keyword: { Random rnd = new Random(); int r = rnd.Next (0, likeGameDataList.Count); res = extractor.FindKeyPhrases (likeGameDataList [r].description); res[1] = likeGameDataList [r].title; toReturn = toReturn + res[0] + res [1] + " "; }//this is a bit hacky but basically I am taking the title of the "liked" game and the most popular search term from RAKE return toReturn; }
/// <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="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); }