Skip to content

Commit 97cd1ee

Browse files
Merge pull request #2941 from laujan/update-code
update code
2 parents 533a4fe + 1ef9c41 commit 97cd1ee

File tree

4 files changed

+40
-40
lines changed

4 files changed

+40
-40
lines changed

articles/ai-services/document-intelligence/how-to-guides/includes/v4-0/csharp-sdk.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ foreach (DocumentPage page in result.Pages)
129129

130130
Console.WriteLine($" Its bounding polygon (points ordered clockwise):");
131131

132-
for (int j = 0; j < line.BoundingPolygon.Count; j++)
132+
for (int j = 0; j < line.Polygon.Count; j++)
133133
{
134-
Console.WriteLine($" Point {j} => X: {line.BoundingPolygon[j].X}, Y: {line.BoundingPolygon[j].Y}");
134+
Console.WriteLine($" Point {j} => X: {line.Polygon[j].X}, Y: {line.Polygon[j].Y}");
135135
}
136136
}
137137
}
@@ -196,9 +196,9 @@ foreach (DocumentPage page in result.Pages)
196196

197197
Console.WriteLine($" Its bounding polygon (points ordered clockwise):");
198198

199-
for (int j = 0; j < line.BoundingPolygon.Count; j++)
199+
for (int j = 0; j < line.Polygon.Count; j++)
200200
{
201-
Console.WriteLine($" Point {j} => X: {line.BoundingPolygon[j].X}, Y: {line.BoundingPolygon[j].Y}");
201+
Console.WriteLine($" Point {j} => X: {line.Polygon[j].X}, Y: {line.Polygon[j].Y}");
202202
}
203203
}
204204

@@ -209,9 +209,9 @@ foreach (DocumentPage page in result.Pages)
209209
Console.WriteLine($" Selection Mark {i} is {selectionMark.State}.");
210210
Console.WriteLine($" Its bounding polygon (points ordered clockwise):");
211211

212-
for (int j = 0; j < selectionMark.BoundingPolygon.Count; j++)
212+
for (int j = 0; j < selectionMark.Polygon.Count; j++)
213213
{
214-
Console.WriteLine($" Point {j} => X: {selectionMark.BoundingPolygon[j].X}, Y: {selectionMark.BoundingPolygon[j].Y}");
214+
Console.WriteLine($" Point {j} => X: {selectionMark.Polygon[j].X}, Y: {selectionMark.Polygon[j].Y}");
215215
}
216216
}
217217
}
@@ -308,9 +308,9 @@ foreach (DocumentPage page in result.Pages)
308308

309309
Console.WriteLine($" Its bounding polygon (points ordered clockwise):");
310310

311-
for (int j = 0; j < line.BoundingPolygon.Count; j++)
311+
for (int j = 0; j < line.Polygon.Count; j++)
312312
{
313-
Console.WriteLine($" Point {j} => X: {line.BoundingPolygon[j].X}, Y: {line.BoundingPolygon[j].Y}");
313+
Console.WriteLine($" Point {j} => X: {line.Polygon[j].X}, Y: {line.Polygon[j].Y}");
314314
}
315315
}
316316

@@ -321,9 +321,9 @@ foreach (DocumentPage page in result.Pages)
321321
Console.WriteLine($" Selection Mark {i} is {selectionMark.State}.");
322322
Console.WriteLine($" Its bounding polygon (points ordered clockwise):");
323323

324-
for (int j = 0; j < selectionMark.BoundingPolygon.Count; j++)
324+
for (int j = 0; j < selectionMark.Polygon.Count; j++)
325325
{
326-
Console.WriteLine($" Point {j} => X: {selectionMark.BoundingPolygon[j].X}, Y: {selectionMark.BoundingPolygon[j].Y}");
326+
Console.WriteLine($" Point {j} => X: {selectionMark.Polygon[j].X}, Y: {selectionMark.Polygon[j].Y}");
327327
}
328328
}
329329
}

