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 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 AspectSentiment(TextSentiment sentiment, string text, double positiveScore, double negativeScore, int offset) { Sentiment = sentiment; Text = text; ConfidenceScores = new SentimentConfidenceScores(positiveScore, _neutralValue, negativeScore); Offset = offset; }
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 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 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); }
/// <summary> /// Initializes a new instance of <see cref="TextAnalytics.OpinionSentiment"/> for mocking purposes. /// </summary> /// <param name="sentiment">Sets the <see cref="OpinionSentiment.Sentiment"/> property.</param> /// <param name="positiveScore">Sets the <see cref="SentimentConfidenceScores.Positive"/> property.</param> /// <param name="negativeScore">Sets the <see cref="SentimentConfidenceScores.Negative"/> property.</param> /// <param name="text">Sets the <see cref="OpinionSentiment.Text"/> property.</param> /// <param name="isNegated">Sets the <see cref="OpinionSentiment.IsNegated"/> property.</param> /// <returns>A new instance of <see cref="TextAnalytics.OpinionSentiment"/> for mocking purposes.</returns> public static OpinionSentiment OpinionSentiment(TextSentiment sentiment, double positiveScore, double negativeScore, string text, bool isNegated) { return(new OpinionSentiment(sentiment, positiveScore, negativeScore, text, isNegated)); }
/// <summary> /// Initializes a new instance of <see cref="TextAnalytics.AspectSentiment"/> for mocking purposes. /// </summary> /// <param name="sentiment">Sets the <see cref="AspectSentiment.Sentiment"/> property.</param> /// <param name="text">Sets the <see cref="AspectSentiment.Text"/> property.</param> /// <param name="positiveScore">Sets the <see cref="SentimentConfidenceScores.Positive"/> property.</param> /// <param name="negativeScore">Sets the <see cref="SentimentConfidenceScores.Negative"/> property.</param> /// <returns>>A new instance of <see cref="TextAnalytics.AspectSentiment"/> for mocking purposes.</returns> public static AspectSentiment AspectSentiment(TextSentiment sentiment, string text, double positiveScore, double negativeScore) { return(new AspectSentiment(sentiment, text, positiveScore, negativeScore)); }
/// <summary> /// Initializes a new instance of <see cref="TextAnalytics.SentenceSentiment"/> for mocking purposes. /// </summary> /// <param name="sentiment">Sets the <see cref="SentenceSentiment.Sentiment"/> property.</param> /// <param name="text">Sets the <see cref="SentenceSentiment.Text"/> property.</param> /// <param name="positiveScore">Sets the <see cref="SentimentConfidenceScores.Positive"/> property.</param> /// <param name="neutralScore">Sets the <see cref="SentimentConfidenceScores.Neutral"/> property.</param> /// <param name="negativeScore">Sets the <see cref="SentimentConfidenceScores.Negative"/> property.</param> /// <param name="minedOpinions">Sets the <see cref="SentenceSentiment.MinedOpinions"/> property.</param> /// <returns>A new instance of <see cref="TextAnalytics.SentenceSentiment"/> for mocking purposes.</returns> public static SentenceSentiment SentenceSentiment(TextSentiment sentiment, string text, double positiveScore, double neutralScore, double negativeScore, IReadOnlyList <MinedOpinion> minedOpinions) { minedOpinions ??= new List <MinedOpinion>(); return(new SentenceSentiment(sentiment, text, positiveScore, neutralScore, negativeScore, minedOpinions)); }
/// <summary> /// Initializes a new instance of <see cref="TextAnalytics.SentenceSentiment"/> for mocking purposes. /// </summary> /// <param name="sentiment">Sets the <see cref="SentenceSentiment.Sentiment"/> property.</param> /// <param name="text">Sets the <see cref="SentenceSentiment.Text"/> property.</param> /// <param name="positiveScore">Sets the <see cref="SentimentConfidenceScores.Positive"/> property.</param> /// <param name="neutralScore">Sets the <see cref="SentimentConfidenceScores.Neutral"/> property.</param> /// <param name="negativeScore">Sets the <see cref="SentimentConfidenceScores.Negative"/> property.</param> /// <returns>A new instance of <see cref="TextAnalytics.SentenceSentiment"/> for mocking purposes.</returns> public static SentenceSentiment SentenceSentiment(TextSentiment sentiment, string text, double positiveScore, double neutralScore, double negativeScore) { return(new SentenceSentiment(sentiment, text, positiveScore, neutralScore, negativeScore)); }
public static string ToSerialString(this TextSentiment value) => value switch {
public static SentenceSentiment SentenceSentiment(TextSentiment sentiment, string text, double positiveScore, double neutralScore, double negativeScore) { return(new SentenceSentiment(sentiment, text, positiveScore, neutralScore, negativeScore, default, default, new List <MinedOpinion>()));
/// <summary> /// Initializes a new instance of <see cref="TextAnalytics.SentenceSentiment"/> for mocking purposes. /// </summary> /// <param name="sentiment">Sets the <see cref="SentenceSentiment.Sentiment"/> property.</param> /// <param name="positiveScore">Sets the <see cref="SentimentConfidenceScores.Positive"/> property.</param> /// <param name="neutralScore">Sets the <see cref="SentimentConfidenceScores.Neutral"/> property.</param> /// <param name="negativeScore">Sets the <see cref="SentimentConfidenceScores.Negative"/> property.</param> /// <param name="offset">Sets the <see cref="SentenceSentiment.GraphemeOffset"/> property.</param> /// <param name="length">Sets the <see cref="SentenceSentiment.GraphemeLength"/> property.</param> /// <returns>A new instance of <see cref="TextAnalytics.SentenceSentiment"/> for mocking purposes.</returns> public static SentenceSentiment SentenceSentiment(TextSentiment sentiment, double positiveScore, double neutralScore, double negativeScore, int offset, int length) { return(new SentenceSentiment(sentiment, positiveScore, neutralScore, negativeScore, offset, length)); }
internal SentenceSentiment(TextSentiment sentiment, string text, double positiveScore, double neutralScore, double negativeScore) { Sentiment = sentiment; Text = text; ConfidenceScores = new SentimentConfidenceScores(positiveScore, neutralScore, negativeScore); }
internal AnalyzeSentimentResult(string id, TextDocumentStatistics statistics, TextSentiment documentSentiment, IList <TextSentiment> sentenceSentiments) : base(id, statistics) { DocumentSentiment = documentSentiment; SentenceSentiments = new ReadOnlyCollection <TextSentiment>(sentenceSentiments); }
internal DocumentSentiment(TextSentiment sentiment, double positiveScore, double neutralScore, double negativeScore, List <SentenceSentiment> sentenceSentiments) { Sentiment = sentiment; ConfidenceScores = new SentimentConfidenceScore(positiveScore, neutralScore, negativeScore); Sentences = new ReadOnlyCollection <SentenceSentiment>(sentenceSentiments); }
/// <summary> /// Initializes a new instance of <see cref="TextAnalytics.DocumentSentiment"/> for mocking purposes. /// </summary> /// <param name="sentiment">Sets the <see cref="DocumentSentiment.Sentiment"/> property.</param> /// <param name="positiveScore">Sets the <see cref="SentimentConfidenceScores.Positive"/> property.</param> /// <param name="neutralScore">Sets the <see cref="SentimentConfidenceScores.Neutral"/> property.</param> /// <param name="negativeScore">Sets the <see cref="SentimentConfidenceScores.Negative"/> property.</param> /// <param name="sentenceSentiments">Sets the <see cref="DocumentSentiment.Sentences"/> property.</param> /// <param name="warnings">Sets the <see cref="DetectedLanguage.Warnings"/> property.</param> /// <returns>A new instance of <see cref="TextAnalytics.DocumentSentiment"/> for mocking purposes.</returns> public static DocumentSentiment DocumentSentiment(TextSentiment sentiment, double positiveScore, double neutralScore, double negativeScore, List <SentenceSentiment> sentenceSentiments, IList <TextAnalyticsWarning> warnings = default) { warnings ??= new List <TextAnalyticsWarning>(); return(new DocumentSentiment(sentiment, positiveScore, neutralScore, negativeScore, sentenceSentiments, warnings)); }
/// <summary> /// Initializes a new instance of <see cref="TextAnalytics.DocumentSentiment"/> for mocking purposes. /// </summary> /// <param name="sentiment">Sets the <see cref="DocumentSentiment.Sentiment"/> property.</param> /// <param name="positiveScore">Sets the <see cref="SentimentConfidenceScores.Positive"/> property.</param> /// <param name="neutralScore">Sets the <see cref="SentimentConfidenceScores.Neutral"/> property.</param> /// <param name="negativeScore">Sets the <see cref="SentimentConfidenceScores.Negative"/> property.</param> /// <param name="sentenceSentiments">Sets the <see cref="DocumentSentiment.Sentences"/> property.</param> /// <returns>A new instance of <see cref="TextAnalytics.DocumentSentiment"/> for mocking purposes.</returns> public static DocumentSentiment DocumentSentiment(TextSentiment sentiment, double positiveScore, double neutralScore, double negativeScore, List <SentenceSentiment> sentenceSentiments) { return(new DocumentSentiment(sentiment, positiveScore, neutralScore, negativeScore, sentenceSentiments)); }