Skip to content

Commit

Permalink
fix (Azure#18327)
Browse files Browse the repository at this point in the history
  • Loading branch information
maririos authored and jongio committed Feb 9, 2021
1 parent 1abc9f1 commit 351cdac
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,14 @@ public async Task RecognizeEntitiesWithSubCategoryTest()
TextAnalyticsClient client = GetClient();
string document = "I had a wonderful trip to Seattle last week.";

CategorizedEntityCollection entities = await client.RecognizeEntitiesAsync(document);
RecognizeEntitiesResultCollection result = await client.RecognizeEntitiesBatchAsync(new List<string>() { document }, options: new TextAnalyticsRequestOptions() { ModelVersion = "2020-04-01" } );

Assert.GreaterOrEqual(entities.Count, 3);
var documentResult = result.FirstOrDefault();
Assert.IsFalse(documentResult.HasError);

foreach (CategorizedEntity entity in entities)
Assert.GreaterOrEqual(documentResult.Entities.Count, 3);

foreach (CategorizedEntity entity in documentResult.Entities)
{
if (entity.Text == "last week")
Assert.AreEqual("DateRange", entity.SubCategory);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 351cdac

Please sign in to comment.