articles/ai-services/document-intelligence/how-to-guides/includes/v4-0/java-sdk.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ analyzeLayoutResult.getPages().forEach(documentPage -> {
192192
documentPage.getLines().forEach(documentLine ->
193193
System.out.printf("Line %s is within a bounding polygon %s.%n",
194194
documentLine.getContent(),
195-
documentLine.getBoundingPolygon().toString()));
195+
documentLine.getPolygon().toString()));
196196

197197
// words
198198
documentPage.getWords().forEach(documentWord ->
@@ -258,7 +258,7 @@ analyzeLayoutResult.getPages().forEach(documentPage -> {
258258
documentPage.getLines().forEach(documentLine ->
259259
System.out.printf("Line %s is within a bounding polygon %s.%n",
260260
documentLine.getContent(),
261-
documentLine.getBoundingPolygon().toString()));
261+
documentLine.getPolygon().toString()));
262262

263263
// words
264264
documentPage.getWords().forEach(documentWord ->
@@ -270,7 +270,7 @@ analyzeLayoutResult.getPages().forEach(documentPage -> {
270270
documentPage.getSelectionMarks().forEach(documentSelectionMark ->
271271
System.out.printf("Selection mark is '%s' and is within a bounding polygon %s with confidence %.2f.%n",
272272
documentSelectionMark.getSelectionMarkState().toString(),
273-
getBoundingCoordinates(documentSelectionMark.getBoundingPolygon()),
273+
getBoundingCoordinates(documentSelectionMark.getPolygon()),
274274
documentSelectionMark.getConfidence()));
275275
});
276276

@@ -290,8 +290,8 @@ for (int i = 0; i < tables.size(); i++) {
290290
}
291291

292292
// Utility function to get the bounding polygon coordinates.
293-
private static String getBoundingCoordinates(List < Point > boundingPolygon) {
294-
return boundingPolygon.stream().map(point -> String.format("[%.2f, %.2f]", point.getX(),
293+
private static String getBoundingCoordinates(List < Point > Polygon) {
294+
return Polygon.stream().map(point -> String.format("[%.2f, %.2f]", point.getX(),
295295
point.getY())).collect(Collectors.joining(", "));
296296
}
297297

@@ -351,7 +351,7 @@ analyzeResult.getPages().forEach(documentPage -> {
351351
documentPage.getLines().forEach(documentLine ->
352352
System.out.printf("Line %s is within a bounding polygon %s.%n",
353353
documentLine.getContent(),
354-
documentLine.getBoundingPolygon().toString()));
354+
documentLine.getPolygon().toString()));
355355

356356
// words
357357
documentPage.getWords().forEach(documentWord ->

articles/ai-services/document-intelligence/quickstarts/includes/csharp-sdk.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,10 @@ foreach (DocumentPage page in result.Pages)
344344
Console.WriteLine($" Line {i} has content: '{line.Content}'.");
345345

346346
Console.WriteLine($" Its bounding box is:");
347-
Console.WriteLine($" Upper left => X: {line.BoundingPolygon[0].X}, Y= {line.BoundingPolygon[0].Y}");
348-
Console.WriteLine($" Upper right => X: {line.BoundingPolygon[1].X}, Y= {line.BoundingPolygon[1].Y}");
349-
Console.WriteLine($" Lower right => X: {line.BoundingPolygon[2].X}, Y= {line.BoundingPolygon[2].Y}");
350-
Console.WriteLine($" Lower left => X: {line.BoundingPolygon[3].X}, Y= {line.BoundingPolygon[3].Y}");
347+
Console.WriteLine($" Upper left => X: {line.Polygon[0].X}, Y= {line.Polygon[0].Y}");
348+
Console.WriteLine($" Upper right => X: {line.Polygon[1].X}, Y= {line.Polygon[1].Y}");
349+
Console.WriteLine($" Lower right => X: {line.Polygon[2].X}, Y= {line.Polygon[2].Y}");
350+
Console.WriteLine($" Lower left => X: {line.Polygon[3].X}, Y= {line.Polygon[3].Y}");
351351
}
352352

353353
for (int i = 0; i < page.SelectionMarks.Count; i++)
@@ -356,10 +356,10 @@ foreach (DocumentPage page in result.Pages)
356356

357357
Console.WriteLine($" Selection Mark {i} is {selectionMark.State}.");
358358
Console.WriteLine($" Its bounding box is:");
359-
Console.WriteLine($" Upper left => X: {selectionMark.BoundingPolygon[0].X}, Y= {selectionMark.BoundingPolygon[0].Y}");
360-
Console.WriteLine($" Upper right => X: {selectionMark.BoundingPolygon[1].X}, Y= {selectionMark.BoundingPolygon[1].Y}");
361-
Console.WriteLine($" Lower right => X: {selectionMark.BoundingPolygon[2].X}, Y= {selectionMark.BoundingPolygon[2].Y}");
362-
Console.WriteLine($" Lower left => X: {selectionMark.BoundingPolygon[3].X}, Y= {selectionMark.BoundingPolygon[3].Y}");
359+
Console.WriteLine($" Upper left => X: {selectionMark.Polygon[0].X}, Y= {selectionMark.Polygon[0].Y}");
360+
Console.WriteLine($" Upper right => X: {selectionMark.Polygon[1].X}, Y= {selectionMark.Polygon[1].Y}");
361+
Console.WriteLine($" Lower right => X: {selectionMark.Polygon[2].X}, Y= {selectionMark.Polygon[2].Y}");
362+
Console.WriteLine($" Lower left => X: {selectionMark.Polygon[3].X}, Y= {selectionMark.Polygon[3].Y}");
363363
}
364364
}
365365

@@ -459,9 +459,9 @@ foreach (DocumentPage page in result.Pages)
459459

460460
Console.WriteLine($" Its bounding polygon (points ordered clockwise):");
461461

462-
for (int j = 0; j < line.BoundingPolygon.Count; j++)
462+
for (int j = 0; j < line.Polygon.Count; j++)
463463
{
464-
Console.WriteLine($" Point {j} => X: {line.BoundingPolygon[j].X}, Y: {line.BoundingPolygon[j].Y}");
464+
Console.WriteLine($" Point {j} => X: {line.Polygon[j].X}, Y: {line.Polygon[j].Y}");
465465
}
466466
}
467467

@@ -472,9 +472,9 @@ foreach (DocumentPage page in result.Pages)
472472
Console.WriteLine($" Selection Mark {i} is {selectionMark.State}.");
473473
Console.WriteLine($" Its bounding polygon (points ordered clockwise):");
474474

475-
for (int j = 0; j < selectionMark.BoundingPolygon.Count; j++)
475+
for (int j = 0; j < selectionMark.Polygon.Count; j++)
476476
{
477-
Console.WriteLine($" Point {j} => X: {selectionMark.BoundingPolygon[j].X}, Y: {selectionMark.BoundingPolygon[j].Y}");
477+
Console.WriteLine($" Point {j} => X: {selectionMark.Polygon[j].X}, Y: {selectionMark.Polygon[j].Y}");
478478
}
479479
}
480480
}
@@ -542,9 +542,9 @@ foreach (DocumentPage page in result.Pages)
542542

