diff --git a/rosette_api/EntitiesResponse.cs b/rosette_api/EntitiesResponse.cs
index 2d770fa4..641ec8b3 100644
--- a/rosette_api/EntitiesResponse.cs
+++ b/rosette_api/EntitiesResponse.cs
@@ -31,6 +31,9 @@ public class EntitiesResponse : RosetteResponse
private const String countKey = "count";
private const String confidenceKey = "confidence";
private const String dbpediaTypeKey = "dbpediaType";
+ private const String mentionOffsetsKey = "mentionOffsets";
+ private const String linkingConfidenceKey = "linkingConfidence";
+ private const String salienceKey = "salience";
///
/// Creates an EntitiesResponse from the API's raw output
@@ -50,7 +53,11 @@ public EntitiesResponse(HttpResponseMessage apiResult) : base(apiResult)
Nullable count = result.Properties().Where((p) => String.Equals(p.Name, countKey)).Any() ? result[countKey].ToObject() : null;
Nullable confidence = result.Properties().Where((p) => String.Equals(p.Name, confidenceKey)).Any() ? result[confidenceKey].ToObject() : null;
String dbpediaType = result.Properties().Where((p) => String.Equals(p.Name, dbpediaTypeKey, StringComparison.OrdinalIgnoreCase)).Any() ? result[dbpediaTypeKey].ToString() : null;
- entities.Add(new RosetteEntity(mention, normalized, entityID, type, count, confidence, dbpediaType));
+ JArray mentionOffsetsArr = result.Properties().Where((p) => String.Equals(p.Name, dbpediaTypeKey, StringComparison.OrdinalIgnoreCase)).Any() ? result[mentionOffsetsKey] as JArray : null;
+ List mentionOffsets = mentionOffsetsArr != null ? mentionOffsetsArr.ToObject>() : null;
+ Nullable linkingConfidence = result.Properties().Where((p) => String.Equals(p.Name, linkingConfidenceKey, StringComparison.OrdinalIgnoreCase)).Any() ? result[linkingConfidenceKey].ToObject() : null;
+ Nullable salience = result.Properties().Where((p) => String.Equals(p.Name, salienceKey, StringComparison.OrdinalIgnoreCase)).Any() ? result[salienceKey].ToObject() : null;
+ entities.Add(new RosetteEntity(mention, normalized, entityID, type, count, confidence, dbpediaType, mentionOffsets, linkingConfidence, salience));
}
this.Entities = entities;
}
@@ -79,9 +86,8 @@ public override bool Equals(object obj)
{
EntitiesResponse other = obj as EntitiesResponse;
List conditions = new List() {
- this.Entities != null && other.Entities != null ? this.Entities.SequenceEqual(other.Entities) : this.Entities == other.Entities,
+ this.Entities != null && other.Entities != null ? this.Entities.SequenceEqual(other.Entities) : ReferenceEquals(this.Entities, other.Entities),
this.ResponseHeaders != null && other.ResponseHeaders != null ? this.ResponseHeaders.Equals(other.ResponseHeaders) : this.ResponseHeaders == other.ResponseHeaders,
- this.GetHashCode() == other.GetHashCode()
};
return conditions.All(condition => condition);
}
diff --git a/rosette_api/MentionOffset.cs b/rosette_api/MentionOffset.cs
new file mode 100644
index 00000000..3cec1d87
--- /dev/null
+++ b/rosette_api/MentionOffset.cs
@@ -0,0 +1,79 @@
+using System;
+using Newtonsoft.Json;
+
+namespace rosette_api {
+ ///
+ /// Offsets of a piece of text in the document
+ ///
+ [JsonObject(MemberSerialization.OptOut)]
+ public class MentionOffset : IEquatable {
+
+ ///
+ /// ctor of MentionOffset
+ ///
+ /// offset of the start of text
+ /// offset of the end of text
+ public MentionOffset(int startOffset, int endOffset) {
+ StartOffset = startOffset;
+ EndOffset = endOffset;
+ }
+
+ ///
+ /// Start offset
+ ///
+ [JsonProperty("startOffset")]
+ public int StartOffset { get; set; }
+
+ ///
+ /// End offset
+ ///
+ [JsonProperty("endOffset")]
+ public int EndOffset { get; set; }
+
+ ///
+ /// Equality
+ ///
+ /// Offset to compare for equality
+ /// bool
+ public bool Equals(MentionOffset other) {
+ if (other == null) {
+ return false;
+ }
+ return StartOffset.Equals(other.StartOffset) && EndOffset.Equals(other.EndOffset);
+ }
+
+ ///
+ /// Override for Equals
+ ///
+ /// Object to check for equality
+ /// bool
+ public override bool Equals(Object obj) {
+ if (Object.ReferenceEquals(obj, null)) {
+ return false;
+ }
+
+ MentionOffset mentionOffsetObj = obj as MentionOffset;
+ if (mentionOffsetObj == null) {
+ return false;
+ } else {
+ return Equals(mentionOffsetObj);
+ }
+ }
+
+ ///
+ /// Override for GetHashCode specific to MentionOffset
+ ///
+ /// int
+ public override int GetHashCode() {
+ return StartOffset.GetHashCode() ^ EndOffset.GetHashCode();
+ }
+
+ ///
+ /// ToString override
+ ///
+ /// This MentionOffset in JSON form
+ public override string ToString() {
+ return JsonConvert.SerializeObject(this);
+ }
+ }
+}
diff --git a/rosette_api/RosetteEntity.cs b/rosette_api/RosetteEntity.cs
index c754b4ad..58ea4ff4 100644
--- a/rosette_api/RosetteEntity.cs
+++ b/rosette_api/RosetteEntity.cs
@@ -11,7 +11,7 @@ namespace rosette_api
/// A class for representing an identified entity and its properties
///
[JsonObject(MemberSerialization.OptOut)]
- public class RosetteEntity
+ public class RosetteEntity : IEquatable
{
///
/// The Location entity type
@@ -119,13 +119,31 @@ public class RosetteEntity
///
[JsonProperty("confidence")]
public Nullable Confidence { get; set; }
-
+
///
/// Gets or sets the dbpediaType of the extracted entity
///
[JsonProperty("dbpediaType", NullValueHandling = NullValueHandling.Ignore)]
public String DBpediaType { get; set; }
+ ///
+ /// Gets or sets the offsets of the extracted entity
+ ///
+ [JsonProperty("mentionOffsets")]
+ public List MentionOffsets { get; set; }
+
+ ///
+ /// Gets or sets the linking confidence of the extracted entity
+ ///
+ [JsonProperty("linkingConfidence", NullValueHandling = NullValueHandling.Ignore)]
+ public Nullable LinkingConfidence { get; set; }
+
+ ///
+ /// Gets or sets the salience of the extracted entity
+ ///
+ [JsonProperty("salience", NullValueHandling = NullValueHandling.Ignore)]
+ public Nullable Salience { get; set; }
+
///
/// Creates an entity
///
@@ -136,8 +154,12 @@ public class RosetteEntity
/// The number of times this entity appeared in the input to the API
/// The confidence of this entity appeared in the input to the API
/// The DBpedia type of the entity
+ /// The mention offsets of the entity
+ /// The linking confidence of the entity
+ /// The salience of the entity
public RosetteEntity(string mention, string normalizedMention, EntityID id, string entityType, int? count,
- double? confidence, string dbpediaType)
+ double? confidence, string dbpediaType, List mentionOffsets, double? linkingConfidence,
+ double? salience)
{
this.Mention = mention;
this.NormalizedMention = normalizedMention;
@@ -146,6 +168,9 @@ public RosetteEntity(string mention, string normalizedMention, EntityID id, stri
this.EntityType = entityType;
this.Confidence = confidence;
this.DBpediaType = dbpediaType;
+ this.MentionOffsets = mentionOffsets;
+ this.LinkingConfidence = linkingConfidence;
+ this.Salience = salience;
}
///
@@ -153,9 +178,18 @@ public RosetteEntity(string mention, string normalizedMention, EntityID id, stri
///
/// RosetteEntity
///
- protected bool Equals(RosetteEntity other)
+ public bool Equals(RosetteEntity other)
{
- return string.Equals(Mention, other.Mention) && string.Equals(NormalizedMention, other.NormalizedMention) && Equals(ID, other.ID) && string.Equals(EntityType, other.EntityType) && Count == other.Count && Confidence.Equals(other.Confidence) && string.Equals(DBpediaType, other.DBpediaType);
+ return string.Equals(Mention, other.Mention)
+ && string.Equals(NormalizedMention, other.NormalizedMention)
+ && Equals(ID, other.ID)
+ && string.Equals(EntityType, other.EntityType)
+ && Count == other.Count
+ && Confidence.Equals(other.Confidence)
+ && string.Equals(DBpediaType, other.DBpediaType)
+ && MentionOffsets.SequenceEqual(other.MentionOffsets)
+ && LinkingConfidence.Equals(other.LinkingConfidence)
+ && Salience.Equals(other.Salience);
}
///
@@ -168,7 +202,7 @@ public override bool Equals(object obj)
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
- return Equals((RosetteEntity) obj);
+ return Equals(obj as RosetteEntity);
}
///
@@ -186,6 +220,9 @@ public override int GetHashCode()
hashCode = (hashCode * 397) ^ Count.GetHashCode();
hashCode = (hashCode * 397) ^ Confidence.GetHashCode();
hashCode = (hashCode * 397) ^ (DBpediaType != null ? DBpediaType.GetHashCode() : 0);
+ hashCode = (hashCode * 397) ^ (MentionOffsets != null ? MentionOffsets.GetHashCode() : 0);
+ hashCode = (hashCode * 397) ^ (LinkingConfidence != null ? LinkingConfidence.GetHashCode() : 0);
+ hashCode = (hashCode * 397) ^ (Salience != null ? Salience.GetHashCode() : 0);
return hashCode;
}
}
diff --git a/rosette_api/SentimentResponse.cs b/rosette_api/SentimentResponse.cs
index 7b532e34..80ec9e73 100644
--- a/rosette_api/SentimentResponse.cs
+++ b/rosette_api/SentimentResponse.cs
@@ -15,7 +15,7 @@ namespace rosette_api
/// A class for representing responses from the sentiment analysis endpoint of the Rosette API
///
[JsonObject(MemberSerialization.OptOut)]
- public class SentimentResponse : RosetteResponse
+ public class SentimentResponse : RosetteResponse, IEquatable
{
private const string docKey = "document";
private const string entitiesKey = "entities";
@@ -28,6 +28,9 @@ public class SentimentResponse : RosetteResponse
internal const string typeKey = "type";
internal const string entityIDKey = "entityId";
internal const string sentimentKey = "sentiment";
+ internal const String mentionOffsetsKey = "mentionOffsets";
+ internal const String linkingConfidenceKey = "linkingConfidence";
+ internal const String salienceKey = "salience";
///
/// Gets or sets the document-level sentiment identified by the Rosette API
@@ -62,15 +65,16 @@ public SentimentResponse(HttpResponseMessage apiResult)
EntityID entityID = entityIDStr != null ? new EntityID(entityIDStr) : null;
string dbpediaType = result.Properties().Where((p) => p.Name == dbpediaTypeKey).Any() ? result[dbpediaTypeKey].ToString() : null;
Nullable count = result.Properties().Where((p) => p.Name == countKey).Any() ? result[countKey].ToObject() : null;
- string sentiment = null;
- Nullable confidence = null;
- if (result.Properties().Where((p) => p.Name == sentimentKey).Any())
- {
- JObject entitySentiment = result[sentimentKey].ToObject();
- sentiment = entitySentiment.Properties().Where((p) => p.Name == labelKey).Any() ? entitySentiment[labelKey].ToString() : null;
- confidence = entitySentiment.Properties().Where((p) => p.Name == confidenceKey).Any() ? entitySentiment[confidenceKey].ToObject() : new double?();
+ Nullable confidence = result.Properties().Where((p) => String.Equals(p.Name, confidenceKey)).Any() ? result[confidenceKey].ToObject() : null;
+ JArray mentionOffsetsArr = result.Properties().Where((p) => p.Name == mentionOffsetsKey).Any() ? result[mentionOffsetsKey] as JArray : null;
+ List mentionOffsets = mentionOffsetsArr != null ? mentionOffsetsArr.ToObject>() : null;
+ Nullable linkingConfidence = result.Properties().Where((p) => p.Name == linkingConfidenceKey).Any() ? result[linkingConfidenceKey].ToObject() : null;
+ Nullable salience = result.Properties().Where((p) => p.Name == salienceKey).Any() ? result[salienceKey].ToObject() : null;
+ RosetteSentiment sentiment = null;
+ if (result.Properties().Where((p) => p.Name == sentimentKey).Any()) {
+ sentiment = result[sentimentKey].ToObject();
}
- entitySentiments.Add(new RosetteSentimentEntity(mention, normalizedMention, entityID, type, count, sentiment, confidence, dbpediaType));
+ entitySentiments.Add(new RosetteSentimentEntity(mention, normalizedMention, entityID, type, count, sentiment, confidence, dbpediaType, mentionOffsets, linkingConfidence, salience));
}
this.EntitySentiments = entitySentiments;
}
@@ -90,6 +94,21 @@ public SentimentResponse(RosetteSentiment docSentiment, List
+ /// Equals override
+ ///
+ /// The other to compare against
+ /// True if equal
+ public bool Equals(SentimentResponse other)
+ {
+ List conditions = new List() {
+ this.DocSentiment != null && other.DocSentiment != null ? this.DocSentiment.Equals(other.DocSentiment) : this.DocSentiment == other.DocSentiment,
+ this.EntitySentiments != null && other.EntitySentiments != null ? this.EntitySentiments.SequenceEqual(other.EntitySentiments) : this.EntitySentiments == other.EntitySentiments,
+ this.ResponseHeaders != null && other.ResponseHeaders != null ? this.ResponseHeaders.Equals(other.ResponseHeaders) : this.ResponseHeaders == other.ResponseHeaders,
+ };
+ return conditions.All(condition => condition);
+ }
+
///
/// Equals override
///
@@ -99,14 +118,7 @@ public override bool Equals(object obj)
{
if (obj is SentimentResponse)
{
- SentimentResponse other = obj as SentimentResponse;
- List conditions = new List() {
- this.DocSentiment != null && other.DocSentiment != null ? this.DocSentiment.Equals(other.DocSentiment) : this.DocSentiment == other.DocSentiment,
- this.EntitySentiments != null && other.EntitySentiments != null ? this.EntitySentiments.SequenceEqual(other.EntitySentiments) : this.EntitySentiments == other.EntitySentiments,
- this.ResponseHeaders != null && other.ResponseHeaders != null ? this.ResponseHeaders.Equals(other.ResponseHeaders) : this.ResponseHeaders == other.ResponseHeaders,
- this.GetHashCode() == other.GetHashCode()
- };
- return conditions.All(condition => condition);
+ return Equals(obj is SentimentResponse);
}
else
{
@@ -130,7 +142,7 @@ public override int GetHashCode()
/// A class for representing sentiments
///
[JsonObject(MemberSerialization.OptOut)]
- public class RosetteSentiment
+ public class RosetteSentiment : IEquatable
{
///
/// The enumeration of possible sentiment labels
@@ -170,6 +182,7 @@ public enum SentimentLabel
///
/// The sentiment label: "pos", "neu", or "neg"
/// An indicator of confidence in the label being correct. A range from 0-1.
+ [JsonConstructor]
public RosetteSentiment(String sentiment, Nullable confidence)
{
switch (sentiment)
@@ -182,6 +195,31 @@ public RosetteSentiment(String sentiment, Nullable confidence)
this.Confidence = confidence;
}
+ ///
+ /// A constructor for creating RosetteSentiments
+ ///
+ /// The sentiment label: "pos", "neu", or "neg"
+ /// An indicator of confidence in the label being correct. A range from 0-1.
+ public RosetteSentiment(SentimentLabel sentimentLabel, Nullable confidence)
+ {
+ this.Label = sentimentLabel;
+ this.Confidence = confidence;
+ }
+ ///
+ /// Equals override
+ ///
+ /// The object to compare against
+ /// True if equal
+
+ public bool Equals(RosetteSentiment other)
+ {
+ List conditions = new List() {
+ this.Confidence == other.Confidence,
+ this.Label.Equals(other.Label),
+ };
+ return conditions.All(condition => condition);
+ }
+
///
/// Equals override
///
@@ -191,13 +229,7 @@ public override bool Equals(object obj)
{
if (obj is RosetteSentiment)
{
- RosetteSentiment other = obj as RosetteSentiment;
- List conditions = new List() {
- this.Confidence == other.Confidence,
- this.Label.Equals(other.Label),
- this.GetHashCode() == other.GetHashCode()
- };
- return conditions.All(condition => condition);
+ return Equals(obj as RosetteSentiment);
}
else
{
@@ -231,7 +263,7 @@ public override string ToString()
/// A class to represent an entity returned by the Sentiment Analysis endpoint of the Rosette API
///
[JsonObject(MemberSerialization.OptOut)]
- public class RosetteSentimentEntity : RosetteEntity
+ public class RosetteSentimentEntity : RosetteEntity, IEquatable
{
///
/// The sentiment label of this entity
@@ -249,14 +281,53 @@ public class RosetteSentimentEntity : RosetteEntity
/// The number of times the entity appeared in the text
/// The contextual sentiment of the entity
/// The confidence that the sentiment was correctly identified
- ///
- public RosetteSentimentEntity(string mention, string normalizedMention, EntityID id, string entityType,
- int? count, string sentiment, double? confidence, string dbpediaType) : base(mention, normalizedMention, id, entityType, count, confidence, dbpediaType)
+ /// The DBpedia type of the entity
+ /// The mention offsets of the entity
+ /// The linking confidence of the entity
+ /// The salience of the entity
+ public RosetteSentimentEntity(string mention,
+ string normalizedMention,
+ EntityID id,
+ string entityType,
+ int? count,
+ SentimentResponse.RosetteSentiment sentiment,
+ double? confidence,
+ string dbpediaType,
+ List mentionOffsets,
+ double? linkingConfidence,
+ double? salience
+ ) : base(mention,
+ normalizedMention,
+ id,
+ entityType,
+ count,
+ confidence,
+ dbpediaType,
+ mentionOffsets,
+ linkingConfidence,
+ salience
+ )
{
- this.Sentiment = new SentimentResponse.RosetteSentiment(sentiment, confidence);
+ this.Sentiment = new SentimentResponse.RosetteSentiment(sentiment.Label, sentiment.Confidence);
+ }
+
+ ///
+ /// Equals override
+ ///
+ /// The other to compare against
+ /// True if equal
+ public bool Equals(RosetteSentimentEntity other)
+ {
+ if (other == null) {
+ return false;
+ }
+ List conditions = new List() {
+ this.Sentiment != null ? this.Sentiment.Equals(other.Sentiment) : other.Sentiment == null,
+ base.Equals(other)
+ };
+ return conditions.All(condition => condition);
}
-
///
/// Equals override
///
@@ -266,13 +337,7 @@ public override bool Equals(object obj)
{
if (obj is RosetteSentimentEntity)
{
- RosetteSentimentEntity other = obj as RosetteSentimentEntity;
- List conditions = new List() {
- this.Sentiment != null && other.Sentiment != null ? this.Sentiment.Equals(other.Sentiment) : this.Sentiment == other.Sentiment,
- base.Equals(other),
- this.GetHashCode() == other.GetHashCode()
- };
- return conditions.All(condition => condition);
+ return Equals(obj as RosetteEntity);
}
else
{
diff --git a/rosette_api/rosette_api.csproj b/rosette_api/rosette_api.csproj
index 064dd5b6..fca0ca00 100644
--- a/rosette_api/rosette_api.csproj
+++ b/rosette_api/rosette_api.csproj
@@ -61,6 +61,7 @@
+
diff --git a/rosette_apiExamples/docker/compile-and-run.sh b/rosette_apiExamples/docker/compile-and-run.sh
index e6ebda86..f84f71e2 100755
--- a/rosette_apiExamples/docker/compile-and-run.sh
+++ b/rosette_apiExamples/docker/compile-and-run.sh
@@ -44,12 +44,13 @@ function cleanURL() {
}
function validateURL() {
- echo "Validate URL"
- match=$(curl "${ping_url}/ping" -H "X-RosetteAPI-Key: ${API_KEY}" -H "user_key: ${API_KEY}" | grep -o "Rosette API")
- if [ "${match}" = "" ]; then
- echo -e "\n${ping_url} server not responding\n"
+ output_file=validate_url_out.log
+ http_status_code=$(curl -s -o "${output_file}" -w "%{http_code}" -H "X-RosetteAPI-Key: ${API_KEY}" "${ping_url}/ping")
+ if [ "${http_status_code}" != "200" ]; then
+ echo -e "\n${ping_url} server not responding. Output is:\n"
+ cat "${output_file}"
exit 1
- fi
+ fi
}
function runExample() {
diff --git a/rosette_apiExamples/entities.cs b/rosette_apiExamples/entities.cs
index 5d901f8a..8c313c88 100755
--- a/rosette_apiExamples/entities.cs
+++ b/rosette_apiExamples/entities.cs
@@ -33,15 +33,16 @@ static void Main(string[] args)
CAPI EntitiesCAPI = string.IsNullOrEmpty(alturl) ? new CAPI(apikey) : new CAPI(apikey, alturl);
string entities_text_data = @"The Securities and Exchange Commission today announced the leadership of the agency’s trial unit. Bridget Fitzpatrick has been named Chief Litigation Counsel of the SEC and David Gottesman will continue to serve as the agency’s Deputy Chief Litigation Counsel. Since December 2016, Ms. Fitzpatrick and Mr. Gottesman have served as Co-Acting Chief Litigation Counsel. In that role, they were jointly responsible for supervising the trial unit at the agency’s Washington D.C. headquarters as well as coordinating with litigators in the SEC’s 11 regional offices around the country.";
//The results of the API call will come back in the form of a Dictionary
- EntitiesResponse response = EntitiesCAPI.Entity(entities_text_data, null, null, null, "social-media");
+ EntitiesResponse response = EntitiesCAPI.Entity(entities_text_data);
foreach (KeyValuePair h in response.Headers) {
Console.WriteLine(string.Format("{0}:{1}", h.Key, h.Value));
}
- Console.WriteLine(response.ToString());
+ // PrintContent() is a provided method to print the Dictionary to the console
+ response.PrintContent();
// Entities with full ADM
EntitiesCAPI.SetUrlParameter("output", "rosette");
- response = EntitiesCAPI.Entity(entities_text_data, null, null, null, "social-media");
+ response = EntitiesCAPI.Entity(entities_text_data);
// response.Content contains the IDictionary results of the full ADM.
// PrintContent() is a provided method to print the Dictionary to the console
response.PrintContent();
diff --git a/rosette_apiExamples/similar_terms.cs b/rosette_apiExamples/similar_terms.cs
index f30f9a6c..98f76f35 100644
--- a/rosette_apiExamples/similar_terms.cs
+++ b/rosette_apiExamples/similar_terms.cs
@@ -33,7 +33,7 @@ static void Main(string[] args)
CAPI EmbeddingCAPI = string.IsNullOrEmpty(alturl) ? new CAPI(apikey) : new CAPI(apikey, alturl);
string similar_terms_data = "spy";
//The results of the API call will come back in the form of a Dictionary
- EmbeddingCAPI.SetOptions("resultLanguages", new List() {"spa", "deu", "jpn"};
+ EmbeddingCAPI.SetOption("resultLanguages", new List() {"spa", "deu", "jpn"});
SimilarTermsResponse response = EmbeddingCAPI.SimilarTerms(similar_terms_data);
foreach (KeyValuePair h in response.Headers)
{
diff --git a/rosette_apiUnitTests/rosette_apiUnitTests.cs b/rosette_apiUnitTests/rosette_apiUnitTests.cs
index 379f3537..b6eeb9ea 100755
--- a/rosette_apiUnitTests/rosette_apiUnitTests.cs
+++ b/rosette_apiUnitTests/rosette_apiUnitTests.cs
@@ -649,9 +649,9 @@ public void Categories_File_Test() {
public void EntityTestFull()
{
Init();
- RosetteEntity e0 = new RosetteEntity("Dan Akroyd", "Dan Akroyd", new EntityID("Q105221"), "PERSON", 2, 0.99, null);
- RosetteEntity e1 = new RosetteEntity("The Hollywood Reporter", "The Hollywood Reporter", new EntityID("Q61503"), "ORGANIZATION", 1, null, null);
- RosetteEntity e2 = new RosetteEntity("Dan Akroyd", "Dan Akroyd", new EntityID("Q105221"), "PERSON", 2, 0.99, "X1");
+ RosetteEntity e0 = new RosetteEntity("Dan Akroyd", "Dan Akroyd", new EntityID("Q105221"), "PERSON", 2, 0.99, "X1", new List() { new MentionOffset(0, 10), new MentionOffset(20,32) }, .99, 1);
+ RosetteEntity e1 = new RosetteEntity("The Hollywood Reporter", "The Hollywood Reporter", new EntityID("Q61503"), "ORGANIZATION", 1, null, "X1", new List() { new MentionOffset(15, 18) }, null, null);
+ RosetteEntity e2 = new RosetteEntity("Dan Akroyd", "Dan Akroyd", new EntityID("Q105221"), "PERSON", 2, 0.99, "X1", new List() { new MentionOffset(0, 10), new MentionOffset(20, 32) }, .99, 0.0);
List entities = new List() { e0, e1, e2 };
string headersAsString = " { \"Content-Type\": \"application/json\", \"date\": \"Thu, 11 Aug 2016 15:47:32 GMT\", \"server\": \"openresty\", \"strict-transport-security\": \"max-age=63072000; includeSubdomains; preload\", \"x-rosetteapi-app-id\": \"1409611723442\", \"x-rosetteapi-concurrency\": \"50\", \"x-rosetteapi-request-id\": \"d4176692-4f14-42d7-8c26-4b2d8f7ff049\", \"content-length\": \"72\", \"connection\": \"Close\" }";
Dictionary responseHeaders = new JavaScriptSerializer().Deserialize>(headersAsString);
@@ -1322,8 +1322,8 @@ public void SentimentTestFull()
{
Init();
SentimentResponse.RosetteSentiment docSentiment = new SentimentResponse.RosetteSentiment("pos", (double)0.7962072011038756);
- RosetteSentimentEntity e0 = new RosetteSentimentEntity("Dan Akroyd", "Dan Akroyd", new EntityID("Q105221"), "PERSON", 2, "neg", (double)0.5005508052749595, null);
- RosetteSentimentEntity e1 = new RosetteSentimentEntity("The Hollywood Reporter", "The Hollywood Reporter", new EntityID("Q61503"), "ORGANIZATION", 1, "pos", (double)0.5338094035254866, null);
+ RosetteSentimentEntity e0 = new RosetteSentimentEntity("Dan Akroyd", "Dan Akroyd", new EntityID("Q105221"), "PERSON", 2, docSentiment, (double)0.5005508052749595, null, new List() { new MentionOffset(0, 10), new MentionOffset(20, 32) }, .99, 1);
+ RosetteSentimentEntity e1 = new RosetteSentimentEntity("The Hollywood Reporter", "The Hollywood Reporter", new EntityID("Q61503"), "ORGANIZATION", 1, docSentiment, (double)0.5338094035254866, null, new List() { new MentionOffset(15, 18) }, null, null);
List entities = new List() { e0, e1 };
string headersAsString = " { \"Content-Type\": \"application/json\", \"date\": \"Thu, 11 Aug 2016 15:47:32 GMT\", \"server\": \"openresty\", \"strict-transport-security\": \"max-age=63072000; includeSubdomains; preload\", \"x-rosetteapi-app-id\": \"1409611723442\", \"x-rosetteapi-concurrency\": \"50\", \"x-rosetteapi-request-id\": \"d4176692-4f14-42d7-8c26-4b2d8f7ff049\", \"content-length\": \"72\", \"connection\": \"Close\" }";
Dictionary responseHeaders = new JavaScriptSerializer().Deserialize>(headersAsString);
diff --git a/rosette_apiUnitTests/rosette_apiUnitTests.csproj b/rosette_apiUnitTests/rosette_apiUnitTests.csproj
index c4dfd134..d3c8bd7c 100644
--- a/rosette_apiUnitTests/rosette_apiUnitTests.csproj
+++ b/rosette_apiUnitTests/rosette_apiUnitTests.csproj
@@ -140,11 +140,11 @@
-
\ No newline at end of file