Пример #1
0
 public Word(string name, int count, double probability, Topic topic)
 {
     this.Name = name;
     this.Count = count;
     this.Probability = probability;
     this.Topic = topic;
 }
 private int GetAmountOfWordsAssignedTopic(Topic topic)
 {
     int amount = 0;
     foreach (Document doc in Documents)
     {
         amount += doc.Words.Count(w => w.Topic == topic);
     }
     return amount;
 }
 private int GetTimesWordsAssignedTopic(Word word, Topic topic)
 {
     int amount = 0;
     foreach (Document doc in Documents)
     {
         amount += doc.Words.Count(w => w.Topic == topic && w.Name.Equals(word.Name));
     }
     return amount;
 }