543543
Console.WriteLine($" Its bounding polygon (points ordered clockwise):");
544544

545-
for (int j = 0; j < line.BoundingPolygon.Count; j++)
545+
for (int j = 0; j < line.Polygon.Count; j++)
546546
{
547-
Console.WriteLine($" Point {j} => X: {line.BoundingPolygon[j].X}, Y: {line.BoundingPolygon[j].Y}");
547+
Console.WriteLine($" Point {j} => X: {line.Polygon[j].X}, Y: {line.Polygon[j].Y}");
548548
}
549549
}
550550

@@ -555,9 +555,9 @@ foreach (DocumentPage page in result.Pages)
555555
Console.WriteLine($" Selection Mark {i} is {selectionMark.State}.");
556556
Console.WriteLine($" Its bounding polygon (points ordered clockwise):");
557557

558-
for (int j = 0; j < selectionMark.BoundingPolygon.Count; j++)
558+
for (int j = 0; j < selectionMark.Polygon.Count; j++)
559559
{
560-
Console.WriteLine($" Point {j} => X: {selectionMark.BoundingPolygon[j].X}, Y: {selectionMark.BoundingPolygon[j].Y}");
560+
Console.WriteLine($" Point {j} => X: {selectionMark.Polygon[j].X}, Y: {selectionMark.Polygon[j].Y}");
561561
}
562562
}
563563
}

