/// <summary> /// Equals override /// </summary> /// <param name="obj">The object to compare against</param> /// <returns>True if equal</returns> public override bool Equals(object obj) { if (obj is RosetteSentiment) { RosetteSentiment other = obj as RosetteSentiment; List <bool> conditions = new List <bool>() { this.Confidence == other.Confidence, this.Label.Equals(other.Label), this.GetHashCode() == other.GetHashCode() }; return(conditions.All(condition => condition)); } else { return(false); } }
/// <summary> /// Creates a SentimentResponse from its components /// </summary> /// <param name="docSentiment">The sentiment of the entire document/input text</param> /// <param name="entitySentiments">The entities, each with a sentiment, found in the input text</param> /// <param name="responseHeaders">The response headers returned from the API</param> /// <param name="content">The content (the doc and entity sentiments) in Dictionary form</param> /// <param name="contentAsJson">The content in JSON form</param> public SentimentResponse(RosetteSentiment docSentiment, List <RosetteSentimentEntity> entitySentiments, Dictionary <string, string> responseHeaders, Dictionary <string, object> content, string contentAsJson) : base(responseHeaders, content, contentAsJson) { this.DocSentiment = docSentiment; this.EntitySentiments = entitySentiments; }
/// <summary> /// Creates a SentimentResponse from its components /// </summary> /// <param name="docSentiment">The sentiment of the entire document/input text</param> /// <param name="entitySentiments">The entities, each with a sentiment, found in the input text</param> /// <param name="responseHeaders">The response headers returned from the API</param> /// <param name="content">The content (the doc and entity sentiments) in Dictionary form</param> /// <param name="contentAsJson">The content in JSON form</param> public SentimentResponse(RosetteSentiment docSentiment, List<RosetteSentimentEntity> entitySentiments, Dictionary<string, string> responseHeaders, Dictionary<string, object> content, string contentAsJson) : base(responseHeaders, content, contentAsJson) { this.DocSentiment = docSentiment; this.EntitySentiments = entitySentiments; }