diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/CHANGELOG.md b/sdk/textanalytics/Azure.AI.TextAnalytics/CHANGELOG.md index f3d6b993d7f3..3c7ac10aa14d 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/CHANGELOG.md +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History ## 5.1.0-beta.2 (Unreleased) - +### Breaking changes +- Removed property `Length` from `CategorizedEntity`, `SentenceSentiment`, `LinkedEntityMatch`, `AspectSentiment`, `OpinionSentiment`, and `PiiEntity`. ## 5.1.0-beta.1 (2020-09-17) diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/README.md b/sdk/textanalytics/Azure.AI.TextAnalytics/README.md index 0d6b1a993e4b..2f803cdd67c2 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/README.md +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/README.md @@ -194,7 +194,7 @@ CategorizedEntityCollection entities = client.RecognizeEntities(document); Console.WriteLine($"Recognized {entities.Count} entities:"); foreach (CategorizedEntity entity in entities) { - Console.WriteLine($"Text: {entity.Text}, Offset (in UTF-16 code units): {entity.Offset}, Length (in UTF-16 code units): {entity.Length}"); + Console.WriteLine($"Text: {entity.Text}, Offset (in UTF-16 code units): {entity.Offset}"); Console.WriteLine($"Category: {entity.Category}, SubCategory: {entity.SubCategory}, Confidence score: {entity.ConfidenceScore}"); } ``` @@ -243,7 +243,7 @@ foreach (LinkedEntity linkedEntity in linkedEntities) Console.WriteLine($"Name: {linkedEntity.Name}, Language: {linkedEntity.Language}, Data Source: {linkedEntity.DataSource}, Url: {linkedEntity.Url.ToString()}, Entity Id in Data Source: {linkedEntity.DataSourceEntityId}"); foreach (LinkedEntityMatch match in linkedEntity.Matches) { - Console.WriteLine($" Match Text: {match.Text}, Offset (in UTF-16 code units): {match.Offset}, Length (in UTF-16 code units): {match.Length}"); + Console.WriteLine($" Match Text: {match.Text}, Offset (in UTF-16 code units): {match.Offset}"); Console.WriteLine($" Confidence score: {match.ConfidenceScore}"); } } @@ -274,7 +274,7 @@ CategorizedEntityCollection entities = await client.RecognizeEntitiesAsync(docum Console.WriteLine($"Recognized {entities.Count} entities:"); foreach (CategorizedEntity entity in entities) { - Console.WriteLine($"Text: {entity.Text}, Offset (in UTF-16 code units): {entity.Offset}, Length (in UTF-16 code units): {entity.Length}"); + Console.WriteLine($"Text: {entity.Text}, Offset (in UTF-16 code units): {entity.Offset}"); Console.WriteLine($"Category: {entity.Category}, SubCategory: {entity.SubCategory}, Confidence score: {entity.ConfidenceScore}"); } ``` diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/api/Azure.AI.TextAnalytics.netstandard2.0.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/api/Azure.AI.TextAnalytics.netstandard2.0.cs index e5fa125f90af..3872c2938548 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/api/Azure.AI.TextAnalytics.netstandard2.0.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/api/Azure.AI.TextAnalytics.netstandard2.0.cs @@ -28,7 +28,6 @@ public readonly partial struct AspectSentiment private readonly object _dummy; private readonly int _dummyPrimitive; public Azure.AI.TextAnalytics.SentimentConfidenceScores ConfidenceScores { get { throw null; } } - public int Length { get { throw null; } } public int Offset { get { throw null; } } public Azure.AI.TextAnalytics.TextSentiment Sentiment { get { throw null; } } public string Text { get { throw null; } } @@ -40,7 +39,6 @@ public readonly partial struct CategorizedEntity private readonly int _dummyPrimitive; public Azure.AI.TextAnalytics.EntityCategory Category { get { throw null; } } public double ConfidenceScore { get { throw null; } } - public int Length { get { throw null; } } public int Offset { get { throw null; } } public string SubCategory { get { throw null; } } public string Text { get { throw null; } } @@ -155,7 +153,6 @@ public readonly partial struct LinkedEntityMatch private readonly object _dummy; private readonly int _dummyPrimitive; public double ConfidenceScore { get { throw null; } } - public int Length { get { throw null; } } public int Offset { get { throw null; } } public string Text { get { throw null; } } } @@ -174,7 +171,6 @@ public readonly partial struct OpinionSentiment private readonly int _dummyPrimitive; public Azure.AI.TextAnalytics.SentimentConfidenceScores ConfidenceScores { get { throw null; } } public bool IsNegated { get { throw null; } } - public int Length { get { throw null; } } public int Offset { get { throw null; } } public Azure.AI.TextAnalytics.TextSentiment Sentiment { get { throw null; } } public string Text { get { throw null; } } @@ -186,7 +182,6 @@ public readonly partial struct PiiEntity private readonly int _dummyPrimitive; public Azure.AI.TextAnalytics.EntityCategory Category { get { throw null; } } public double ConfidenceScore { get { throw null; } } - public int Length { get { throw null; } } public int Offset { get { throw null; } } public string SubCategory { get { throw null; } } public string Text { get { throw null; } } @@ -245,7 +240,6 @@ public readonly partial struct SentenceSentiment private readonly object _dummy; private readonly int _dummyPrimitive; public Azure.AI.TextAnalytics.SentimentConfidenceScores ConfidenceScores { get { throw null; } } - public int Length { get { throw null; } } public System.Collections.Generic.IReadOnlyCollection MinedOpinions { get { throw null; } } public int Offset { get { throw null; } } public Azure.AI.TextAnalytics.TextSentiment Sentiment { get { throw null; } } @@ -380,10 +374,10 @@ public static partial class TextAnalyticsModelFactory public static Azure.AI.TextAnalytics.AnalyzeSentimentResult AnalyzeSentimentResult(string id, Azure.AI.TextAnalytics.TextAnalyticsError error) { throw null; } public static Azure.AI.TextAnalytics.AnalyzeSentimentResult AnalyzeSentimentResult(string id, Azure.AI.TextAnalytics.TextDocumentStatistics statistics, Azure.AI.TextAnalytics.DocumentSentiment documentSentiment) { throw null; } public static Azure.AI.TextAnalytics.AnalyzeSentimentResultCollection AnalyzeSentimentResultCollection(System.Collections.Generic.IEnumerable list, Azure.AI.TextAnalytics.TextDocumentBatchStatistics statistics, string modelVersion) { throw null; } - public static Azure.AI.TextAnalytics.AspectSentiment AspectSentiment(Azure.AI.TextAnalytics.TextSentiment sentiment, string text, double positiveScore, double negativeScore, int offset, int length) { throw null; } + public static Azure.AI.TextAnalytics.AspectSentiment AspectSentiment(Azure.AI.TextAnalytics.TextSentiment sentiment, string text, double positiveScore, double negativeScore, int offset) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.AI.TextAnalytics.CategorizedEntity CategorizedEntity(string text, string category, string subCategory, double score) { throw null; } - public static Azure.AI.TextAnalytics.CategorizedEntity CategorizedEntity(string text, string category, string subCategory, double score, int offset, int length) { throw null; } + public static Azure.AI.TextAnalytics.CategorizedEntity CategorizedEntity(string text, string category, string subCategory, double score, int offset) { throw null; } public static Azure.AI.TextAnalytics.CategorizedEntityCollection CategorizedEntityCollection(System.Collections.Generic.IList entities, System.Collections.Generic.IList warnings = null) { throw null; } public static Azure.AI.TextAnalytics.DetectedLanguage DetectedLanguage(string name, string iso6391Name, double confidenceScore, System.Collections.Generic.IList warnings = null) { throw null; } public static Azure.AI.TextAnalytics.DetectLanguageResult DetectLanguageResult(string id, Azure.AI.TextAnalytics.TextAnalyticsError error) { throw null; } @@ -400,10 +394,10 @@ public static partial class TextAnalyticsModelFactory public static Azure.AI.TextAnalytics.LinkedEntityCollection LinkedEntityCollection(System.Collections.Generic.IList entities, System.Collections.Generic.IList warnings = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.AI.TextAnalytics.LinkedEntityMatch LinkedEntityMatch(string text, double score) { throw null; } - public static Azure.AI.TextAnalytics.LinkedEntityMatch LinkedEntityMatch(string text, double score, int offset, int length) { throw null; } + public static Azure.AI.TextAnalytics.LinkedEntityMatch LinkedEntityMatch(string text, double score, int offset) { throw null; } public static Azure.AI.TextAnalytics.MinedOpinion MinedOpinion(Azure.AI.TextAnalytics.AspectSentiment aspect, System.Collections.Generic.IReadOnlyList opinions) { throw null; } - public static Azure.AI.TextAnalytics.OpinionSentiment OpinionSentiment(Azure.AI.TextAnalytics.TextSentiment sentiment, double positiveScore, double negativeScore, string text, bool isNegated, int offset, int length) { throw null; } - public static Azure.AI.TextAnalytics.PiiEntity PiiEntity(string text, string category, string subCategory, double score, int offset, int length) { throw null; } + public static Azure.AI.TextAnalytics.OpinionSentiment OpinionSentiment(Azure.AI.TextAnalytics.TextSentiment sentiment, double positiveScore, double negativeScore, string text, bool isNegated, int offset) { throw null; } + public static Azure.AI.TextAnalytics.PiiEntity PiiEntity(string text, string category, string subCategory, double score, int offset) { throw null; } public static Azure.AI.TextAnalytics.PiiEntityCollection PiiEntityCollection(System.Collections.Generic.IList entities, string redactedText, System.Collections.Generic.IList warnings = null) { throw null; } public static Azure.AI.TextAnalytics.RecognizeEntitiesResult RecognizeEntitiesResult(string id, Azure.AI.TextAnalytics.TextAnalyticsError error) { throw null; } public static Azure.AI.TextAnalytics.RecognizeEntitiesResult RecognizeEntitiesResult(string id, Azure.AI.TextAnalytics.TextDocumentStatistics statistics, Azure.AI.TextAnalytics.CategorizedEntityCollection entities) { throw null; } @@ -416,7 +410,7 @@ public static partial class TextAnalyticsModelFactory public static Azure.AI.TextAnalytics.RecognizePiiEntitiesResultCollection RecognizePiiEntitiesResultCollection(System.Collections.Generic.IEnumerable list, Azure.AI.TextAnalytics.TextDocumentBatchStatistics statistics, string modelVersion) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.AI.TextAnalytics.SentenceSentiment SentenceSentiment(Azure.AI.TextAnalytics.TextSentiment sentiment, string text, double positiveScore, double neutralScore, double negativeScore) { throw null; } - public static Azure.AI.TextAnalytics.SentenceSentiment SentenceSentiment(Azure.AI.TextAnalytics.TextSentiment sentiment, string text, double positiveScore, double neutralScore, double negativeScore, int offset, int length, System.Collections.Generic.IReadOnlyList minedOpinions) { throw null; } + public static Azure.AI.TextAnalytics.SentenceSentiment SentenceSentiment(Azure.AI.TextAnalytics.TextSentiment sentiment, string text, double positiveScore, double neutralScore, double negativeScore, int offset, System.Collections.Generic.IReadOnlyList minedOpinions) { throw null; } public static Azure.AI.TextAnalytics.SentimentConfidenceScores SentimentConfidenceScores(double positiveScore, double neutralScore, double negativeScore) { throw null; } public static Azure.AI.TextAnalytics.TextAnalyticsError TextAnalyticsError(string code, string message, string target = null) { throw null; } public static Azure.AI.TextAnalytics.TextAnalyticsWarning TextAnalyticsWarning(string code, string message) { throw null; } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample4_RecognizeEntities.md b/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample4_RecognizeEntities.md index 81a3e2e7ad3a..b860aa9915e8 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample4_RecognizeEntities.md +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample4_RecognizeEntities.md @@ -23,7 +23,7 @@ CategorizedEntityCollection entities = client.RecognizeEntities(document); Console.WriteLine($"Recognized {entities.Count} entities:"); foreach (CategorizedEntity entity in entities) { - Console.WriteLine($"Text: {entity.Text}, Offset (in UTF-16 code units): {entity.Offset}, Length (in UTF-16 code units): {entity.Length}"); + Console.WriteLine($"Text: {entity.Text}, Offset (in UTF-16 code units): {entity.Offset}"); Console.WriteLine($"Category: {entity.Category}, SubCategory: {entity.SubCategory}, Confidence score: {entity.ConfidenceScore}"); } ``` diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample6_RecognizeLinkedEntities.md b/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample6_RecognizeLinkedEntities.md index e0b27e6f538e..7cb527bda948 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample6_RecognizeLinkedEntities.md +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample6_RecognizeLinkedEntities.md @@ -26,7 +26,7 @@ foreach (LinkedEntity linkedEntity in linkedEntities) Console.WriteLine($"Name: {linkedEntity.Name}, Language: {linkedEntity.Language}, Data Source: {linkedEntity.DataSource}, Url: {linkedEntity.Url.ToString()}, Entity Id in Data Source: {linkedEntity.DataSourceEntityId}"); foreach (LinkedEntityMatch match in linkedEntity.Matches) { - Console.WriteLine($" Match Text: {match.Text}, Offset (in UTF-16 code units): {match.Offset}, Length (in UTF-16 code units): {match.Length}"); + Console.WriteLine($" Match Text: {match.Text}, Offset (in UTF-16 code units): {match.Offset}"); Console.WriteLine($" Confidence score: {match.ConfidenceScore}"); } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/AspectSentiment.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/AspectSentiment.cs index 1856a9827f5b..c5a0be87f0c8 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/AspectSentiment.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/AspectSentiment.cs @@ -17,13 +17,12 @@ public readonly struct AspectSentiment { private const double _neutralValue = 0d; - internal AspectSentiment(TextSentiment sentiment, string text, double positiveScore, double negativeScore, int offset, int length) + internal AspectSentiment(TextSentiment sentiment, string text, double positiveScore, double negativeScore, int offset) { Sentiment = sentiment; Text = text; ConfidenceScores = new SentimentConfidenceScores(positiveScore, _neutralValue, negativeScore); Offset = offset; - Length = length; } internal AspectSentiment(SentenceAspect sentenceAspect) @@ -34,7 +33,6 @@ internal AspectSentiment(SentenceAspect sentenceAspect) ConfidenceScores = new SentimentConfidenceScores(sentenceAspect.ConfidenceScores.Positive, _neutralValue, sentenceAspect.ConfidenceScores.Negative); Sentiment = (TextSentiment)Enum.Parse(typeof(TextSentiment), sentenceAspect.Sentiment, ignoreCase: true); Offset = sentenceAspect.Offset; - Length = sentenceAspect.Length; } /// @@ -59,10 +57,5 @@ internal AspectSentiment(SentenceAspect sentenceAspect) /// Gets the starting position (in UTF-16 code units) for the aspect text. /// public int Offset { get; } - - /// - /// Gets the length (in UTF-16 code units) of the aspect text. - /// - public int Length { get; } } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/CategorizedEntity.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/CategorizedEntity.cs index 489f5d1187a5..ec6b1a30d610 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/CategorizedEntity.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/CategorizedEntity.cs @@ -22,7 +22,6 @@ internal CategorizedEntity(Entity entity) SubCategory = entity.Subcategory; ConfidenceScore = entity.ConfidenceScore; Offset = entity.Offset; - Length = entity.Length; } /// @@ -57,10 +56,5 @@ internal CategorizedEntity(Entity entity) /// Gets the starting position (in UTF-16 code units) for the matching text in the input document. /// public int Offset { get; } - - /// - /// Gets the length (in UTF-16 code units) of the matching text in the input document. - /// - public int Length { get; } } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/LinkedEntityMatch.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/LinkedEntityMatch.cs index e430aaecaab9..20f777922e99 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/LinkedEntityMatch.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/LinkedEntityMatch.cs @@ -13,14 +13,18 @@ namespace Azure.AI.TextAnalytics [CodeGenModel("Match")] public readonly partial struct LinkedEntityMatch { + // use for deserialization internal LinkedEntityMatch(double confidenceScore, string text, int offset, int length) + : this(confidenceScore, text, offset) => Length = length; + + internal LinkedEntityMatch(double confidenceScore, string text, int offset) { // 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; ConfidenceScore = confidenceScore; Offset = offset; - Length = length; + Length = default; } /// @@ -40,8 +44,8 @@ internal LinkedEntityMatch(double confidenceScore, string text, int offset, int public int Offset { get; } /// - /// Gets the length (in UTF-16 code units) of the matching text in the document. + /// Gets the length (in UTF-16 code units) of the matching text in the sentence. /// - public int Length { get; } + private int Length { get; } } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/OpinionSentiment.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/OpinionSentiment.cs index 1002acbd1bf6..b166a0d2e76e 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/OpinionSentiment.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/OpinionSentiment.cs @@ -15,14 +15,13 @@ public readonly struct OpinionSentiment { private const double _neutralValue = 0d; - internal OpinionSentiment(TextSentiment sentiment, double positiveScore, double negativeScore, string text, bool isNegated, int offset, int length) + internal OpinionSentiment(TextSentiment sentiment, double positiveScore, double negativeScore, string text, bool isNegated, int offset) { Sentiment = sentiment; ConfidenceScores = new SentimentConfidenceScores(positiveScore, _neutralValue, negativeScore); Text = text; IsNegated = isNegated; Offset = offset; - Length = length; } internal OpinionSentiment(SentenceOpinion opinion) @@ -34,7 +33,6 @@ internal OpinionSentiment(SentenceOpinion opinion) Sentiment = (TextSentiment)Enum.Parse(typeof(TextSentiment), opinion.Sentiment, ignoreCase: true); IsNegated = opinion.IsNegated; Offset = opinion.Offset; - Length = opinion.Length; } /// @@ -66,10 +64,5 @@ internal OpinionSentiment(SentenceOpinion opinion) /// Gets the starting position (in UTF-16 code units) for the opinion text. /// public int Offset { get; } - - /// - /// Gets the length (in UTF-16 code units) of the opinion text. - /// - public int Length { get; } } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/PiiEntity.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/PiiEntity.cs index a0c3ec964c87..dae6b20bd38a 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/PiiEntity.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/PiiEntity.cs @@ -20,7 +20,6 @@ internal PiiEntity(Entity entity) SubCategory = entity.Subcategory; ConfidenceScore = entity.ConfidenceScore; Offset = entity.Offset; - Length = entity.Length; } /// @@ -55,10 +54,5 @@ internal PiiEntity(Entity entity) /// Gets the starting position (in UTF-16 code units) for the matching text in the input document. /// public int Offset { get; } - - /// - /// Gets the length (in UTF-16 code units) of the matching text in the input document. - /// - public int Length { get; } } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/SentenceSentiment.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/SentenceSentiment.cs index aa53b55323ac..3d2b817ddb3e 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/SentenceSentiment.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/SentenceSentiment.cs @@ -16,13 +16,12 @@ namespace Azure.AI.TextAnalytics /// public readonly struct SentenceSentiment { - internal SentenceSentiment(TextSentiment sentiment, string text, double positiveScore, double neutralScore, double negativeScore, int offset, int length, IReadOnlyList minedOpinions) + internal SentenceSentiment(TextSentiment sentiment, string text, double positiveScore, double neutralScore, double negativeScore, int offset, IReadOnlyList minedOpinions) { Sentiment = sentiment; Text = text; ConfidenceScores = new SentimentConfidenceScores(positiveScore, neutralScore, negativeScore); Offset = offset; - Length = length; MinedOpinions = new List(minedOpinions); } @@ -36,7 +35,6 @@ internal SentenceSentiment(SentenceSentimentInternal sentenceSentiment, IReadOnl Sentiment = (TextSentiment)Enum.Parse(typeof(TextSentiment), sentenceSentiment.Sentiment, ignoreCase: true); MinedOpinions = ConvertToMinedOpinions(sentenceSentiment, allSentences); Offset = sentenceSentiment.Offset; - Length = sentenceSentiment.Length; } /// @@ -66,11 +64,6 @@ internal SentenceSentiment(SentenceSentimentInternal sentenceSentiment, IReadOnl /// public int Offset { get; } - /// - /// Gets the length (in UTF-16 code units) of the matching text in the sentence. - /// - public int Length { get; } - private static IReadOnlyCollection ConvertToMinedOpinions(SentenceSentimentInternal sentence, IReadOnlyList allSentences) { var minedOpinions = new List(); diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsModelFactory.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsModelFactory.cs index 602b3e8ca7aa..0a22ca07aa8f 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsModelFactory.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsModelFactory.cs @@ -105,7 +105,7 @@ public static DocumentSentiment DocumentSentiment(TextSentiment sentiment, doubl [EditorBrowsable(EditorBrowsableState.Never)] 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()); + return new SentenceSentiment(sentiment, text, positiveScore, neutralScore, negativeScore, default, new List()); } /// @@ -117,13 +117,12 @@ public static SentenceSentiment SentenceSentiment(TextSentiment sentiment, strin /// Sets the property. /// Sets the property. /// Sets the property. - /// Sets the property. /// Sets the property. /// A new instance of for mocking purposes. - public static SentenceSentiment SentenceSentiment(TextSentiment sentiment, string text, double positiveScore, double neutralScore, double negativeScore, int offset, int length, IReadOnlyList minedOpinions) + public static SentenceSentiment SentenceSentiment(TextSentiment sentiment, string text, double positiveScore, double neutralScore, double negativeScore, int offset, IReadOnlyList minedOpinions) { minedOpinions ??= new List(); - return new SentenceSentiment(sentiment, text, positiveScore, neutralScore, negativeScore, offset, length, minedOpinions); + return new SentenceSentiment(sentiment, text, positiveScore, neutralScore, negativeScore, offset, minedOpinions); } /// @@ -134,11 +133,10 @@ public static SentenceSentiment SentenceSentiment(TextSentiment sentiment, strin /// Sets the property. /// Sets the property. /// Sets the property. - /// Sets the property. /// >A new instance of for mocking purposes. - public static AspectSentiment AspectSentiment(TextSentiment sentiment, string text, double positiveScore, double negativeScore, int offset, int length) + public static AspectSentiment AspectSentiment(TextSentiment sentiment, string text, double positiveScore, double negativeScore, int offset) { - return new AspectSentiment(sentiment, text, positiveScore, negativeScore, offset, length); + return new AspectSentiment(sentiment, text, positiveScore, negativeScore, offset); } /// @@ -150,11 +148,10 @@ public static AspectSentiment AspectSentiment(TextSentiment sentiment, string te /// Sets the property. /// Sets the property. /// Sets the property. - /// Sets the property. /// A new instance of for mocking purposes. - public static OpinionSentiment OpinionSentiment(TextSentiment sentiment, double positiveScore, double negativeScore, string text, bool isNegated, int offset, int length) + public static OpinionSentiment OpinionSentiment(TextSentiment sentiment, double positiveScore, double negativeScore, string text, bool isNegated, int offset) { - return new OpinionSentiment(sentiment, positiveScore, negativeScore, text, isNegated, offset, length); + return new OpinionSentiment(sentiment, positiveScore, negativeScore, text, isNegated, offset); } /// @@ -280,11 +277,10 @@ public static CategorizedEntity CategorizedEntity(string text, string category, /// Sets the property. /// Sets the property. /// Sets the property. - /// Sets the property. /// A new instance of for mocking purposes. - public static CategorizedEntity CategorizedEntity(string text, string category, string subCategory, double score, int offset, int length) + public static CategorizedEntity CategorizedEntity(string text, string category, string subCategory, double score, int offset) { - return new CategorizedEntity(new Entity(text, category, subCategory, offset, length, score)); + return new CategorizedEntity(new Entity(text, category, subCategory, offset, default, score)); } /// @@ -345,11 +341,10 @@ public static RecognizeEntitiesResultCollection RecognizeEntitiesResultCollectio /// Sets the property. /// Sets the property. /// /// Sets the property. - /// Sets the property. /// A new instance of for mocking purposes. - public static PiiEntity PiiEntity(string text, string category, string subCategory, double score, int offset, int length) + public static PiiEntity PiiEntity(string text, string category, string subCategory, double score, int offset) { - return new PiiEntity(new Entity(text, category, subCategory, offset, length, score)); + return new PiiEntity(new Entity(text, category, subCategory, offset, default, score)); } /// @@ -494,7 +489,7 @@ public static LinkedEntity LinkedEntity(string name, string dataSourceEntityId, [EditorBrowsable(EditorBrowsableState.Never)] public static LinkedEntityMatch LinkedEntityMatch(string text, double score) { - return new LinkedEntityMatch(score, text, default, default); + return new LinkedEntityMatch(score, text, default); } /// @@ -503,11 +498,10 @@ public static LinkedEntityMatch LinkedEntityMatch(string text, double score) /// Sets the property. /// Sets the property. /// Sets the property. - /// Sets the property. /// A new instance of for mocking purposes. - public static LinkedEntityMatch LinkedEntityMatch(string text, double score, int offset, int length) + public static LinkedEntityMatch LinkedEntityMatch(string text, double score, int offset) { - return new LinkedEntityMatch(score, text, offset, length); + return new LinkedEntityMatch(score, text, offset); } /// diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/AnalyzeSentimentTests.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/AnalyzeSentimentTests.cs index 6089a82ab501..556d4e01009c 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/AnalyzeSentimentTests.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/AnalyzeSentimentTests.cs @@ -426,7 +426,6 @@ private void CheckAnalyzeSentimentProperties(DocumentSentiment doc, bool opinion Assert.IsNotNull(sentence.ConfidenceScores.Neutral); Assert.IsNotNull(sentence.ConfidenceScores.Negative); Assert.IsTrue(CheckTotalConfidenceScoreValue(sentence.ConfidenceScores)); - Assert.Greater(sentence.Length, 0); Assert.IsNotNull(sentence.MinedOpinions); if (opinionMining) @@ -443,8 +442,6 @@ private void CheckAnalyzeSentimentProperties(DocumentSentiment doc, bool opinion Assert.AreEqual(0, minedOpinions.Aspect.ConfidenceScores.Neutral); Assert.IsTrue(CheckTotalConfidenceScoreValue(minedOpinions.Aspect.ConfidenceScores)); Assert.IsNotNull(minedOpinions.Aspect.Offset); - Assert.IsNotNull(minedOpinions.Aspect.Length); - Assert.Greater(minedOpinions.Aspect.Length, 0); // Opinions Assert.IsNotNull(minedOpinions.Opinions); @@ -459,8 +456,6 @@ private void CheckAnalyzeSentimentProperties(DocumentSentiment doc, bool opinion Assert.IsTrue(CheckTotalConfidenceScoreValue(opinion.ConfidenceScores)); Assert.IsNotNull(opinion.IsNegated); Assert.IsNotNull(opinion.Offset); - Assert.IsNotNull(opinion.Length); - Assert.Greater(opinion.Length, 0); } } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/RecognizeEntitiesTests.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/RecognizeEntitiesTests.cs index 341d5cc53bb0..1fde3b16e05a 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/RecognizeEntitiesTests.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/RecognizeEntitiesTests.cs @@ -49,7 +49,6 @@ public async Task RecognizeEntitiesTest() { Assert.IsTrue(entitiesList.Contains(entity.Text)); Assert.IsNotNull(entity.ConfidenceScore); - Assert.Greater(entity.Length, 0); } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/RecognizeLinkedEntitiesTests.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/RecognizeLinkedEntitiesTests.cs index db099076daeb..a00dad375b7f 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/RecognizeLinkedEntitiesTests.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/RecognizeLinkedEntitiesTests.cs @@ -58,7 +58,6 @@ public async Task RecognizeLinkedEntitiesTest() LinkedEntityMatch match = entity.Matches.First(); Assert.IsNotNull(match.ConfidenceScore); Assert.IsNotNull(match.Text); - Assert.Greater(match.Length, 0); } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/RecognizePiiEntitiesTests.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/RecognizePiiEntitiesTests.cs index 8daed20c4254..bcba54f7019b 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/RecognizePiiEntitiesTests.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/RecognizePiiEntitiesTests.cs @@ -48,7 +48,6 @@ public async Task RecognizePiiEntitiesTest() foreach (PiiEntity entity in entities) { Assert.IsTrue(entitiesList.Contains(entity.Text)); - Assert.Greater(entity.Length, 0); } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/TextAnalyticsClientLiveTests.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/TextAnalyticsClientLiveTests.cs index 546176b6a84d..463f215fd1b3 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/TextAnalyticsClientLiveTests.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/TextAnalyticsClientLiveTests.cs @@ -23,7 +23,6 @@ public async Task TextWithEmoji() Assert.AreEqual(1, entities.Count); Assert.AreEqual("Microsoft", entities.FirstOrDefault().Text); Assert.AreEqual(3, entities.FirstOrDefault().Offset); - Assert.AreEqual(9, entities.FirstOrDefault().Length); } [Test] @@ -37,7 +36,6 @@ public async Task TextWithDiacriticsNFC() Assert.AreEqual(1, entities.Count); Assert.AreEqual("Microsoft", entities.FirstOrDefault().Text); Assert.AreEqual(4, entities.FirstOrDefault().Offset); - Assert.AreEqual(9, entities.FirstOrDefault().Length); } [Test] @@ -51,7 +49,6 @@ public async Task TextInKoreanNFC() Assert.AreEqual(1, entities.Count); Assert.AreEqual("Bill Gates", entities.FirstOrDefault().Text); Assert.AreEqual(3, entities.FirstOrDefault().Offset); - Assert.AreEqual(10, entities.FirstOrDefault().Length); } [Test] diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample2_AnalyzeSentimentBatch.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample2_AnalyzeSentimentBatch.cs index 31999bb8d932..4e3240a7c671 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample2_AnalyzeSentimentBatch.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample2_AnalyzeSentimentBatch.cs @@ -72,7 +72,7 @@ public void AnalyzeSentimentBatch() foreach (SentenceSentiment sentenceSentiment in result.DocumentSentiment.Sentences) { Console.WriteLine($" For sentence: \"{sentenceSentiment.Text}\""); - Console.WriteLine($" Offset (in UTF-16 code units): {sentenceSentiment.Offset}, Length (in UTF-16 code units): {sentenceSentiment.Length}"); + Console.WriteLine($" Offset (in UTF-16 code units): {sentenceSentiment.Offset}"); Console.WriteLine($" Sentiment is {sentenceSentiment.Sentiment}, with confidence scores: "); Console.WriteLine($" Positive confidence score: {sentenceSentiment.ConfidenceScores.Positive}."); Console.WriteLine($" Neutral confidence score: {sentenceSentiment.ConfidenceScores.Neutral}."); diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample2_AnalyzeSentimentBatchAsync.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample2_AnalyzeSentimentBatchAsync.cs index 0cb0ec4e8550..bf549c75d3a8 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample2_AnalyzeSentimentBatchAsync.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample2_AnalyzeSentimentBatchAsync.cs @@ -70,7 +70,7 @@ public async Task AnalyzeSentimentBatchAsync() foreach (SentenceSentiment sentenceSentiment in result.DocumentSentiment.Sentences) { Console.WriteLine($" For sentence: \"{sentenceSentiment.Text}\""); - Console.WriteLine($" Offset (in UTF-16 code units): {sentenceSentiment.Offset}, Length (in UTF-16 code units): {sentenceSentiment.Length}"); + Console.WriteLine($" Offset (in UTF-16 code units): {sentenceSentiment.Offset}"); Console.WriteLine($" Sentiment is {sentenceSentiment.Sentiment}, with confidence scores: "); Console.WriteLine($" Positive confidence score: {sentenceSentiment.ConfidenceScores.Positive}."); Console.WriteLine($" Neutral confidence score: {sentenceSentiment.ConfidenceScores.Neutral}."); diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample2_AnalyzeSentimentBatchConvenienceAsync.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample2_AnalyzeSentimentBatchConvenienceAsync.cs index d6297f12c587..48437ddf10fb 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample2_AnalyzeSentimentBatchConvenienceAsync.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample2_AnalyzeSentimentBatchConvenienceAsync.cs @@ -56,7 +56,7 @@ public async Task AnalyzeSentimentBatchConvenienceAsync() foreach (SentenceSentiment sentenceSentiment in result.DocumentSentiment.Sentences) { Console.WriteLine($" For sentence: \"{sentenceSentiment.Text}\""); - Console.WriteLine($" Offset (in UTF-16 code units): {sentenceSentiment.Offset}, Length (in UTF-16 code units): {sentenceSentiment.Length}"); + Console.WriteLine($" Offset (in UTF-16 code units): {sentenceSentiment.Offset}"); Console.WriteLine($" Sentiment is {sentenceSentiment.Sentiment}, with confidence scores: "); Console.WriteLine($" Positive confidence score: {sentenceSentiment.ConfidenceScores.Positive}."); Console.WriteLine($" Neutral confidence score: {sentenceSentiment.ConfidenceScores.Neutral}."); diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample4_RecognizeEntities.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample4_RecognizeEntities.cs index 676046c28655..0b217904c457 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample4_RecognizeEntities.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample4_RecognizeEntities.cs @@ -28,7 +28,7 @@ public void RecognizeEntities() Console.WriteLine($"Recognized {entities.Count} entities:"); foreach (CategorizedEntity entity in entities) { - Console.WriteLine($"Text: {entity.Text}, Offset (in UTF-16 code units): {entity.Offset}, Length (in UTF-16 code units): {entity.Length}"); + Console.WriteLine($"Text: {entity.Text}, Offset (in UTF-16 code units): {entity.Offset}"); Console.WriteLine($"Category: {entity.Category}, SubCategory: {entity.SubCategory}, Confidence score: {entity.ConfidenceScore}"); } #endregion diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample4_RecognizeEntitiesAsync.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample4_RecognizeEntitiesAsync.cs index 3f6de8968a8c..627b97f6721e 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample4_RecognizeEntitiesAsync.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample4_RecognizeEntitiesAsync.cs @@ -28,7 +28,7 @@ public async Task RecognizeEntitiesAsync() Console.WriteLine($"Recognized {entities.Count} entities:"); foreach (CategorizedEntity entity in entities) { - Console.WriteLine($"Text: {entity.Text}, Offset (in UTF-16 code units): {entity.Offset}, Length (in UTF-16 code units): {entity.Length}"); + Console.WriteLine($"Text: {entity.Text}, Offset (in UTF-16 code units): {entity.Offset}"); Console.WriteLine($"Category: {entity.Category}, SubCategory: {entity.SubCategory}, Confidence score: {entity.ConfidenceScore}"); } #endregion diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample4_RecognizeEntitiesBatch.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample4_RecognizeEntitiesBatch.cs index 5cb3d8d548f4..d0ab8907014c 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample4_RecognizeEntitiesBatch.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample4_RecognizeEntitiesBatch.cs @@ -63,7 +63,7 @@ public void RecognizeEntitiesBatch() foreach (CategorizedEntity entity in result.Entities) { - Debug.WriteLine($" Text: {entity.Text}, Offset (in UTF-16 code units): {entity.Offset}, Length (in UTF-16 code units): {entity.Length}"); + Debug.WriteLine($" Text: {entity.Text}, Offset (in UTF-16 code units): {entity.Offset}"); Debug.WriteLine($" Text: {entity.Text}, Category: {entity.Category}, SubCategory: {entity.SubCategory}, Confidence score: {entity.ConfidenceScore}"); } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample4_RecognizeEntitiesBatchAsync.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample4_RecognizeEntitiesBatchAsync.cs index 8590e898ca96..f181f08fb3a6 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample4_RecognizeEntitiesBatchAsync.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample4_RecognizeEntitiesBatchAsync.cs @@ -61,7 +61,7 @@ public async Task RecognizeEntitiesBatchAsync() foreach (CategorizedEntity entity in result.Entities) { - Console.WriteLine($" Text: {entity.Text}, Offset (in UTF-16 code units): {entity.Offset}, Length (in UTF-16 code units): {entity.Length}"); + Console.WriteLine($" Text: {entity.Text}, Offset (in UTF-16 code units): {entity.Offset}"); Console.WriteLine($" Text: {entity.Text}, Category: {entity.Category}, SubCategory: {entity.SubCategory}, Confidence score: {entity.ConfidenceScore}"); } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample4_RecognizeEntitiesBatchConvenience.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample4_RecognizeEntitiesBatchConvenience.cs index 9da5fa7ec142..df79760c9b84 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample4_RecognizeEntitiesBatchConvenience.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample4_RecognizeEntitiesBatchConvenience.cs @@ -42,7 +42,7 @@ public void RecognizeEntitiesBatchConvenience() foreach (CategorizedEntity entity in result.Entities) { - Debug.WriteLine($" Text: {entity.Text}, Offset (in UTF-16 code units): {entity.Offset}, Length (in UTF-16 code units): {entity.Length}"); + Debug.WriteLine($" Text: {entity.Text}, Offset (in UTF-16 code units): {entity.Offset}"); Debug.WriteLine($" Text: {entity.Text}, Category: {entity.Category}, SubCategory: {entity.SubCategory}, Confidence score: {entity.ConfidenceScore}"); } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample4_RecognizeEntitiesBatchConvenienceAsync.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample4_RecognizeEntitiesBatchConvenienceAsync.cs index 7a1bf869116e..f674adcd7696 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample4_RecognizeEntitiesBatchConvenienceAsync.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample4_RecognizeEntitiesBatchConvenienceAsync.cs @@ -40,7 +40,7 @@ public async Task RecognizeEntitiesBatchConvenienceAsync() foreach (CategorizedEntity entity in result.Entities) { - Console.WriteLine($" Text: {entity.Text}, Offset (in UTF-16 code units): {entity.Offset}, Length (in UTF-16 code units): {entity.Length}"); + Console.WriteLine($" Text: {entity.Text}, Offset (in UTF-16 code units): {entity.Offset}"); Console.WriteLine($" Text: {entity.Text}, Category: {entity.Category}, SubCategory: {entity.SubCategory}, Confidence score: {entity.ConfidenceScore}"); } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample6_RecognizeLinkedEntities.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample6_RecognizeLinkedEntities.cs index d7aeb29e4278..d4099e260ea1 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample6_RecognizeLinkedEntities.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample6_RecognizeLinkedEntities.cs @@ -31,7 +31,7 @@ public void ExtractEntityLinking() Console.WriteLine($"Name: {linkedEntity.Name}, Language: {linkedEntity.Language}, Data Source: {linkedEntity.DataSource}, Url: {linkedEntity.Url.ToString()}, Entity Id in Data Source: {linkedEntity.DataSourceEntityId}"); foreach (LinkedEntityMatch match in linkedEntity.Matches) { - Console.WriteLine($" Match Text: {match.Text}, Offset (in UTF-16 code units): {match.Offset}, Length (in UTF-16 code units): {match.Length}"); + Console.WriteLine($" Match Text: {match.Text}, Offset (in UTF-16 code units): {match.Offset}"); Console.WriteLine($" Confidence score: {match.ConfidenceScore}"); } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample6_RecognizeLinkedEntitiesAsync.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample6_RecognizeLinkedEntitiesAsync.cs index 8e6e0e2a689c..301072b129bc 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample6_RecognizeLinkedEntitiesAsync.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample6_RecognizeLinkedEntitiesAsync.cs @@ -29,7 +29,7 @@ public async Task ExtractEntityLinkingAsync() Console.WriteLine($"Name: {linkedEntity.Name}, Language: {linkedEntity.Language}, Data Source: {linkedEntity.DataSource}, Url: {linkedEntity.Url}, Entity Id in Data Source: {linkedEntity.DataSourceEntityId}"); foreach (LinkedEntityMatch match in linkedEntity.Matches) { - Console.WriteLine($" Match Text: {match.Text}, Offset (in UTF-16 code units): {match.Offset}, Length (in UTF-16 code units): {match.Length}"); + Console.WriteLine($" Match Text: {match.Text}, Offset (in UTF-16 code units): {match.Offset}"); Console.WriteLine($" Confidence score: {match.ConfidenceScore}"); } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample6_RecognizeLinkedEntitiesBatch.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample6_RecognizeLinkedEntitiesBatch.cs index cd26797a0483..3f2c290bf864 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample6_RecognizeLinkedEntitiesBatch.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample6_RecognizeLinkedEntitiesBatch.cs @@ -66,7 +66,7 @@ public void ExtractEntityLinkingBatch() Debug.WriteLine($" Name: \"{linkedEntity.Name}\", Language: {linkedEntity.Language}, Data Source: {linkedEntity.DataSource}, Url: {linkedEntity.Url.ToString()}, Entity Id in Data Source: \"{linkedEntity.DataSourceEntityId}\""); foreach (LinkedEntityMatch match in linkedEntity.Matches) { - Debug.WriteLine($" Match Text: \"{match.Text}\", Offset (in UTF-16 code units): {match.Offset}, Length (in UTF-16 code units): {match.Length}"); + Debug.WriteLine($" Match Text: \"{match.Text}\", Offset (in UTF-16 code units): {match.Offset}"); Debug.WriteLine($" Confidence score: {match.ConfidenceScore}"); } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample6_RecognizeLinkedEntitiesBatchAsync.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample6_RecognizeLinkedEntitiesBatchAsync.cs index 1b66b5dfd9ae..168d9733582e 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample6_RecognizeLinkedEntitiesBatchAsync.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample6_RecognizeLinkedEntitiesBatchAsync.cs @@ -64,7 +64,7 @@ public async Task ExtractEntityLinkingBatchAsync() Console.WriteLine($" Name: \"{linkedEntity.Name}\", Language: {linkedEntity.Language}, Data Source: {linkedEntity.DataSource}, Url: {linkedEntity.Url.ToString()}, Entity Id in Data Source: \"{linkedEntity.DataSourceEntityId}\""); foreach (LinkedEntityMatch match in linkedEntity.Matches) { - Console.WriteLine($" Match Text: \"{match.Text}\", Offset (in UTF-16 code units): {match.Offset}, Length (in UTF-16 code units): {match.Length}"); + Console.WriteLine($" Match Text: \"{match.Text}\", Offset (in UTF-16 code units): {match.Offset}"); Console.WriteLine($" Confidence score: {match.ConfidenceScore}"); } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample6_RecognizeLinkedEntitiesBatchConvenience.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample6_RecognizeLinkedEntitiesBatchConvenience.cs index 2c7156516eec..daf7a78a8f42 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample6_RecognizeLinkedEntitiesBatchConvenience.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample6_RecognizeLinkedEntitiesBatchConvenience.cs @@ -45,7 +45,7 @@ public void ExtractEntityLinkingBatchConvenience() Debug.WriteLine($" Name: \"{linkedEntity.Name}\", Language: {linkedEntity.Language}, Data Source: {linkedEntity.DataSource}, Url: {linkedEntity.Url.ToString()}, Entity Id in Data Source: \"{linkedEntity.DataSourceEntityId}\""); foreach (LinkedEntityMatch match in linkedEntity.Matches) { - Debug.WriteLine($" Match Text: \"{match.Text}\", Offset (in UTF-16 code units): {match.Offset}, Length (in UTF-16 code units): {match.Length}"); + Debug.WriteLine($" Match Text: \"{match.Text}\", Offset (in UTF-16 code units): {match.Offset}"); Debug.WriteLine($" Confidence score: {match.ConfidenceScore}"); } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample6_RecognizeLinkedEntitiesBatchConvenienceAsync.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample6_RecognizeLinkedEntitiesBatchConvenienceAsync.cs index 9b50b581e30a..efc9382f59e2 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample6_RecognizeLinkedEntitiesBatchConvenienceAsync.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample6_RecognizeLinkedEntitiesBatchConvenienceAsync.cs @@ -43,7 +43,7 @@ public async Task ExtractEntityLinkingBatchConvenienceAsync() Console.WriteLine($" Name: \"{linkedEntity.Name}\", Language: {linkedEntity.Language}, Data Source: {linkedEntity.DataSource}, Url: {linkedEntity.Url.ToString()}, Entity Id in Data Source: \"{linkedEntity.DataSourceEntityId}\""); foreach (LinkedEntityMatch match in linkedEntity.Matches) { - Console.WriteLine($" Match Text: \"{match.Text}\", Offset (in UTF-16 code units): {match.Offset}, Length (in UTF-16 code units): {match.Length}"); + Console.WriteLine($" Match Text: \"{match.Text}\", Offset (in UTF-16 code units): {match.Offset}"); Console.WriteLine($" Confidence score: {match.ConfidenceScore}"); } }