/// <summary>
 ///     Updates the ngram usage count based on the sentiment and whether or not
 ///     the partialTweetText is a rewteet.
 /// </summary>
 /// <param name="ngram">The ngram.</param>
 /// <param name="isRetweet">
 ///     if set to <c>true</c> [is retweet].
 /// </param>
 /// <param name="sentiment">The sentiment.</param>
 public static void UpdateNgramUsageCount(NgramBase ngram, bool isRetweet, Sentiment sentiment)
 {
     if (isRetweet)
     {
         if (sentiment.Equals(Sentiment.Positive))
         {
             ngram.RtPositiveCount++;
         }
         else if (sentiment.Equals(Sentiment.Negative))
         {
             ngram.RtNegativeCount++;
         }
         else
         {
             ngram.RtNeutralCount++;
         }
     }
     else
     {
         if (sentiment.Equals(Sentiment.Positive))
         {
             ngram.PositiveCount++;
         }
         else if (sentiment.Equals(Sentiment.Negative))
         {
             ngram.NegativeCount++;
         }
         else
         {
             ngram.NeutralCount++;
         }
     }
 }
Пример #2
0
        public void NotEquals()
        {
            Sentiment sentiment     = new Sentiment(SentimentType.POSITIVE, WORD);
            Sentiment sameSentiment = new Sentiment(SentimentType.NEGATIVE, "Other phrase");

            Assert.IsFalse(sentiment.Equals(sameSentiment));
        }
Пример #3
0
        public void AreEquals()
        {
            Sentiment sentiment     = new Sentiment(SentimentType.POSITIVE, WORD);
            Sentiment sameSentiment = new Sentiment(SentimentType.POSITIVE, WORD);

            Assert.IsTrue(sentiment.Equals(sameSentiment));
        }
        public void TestingReduceSpace()
        {
            Sentiment sentiment = new Sentiment()
            {
                SentimientText = "Me       gusta",
                SentimentType  = Sentiment.TypeSentiment.Positive
            };
            Sentiment sentiment2 = new Sentiment()
            {
                SentimientText = "Me gusta",
                SentimentType  = Sentiment.TypeSentiment.Positive
            };
            bool areEquals = sentiment.Equals(sentiment2);

            Assert.IsTrue(areEquals);
        }
Пример #5
0
        public void EqualsDbNull()
        {
            Sentiment sentiment = new Sentiment(SentimentType.POSITIVE, WORD);

            Assert.IsFalse(sentiment.Equals(DBNull.Value));
        }
Пример #6
0
        public void EqualsNull()
        {
            Sentiment sentiment = new Sentiment(SentimentType.POSITIVE, WORD);

            Assert.IsFalse(sentiment.Equals(null));
        }