Skip to content

Commit a7c3acb

Browse files
authored
Rename bounding box model to FieldBoundingBox (#14241)
1 parent 76fc7e8 commit a7c3acb

22 files changed

+307
-451
lines changed

eng/jacoco-test-coverage/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<dependency>
4040
<groupId>com.azure</groupId>
4141
<artifactId>azure-ai-formrecognizer</artifactId>
42-
<version>3.0.0-beta.2</version> <!-- {x-version-update;com.azure:azure-ai-formrecognizer;current} -->
42+
<version>3.0.0</version> <!-- {x-version-update;com.azure:azure-ai-formrecognizer;current} -->
4343
</dependency>
4444
<dependency>
4545
<groupId>com.azure</groupId>

eng/versioning/version_client.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
com.azure:azure-sdk-all;1.0.0;1.0.0
55
com.azure:azure-sdk-parent;1.6.0;1.6.0
66
com.azure:azure-client-sdk-parent;1.7.0;1.7.0
7-
com.azure:azure-ai-formrecognizer;3.0.0-beta.1;3.0.0-beta.2
7+
com.azure:azure-ai-formrecognizer;3.0.0-beta.1;3.0.0
88
com.azure:azure-ai-textanalytics;5.0.0;5.1.0-beta.1
99
com.azure:azure-core;1.7.0;1.8.0-beta.1
1010
com.azure:azure-core-amqp;1.4.0;1.5.0-beta.1

sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# Release History
22

3-
## 3.0.0-beta.2 (Unreleased)
3+
## 3.0.0 (2020-08-20)
4+
First stable release of the azure-ai-formrecognizer client library supporting Azure Form Recognizer service API version v2.0.
45

6+
### Breaking Changes
7+
- Renamed `BoundingBox` model to `FieldBoundingBox`
58

69
## 3.0.0-beta.1 (2020-08-11)
710
This beta version targets Azure Form Recognizer service API version v2.0.

sdk/formrecognizer/azure-ai-formrecognizer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ from form documents. It includes the following main functionalities:
2323
<dependency>
2424
<groupId>com.azure</groupId>
2525
<artifactId>azure-ai-formrecognizer</artifactId>
26-
<version>3.0.0-beta.1</version>
26+
<version>3.0.0</version>
2727
</dependency>
2828
```
2929
[//]: # ({x-version-update-end})

sdk/formrecognizer/azure-ai-formrecognizer/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<groupId>com.azure</groupId>
1515
<artifactId>azure-ai-formrecognizer</artifactId>
16-
<version>3.0.0-beta.2</version> <!-- {x-version-update;com.azure:azure-ai-formrecognizer;current} -->
16+
<version>3.0.0</version> <!-- {x-version-update;com.azure:azure-ai-formrecognizer;current} -->
1717

1818
<name>Microsoft Azure client library for Form Recognizer</name>
1919
<description>This package contains the Microsoft Azure Cognitive Services Form Recognizer SDK.</description>

sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/Transforms.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import com.azure.ai.formrecognizer.implementation.models.ReadResult;
1212
import com.azure.ai.formrecognizer.implementation.models.TextLine;
1313
import com.azure.ai.formrecognizer.implementation.models.TextWord;
14-
import com.azure.ai.formrecognizer.models.BoundingBox;
14+
import com.azure.ai.formrecognizer.models.FieldBoundingBox;
1515
import com.azure.ai.formrecognizer.models.FieldData;
1616
import com.azure.ai.formrecognizer.models.FieldValueType;
1717
import com.azure.ai.formrecognizer.models.FormElement;
@@ -456,20 +456,20 @@ private static List<FormWord> toWords(List<TextWord> words, int pageNumber) {
456456

457457
/**
458458
* Helper method to convert the service level modeled eight numbers representing the four points to SDK level
459-
* {@link BoundingBox}.
459+
* {@link FieldBoundingBox}.
460460
*
461461
* @param serviceBoundingBox A list of eight numbers representing the four points of a box.
462462
*
463-
* @return A {@link BoundingBox}.
463+
* @return A {@link FieldBoundingBox}.
464464
*/
465-
private static BoundingBox toBoundingBox(List<Float> serviceBoundingBox) {
465+
private static FieldBoundingBox toBoundingBox(List<Float> serviceBoundingBox) {
466466
if (CoreUtils.isNullOrEmpty(serviceBoundingBox) || (serviceBoundingBox.size() % 2) != 0) {
467467
return null;
468468
}
469469
List<Point> pointList = new ArrayList<>();
470470
for (int i = 0; i < serviceBoundingBox.size(); i++) {
471471
pointList.add(new Point(serviceBoundingBox.get(i), serviceBoundingBox.get(++i)));
472472
}
473-
return new BoundingBox(pointList);
473+
return new FieldBoundingBox(pointList);
474474
}
475475
}
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@
1313
* Quadrangle bounding box, with coordinates specified relative to the top-left of the original image
1414
*/
1515
@Immutable
16-
public final class BoundingBox {
16+
public final class FieldBoundingBox {
1717

1818
/**
19-
* The list of coordinates of the Bounding box.
19+
* The list of coordinates of the field's bounding box.
2020
*/
2121
private final List<Point> points;
2222

2323
/**
24-
* Constructs a Bounding box object.
24+
* Constructs a Field Bounding box object.
2525
*
26-
* @param points The list of coordinates of the Bounding box.
26+
* @param points The list of coordinates of the field's bounding box.
2727
*/
28-
public BoundingBox(final List<Point> points) {
28+
public FieldBoundingBox(final List<Point> points) {
2929
if (points == null) {
3030
this.points = null;
3131
} else {
@@ -36,16 +36,16 @@ public BoundingBox(final List<Point> points) {
3636
/**
3737
* Gets the list of all point coordinates of the bounding box.
3838
*
39-
* @return The unmodifiable list of all point coordinates of the Bounding box.
39+
* @return The unmodifiable list of all point coordinates of the field's bounding box.
4040
*/
4141
public List<Point> getPoints() {
4242
return this.points;
4343
}
4444

4545
/**
46-
* Returns a string representation of the {@link BoundingBox}.
46+
* Returns a string representation of the {@link FieldBoundingBox}.
4747
*
48-
* @return the string representation of the {@link BoundingBox}.
48+
* @return the string representation of the {@link FieldBoundingBox}.
4949
*/
5050
@Override
5151
public String toString() {

sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/FieldData.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ public final class FieldData extends FormElement {
2323
* Creates raw OCR FieldData item.
2424
*
2525
* @param text The text content of ExtractedField.
26-
* @param boundingBox The BoundingBox of ExtractedField.
26+
* @param boundingBox The Bounding Box of the recognized field.
2727
* @param pageNumber the 1 based page number.
2828
* @param fieldElements The list of element references when includeFieldElements is set to true.
2929
*/
30-
public FieldData(String text, BoundingBox boundingBox, int pageNumber,
30+
public FieldData(String text, FieldBoundingBox boundingBox, int pageNumber,
3131
final List<FormElement> fieldElements) {
3232
super(text, boundingBox, pageNumber);
3333
this.fieldElements = fieldElements == null ? null : Collections.unmodifiableList(fieldElements);
@@ -37,7 +37,7 @@ public FieldData(String text, BoundingBox boundingBox, int pageNumber,
3737
* {@inheritDoc}
3838
*/
3939
@Override
40-
public BoundingBox getBoundingBox() {
40+
public FieldBoundingBox getBoundingBox() {
4141
return super.getBoundingBox();
4242
}
4343

sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/FormElement.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ public abstract class FormElement {
2424
/*
2525
* BoundingBox specifying relative coordinates of the element.
2626
*/
27-
private final BoundingBox boundingBox;
27+
private final FieldBoundingBox boundingBox;
2828

2929
/**
3030
* Creates raw OCR item.
3131
* @param text The text content of the extracted element.
3232
* @param boundingBox The BoundingBox specifying relative coordinates of the element.
3333
* @param pageNumber the 1 based page number.
3434
*/
35-
FormElement(final String text, final BoundingBox boundingBox, final int pageNumber) {
35+
FormElement(final String text, final FieldBoundingBox boundingBox, final int pageNumber) {
3636
this.text = text;
3737
this.boundingBox = boundingBox;
3838
this.pageNumber = pageNumber;
@@ -43,7 +43,7 @@ public abstract class FormElement {
4343
*
4444
* @return the bounding box of the element.
4545
*/
46-
public BoundingBox getBoundingBox() {
46+
public FieldBoundingBox getBoundingBox() {
4747
return boundingBox;
4848
}
4949

sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/FormLine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public final class FormLine extends FormElement {
2828
* @param pageNumber the page number.
2929
* @param words The list of word element references.
3030
*/
31-
public FormLine(String text, BoundingBox boundingBox, Integer pageNumber,
31+
public FormLine(String text, FieldBoundingBox boundingBox, Integer pageNumber,
3232
final List<FormWord> words) {
3333
super(text, boundingBox, pageNumber);
3434
this.words = words == null ? null : Collections.unmodifiableList(words);
@@ -47,7 +47,7 @@ public List<FormWord> getWords() {
4747
* {@inheritDoc}
4848
*/
4949
@Override
50-
public BoundingBox getBoundingBox() {
50+
public FieldBoundingBox getBoundingBox() {
5151
return super.getBoundingBox();
5252
}
5353

sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/FormTableCell.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public final class FormTableCell extends FormElement {
7171
* @param fieldElements a list of references to the elements constituting this table cell.
7272
*/
7373
public FormTableCell(final int rowIndex, final int columnIndex, final int rowSpan,
74-
final int columnSpan, final String text, final BoundingBox boundingBox,
74+
final int columnSpan, final String text, final FieldBoundingBox boundingBox,
7575
final float confidence, final boolean isHeader, final boolean isFooter, final int pageNumber,
7676
final List<FormElement> fieldElements) {
7777
super(text, boundingBox, pageNumber);
@@ -106,7 +106,7 @@ public int getPageNumber() {
106106
* {@inheritDoc}
107107
*/
108108
@Override
109-
public BoundingBox getBoundingBox() {
109+
public FieldBoundingBox getBoundingBox() {
110110
return super.getBoundingBox();
111111
}
112112

sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/FormWord.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public final class FormWord extends FormElement {
2424
* @param pageNumber the 1 based page number.
2525
* @param confidence the confidence property of the Form Word.
2626
*/
27-
public FormWord(String text, BoundingBox boundingBox, int pageNumber, final float confidence) {
27+
public FormWord(String text, FieldBoundingBox boundingBox, int pageNumber, final float confidence) {
2828
super(text, boundingBox, pageNumber);
2929
this.confidence = confidence;
3030
}
@@ -42,7 +42,7 @@ public float getConfidence() {
4242
* {@inheritDoc}
4343
*/
4444
@Override
45-
public BoundingBox getBoundingBox() {
45+
public FieldBoundingBox getBoundingBox() {
4646
return super.getBoundingBox();
4747
}
4848

sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/GetBoundingBoxes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public static void main(String[] args) {
5656
final List<FormPage> pages = recognizedForm.getPages();
5757
for (int i1 = 0; i1 < pages.size(); i1++) {
5858
final FormPage formPage = pages.get(i1);
59-
System.out.printf("------- Recognizing info on page %s of Form -------%n", i1);
59+
System.out.printf("------- Recognizing info on page %s of Form ------- %n", i1);
6060
System.out.printf("Has width: %f, angle: %.2f, height: %f %n", formPage.getWidth(),
6161
formPage.getTextAngle(), formPage.getHeight());
6262
// Table information

0 commit comments

Comments
 (0)