public void MeasureSentiment(string word, string pos, int sentiment) { Text.Words.IWordItem wordItem = ActualWordsHandler.InstanceSimple.WordFactory.CreateWord(word, pos); SentimentValue measurment = sentimentData.MeasureSentiment(wordItem); Assert.AreEqual(sentiment, measurment?.DataValue.Value ?? 0); }
public void Adjust(string word, double weight, double sentiment) { var table = new Dictionary <string, double>(); table[word] = weight; sentimentData = SentimentDataHolder.PopulateEmotionsData(table); Text.Words.IWordItem wordItem = ActualWordsHandler.InstanceSimple.WordFactory.CreateWord(word, "NN"); SentimentValue measurement = sentimentData.MeasureSentiment(wordItem); Assert.AreEqual(sentiment, measurement.DataValue.Value); }