public Word(string name) { this.name = name; frequency = 1; capitalisedWordWeight = 0; followingWords = new WeightedWordDict(); associations = new WordSet(); }
public WeightedWordDict GetRelatedWords(WeightedWordDict words, WordSet relations) { WeightedWordDict relatedWords = new WeightedWordDict(); foreach ( KeyValuePair<Word, int> pair in words ) { if ( relations.Contains(pair.Key) ) { relatedWords.Add(pair); } } return relatedWords; }