internal DocumentSentiment(TextSentiment sentiment, double positiveScore, double neutralScore, double negativeScore, List <SentenceSentiment> sentenceSentiments, IList <TextAnalyticsWarning> warnings) { Sentiment = sentiment; ConfidenceScores = new SentimentConfidenceScores(positiveScore, neutralScore, negativeScore); Sentences = new ReadOnlyCollection <SentenceSentiment>(sentenceSentiments); Warnings = new ReadOnlyCollection <TextAnalyticsWarning>(warnings); }
internal AspectSentiment(TextSentiment sentiment, string text, double positiveScore, double negativeScore, int offset) { Sentiment = sentiment; Text = text; ConfidenceScores = new SentimentConfidenceScores(positiveScore, _neutralValue, negativeScore); Offset = offset; }
internal SentenceSentiment(TextSentiment sentiment, string text, double positiveScore, double neutralScore, double negativeScore, IReadOnlyList <MinedOpinion> minedOpinions) { Sentiment = sentiment; Text = text; ConfidenceScores = new SentimentConfidenceScores(positiveScore, neutralScore, negativeScore); MinedOpinions = new List <MinedOpinion>(minedOpinions); }
internal OpinionSentiment(TextSentiment sentiment, double positiveScore, double negativeScore, string text, bool isNegated) { Sentiment = sentiment; ConfidenceScores = new SentimentConfidenceScores(positiveScore, _neutralValue, negativeScore); Text = text; IsNegated = isNegated; }
internal TargetSentiment(TextSentiment sentiment, string text, double positiveScore, double negativeScore, int offset, int length) { Sentiment = sentiment; Text = text; ConfidenceScores = new SentimentConfidenceScores(positiveScore, _neutralValue, negativeScore); Offset = offset; Length = length; }
internal AspectSentiment(SentenceAspect sentenceAspect) { _ = sentenceAspect ?? throw new ArgumentNullException(nameof(sentenceAspect)); Text = sentenceAspect.Text; ConfidenceScores = new SentimentConfidenceScores(sentenceAspect.ConfidenceScores.Positive, _neutralValue, sentenceAspect.ConfidenceScores.Negative); Sentiment = (TextSentiment)Enum.Parse(typeof(TextSentiment), sentenceAspect.Sentiment, ignoreCase: true); }
internal AssessmentSentiment(TextSentiment sentiment, double positiveScore, double negativeScore, string text, bool isNegated, int offset, int length) { Sentiment = sentiment; ConfidenceScores = new SentimentConfidenceScores(positiveScore, _neutralValue, negativeScore); Text = text; IsNegated = isNegated; Offset = offset; Length = length; }
internal SentenceSentiment(TextSentiment sentiment, string text, double positiveScore, double neutralScore, double negativeScore, int offset, int length, IReadOnlyList <SentenceOpinion> opinions) { Sentiment = sentiment; Text = text; ConfidenceScores = new SentimentConfidenceScores(positiveScore, neutralScore, negativeScore); Offset = offset; Length = length; Opinions = new List <SentenceOpinion>(opinions); }
internal OpinionSentiment(SentenceOpinion opinion) { _ = opinion ?? throw new ArgumentNullException(nameof(opinion)); Text = opinion.Text; ConfidenceScores = new SentimentConfidenceScores(opinion.ConfidenceScores.Positive, _neutralValue, opinion.ConfidenceScores.Negative); Sentiment = (TextSentiment)Enum.Parse(typeof(TextSentiment), opinion.Sentiment, ignoreCase: true); IsNegated = opinion.IsNegated; }
internal TargetSentiment(SentenceTarget sentenceTarget) { _ = sentenceTarget ?? throw new ArgumentNullException(nameof(sentenceTarget)); Text = sentenceTarget.Text; ConfidenceScores = new SentimentConfidenceScores(sentenceTarget.ConfidenceScores.Positive, _neutralValue, sentenceTarget.ConfidenceScores.Negative); Sentiment = (TextSentiment)Enum.Parse(typeof(TextSentiment), sentenceTarget.Sentiment.ToString(), ignoreCase: true); Offset = sentenceTarget.Offset; Length = sentenceTarget.Length; }
internal AssessmentSentiment(SentenceAssessment assessment) { _ = assessment ?? throw new ArgumentNullException(nameof(assessment)); Text = assessment.Text; ConfidenceScores = new SentimentConfidenceScores(assessment.ConfidenceScores.Positive, _neutralValue, assessment.ConfidenceScores.Negative); Sentiment = (TextSentiment)Enum.Parse(typeof(TextSentiment), assessment.Sentiment, ignoreCase: true); IsNegated = assessment.IsNegated; Offset = assessment.Offset; Length = assessment.Length; }
internal SentenceSentiment(TextSentiment sentiment, string text, double positiveScore, double neutralScore, double negativeScore, int offset, int length, IReadOnlyList <SentenceOpinion> opinions) { // We shipped TA 5.0.0 Text == string.Empty if the service returned a null value for Text. // Because we don't want to introduce a breaking change, we are transforming that null to string.Empty Text = text ?? string.Empty; Sentiment = sentiment; ConfidenceScores = new SentimentConfidenceScores(positiveScore, neutralScore, negativeScore); Offset = offset; Length = length; Opinions = new List <SentenceOpinion>(opinions); }
internal SentenceSentiment(TextSentiment sentiment, string text, double positiveScore, double neutralScore, double negativeScore) { Sentiment = sentiment; Text = text; ConfidenceScores = new SentimentConfidenceScores(positiveScore, neutralScore, negativeScore); }