articles/ai-services/document-intelligence/quickstarts/includes/java-sdk.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ public class FormRecognizer {
424424
documentPage.getLines().forEach(documentLine ->
425425
System.out.printf("Line %s is within a bounding polygon %s.%n",
426426
documentLine.getContent(),
427-
documentLine.getBoundingPolygon().toString()));
427+
documentLine.getPolygon().toString()));
428428

429429
// words
430430
documentPage.getWords().forEach(documentWord ->
@@ -436,7 +436,7 @@ public class FormRecognizer {
436436
documentPage.getSelectionMarks().forEach(documentSelectionMark ->
437437
System.out.printf("Selection mark is %s and is within a bounding polygon %s with confidence %.2f.%n",
438438
documentSelectionMark.getState().toString(),
439-
documentSelectionMark.getBoundingPolygon().toString(),
439+
documentSelectionMark.getPolygon().toString(),
440440
documentSelectionMark.getConfidence()));
441441
});
442442

@@ -454,8 +454,8 @@ public class FormRecognizer {
454454
}
455455
}
456456
// Utility function to get the bounding polygon coordinates
457-
private static String getBoundingCoordinates(List < Point > boundingPolygon) {
458-
return boundingPolygon.stream().map(point -> String.format("[%.2f, %.2f]", point.getX(),
457+
private static String getBoundingCoordinates(List < Point > Polygon) {
458+
return Polygon.stream().map(point -> String.format("[%.2f, %.2f]", point.getX(),
459459
point.getY())).collect(Collectors.joining(", "));
460460
}
461461
}
@@ -556,7 +556,7 @@ public class FormRecognizer {
556556
documentPage.getLines().forEach(documentLine ->
557557
System.out.printf("Line '%s' is within a bounding polygon %s.%n",
558558
documentLine.getContent(),
559-
getBoundingCoordinates(documentLine.getBoundingPolygon())));
559+
getBoundingCoordinates(documentLine.getPolygon())));
560560

561561
// words
562562
documentPage.getWords().forEach(documentWord ->
@@ -568,7 +568,7 @@ public class FormRecognizer {
568568
documentPage.getSelectionMarks().forEach(documentSelectionMark ->
569569
System.out.printf("Selection mark is '%s' and is within a bounding polygon %s with confidence %.2f.%n",
570570
documentSelectionMark.getSelectionMarkState().toString(),
571-
getBoundingCoordinates(documentSelectionMark.getBoundingPolygon()),
571+
getBoundingCoordinates(documentSelectionMark.getPolygon()),
572572
documentSelectionMark.getConfidence()));
573573
});
574574

@@ -593,8 +593,8 @@ public class FormRecognizer {
593593
/**
594594
* Utility function to get the bounding polygon coordinates.
595595
*/
596-
private static String getBoundingCoordinates(List < Point > boundingPolygon) {
597-
return boundingPolygon.stream().map(point -> String.format("[%.2f, %.2f]", point.getX(),
596+
private static String getBoundingCoordinates(List < Point > Polygon) {
597+
return Polygon.stream().map(point -> String.format("[%.2f, %.2f]", point.getX(),
598598
point.getY())).collect(Collectors.joining(", "));
599599
}
600600
}

0 commit comments

Comments
 (0)