public OfekSuggester() : base(SuggestionUtils.stopWords) { topics = SuggestionUtils.fringeTopics.Values.ToList(); foreach (Node n in trie.getAll()) { string s = n.ToString(); Histogram histogram = new Histogram(); foreach ( Topic t in topics ) histogram.add(t.historyDicti[s].getMedian()); initialDistances.Add(n.ToString() , histogram.getSorted(3*histogram.n/4)); } }
static Topic createTopic( string topic,string text ) { Trie t = new Trie(text); t.removeAll(stopWords); Trie t2 = new Trie(text); Dictionary<string , Histogram> dict = new Dictionary<string , Histogram>(); foreach ( Node wordNode in stopWords.getAll() ) { string word = wordNode.ToString(); Histogram h = new Histogram(word , text); dict.Add(word , h); } return new Topic(topic, t ,t2, dict); }