Skip to content

Commit

Permalink
Merge pull request #214 from HarshaNalluru/harshan/issue/207
Browse files Browse the repository at this point in the history
[Form Recognizer] BoundingBox to BoundingPolygon
  • Loading branch information
HarshaNalluru authored May 12, 2022
2 parents f3ab973 + fa375e2 commit e2165a9
Show file tree
Hide file tree
Showing 16 changed files with 546 additions and 218 deletions.
5 changes: 3 additions & 2 deletions common/config/rush/pnpm-lock.yaml

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

1 change: 1 addition & 0 deletions sdk/formrecognizer/ai-form-recognizer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
### Breaking Changes

- Renamed the `beginCopyModel` method of `DocumentModelAdministrationClient` to `beginCopyModelTo`. [#20775](https://github.com/Azure/azure-sdk-for-js/pull/20775)
- Renamed `BoundingRegion#boundingBox` to `BoundingRegion#polygon`, as the service may now provide arbitrary, polygonal bounding areas rather than just rectangles.

### Bugs Fixed

Expand Down
1 change: 1 addition & 0 deletions sdk/formrecognizer/ai-form-recognizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
"cross-env": "^7.0.2",
"dotenv": "^8.2.0",
"eslint": "^7.15.0",
"esm": "^3.2.18",
"karma": "^6.2.0",
"karma-chrome-launcher": "^3.0.0",
"karma-coverage": "^2.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ export interface ArrayFieldSchema<Item extends Readonly<FieldSchema> = Readonly<
export { AzureKeyCredential }

// @public
export interface BoundingRegion {
export interface BoundingRegion extends HasBoundingPolygon {
pageNumber: number;
polygon: number[];
}

// @public
Expand Down Expand Up @@ -338,6 +337,13 @@ export interface DocumentFieldSchema {
// @public
export type DocumentFieldType = string;

// @public
export interface DocumentImage extends HasBoundingPolygon {
confidence: number;
pageRef: number;
span: DocumentSpan;
}

// @public
export interface DocumentIntegerField extends DocumentValueField<number> {
kind: "integer";
Expand Down Expand Up @@ -365,8 +371,7 @@ export interface DocumentLanguage {
}

// @public
export interface DocumentLine {
boundingBox?: number[];
export interface DocumentLine extends HasBoundingPolygon {
content: string;
spans: DocumentSpan[];
words: () => IterableIterator<DocumentWord>;
Expand Down Expand Up @@ -423,18 +428,22 @@ export interface DocumentObjectField<Properties = {

// @public
export interface DocumentPage {
angle: number;
height: number;
kind: string;
angle?: number;
height?: number;
images?: DocumentImage[];
kind: DocumentPageKind;
lines?: DocumentLine[];
pageNumber: number;
pageNumber?: number;
selectionMarks?: DocumentSelectionMark[];
spans: DocumentSpan[];
unit: LengthUnit;
width: number;
unit?: LengthUnit;
width?: number;
words: DocumentWord[];
}

// @public
export type DocumentPageKind = string;

// @public
export interface DocumentParagraph {
boundingRegions?: BoundingRegion[];
Expand All @@ -450,9 +459,8 @@ export interface DocumentPhoneNumberField extends DocumentFieldCommon {
}

// @public
export interface DocumentSelectionMark {
export interface DocumentSelectionMark extends HasBoundingPolygon {
confidence: number;
polygon?: number[];
span: DocumentSpan;
state: SelectionMarkState;
}
Expand Down Expand Up @@ -542,10 +550,9 @@ export interface DocumentValueField<T> extends DocumentFieldCommon {
}

// @public
export interface DocumentWord {
export interface DocumentWord extends HasBoundingPolygon {
confidence: number;
content: string;
polygon?: number[];
span: DocumentSpan;
}

Expand Down Expand Up @@ -598,6 +605,11 @@ export interface GetModelOptions extends OperationOptions {
export interface GetOperationOptions extends OperationOptions {
}

// @public (undocumented)
export interface HasBoundingPolygon {
polygon?: Point2D[];
}

// @public
export type IdentityDocument = ReifyPrebuiltSchema<typeof IdentityDocumentSchema>;

Expand Down Expand Up @@ -1039,6 +1051,12 @@ export type OperationStatus = "notStarted" | "running" | "failed" | "succeeded"
// @public
export type ParagraphRole = string;

// @public
export interface Point2D {
x: number;
y: number;
}

// @public
export interface PollerOptions<TState extends PollOperationState<unknown>> extends OperationOptions {
onProgress?: (state: TState) => void;
Expand Down
26 changes: 13 additions & 13 deletions sdk/formrecognizer/ai-form-recognizer/src/generated/models/index.ts

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

15 changes: 2 additions & 13 deletions sdk/formrecognizer/ai-form-recognizer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,18 @@ export { DocumentAnalysisClient } from "./documentAnalysisClient";
export { DocumentModelAdministrationClient } from "./documentModelAdministrationClient";
export {
// Generated types used verbatim
BoundingRegion,
ContentType,
CopyAuthorization,
CurrencyValue,
DocTypeInfo,
DocumentBuildMode,
DocumentEntity,
DocumentFieldSchema,
DocumentFieldType,
DocumentKeyValueElement,
DocumentKeyValuePair,
DocumentSelectionMark,
DocumentSignatureType,
DocumentSpan,
DocumentLanguage,
DocumentStyle,
DocumentTable,
DocumentTableCell,
DocumentTableCellKind,
DocumentWord,
LengthUnit,
ModelInfo,
ModelSummary,
Expand All @@ -43,17 +35,13 @@ export {
CustomDocumentModelsInfo,
AnalyzeResultOperationStatus,
SelectionMarkState,
DocumentTableCaption,
DocumentTableFootnote,
DocumentParagraph,
ParagraphRole,
DocumentPageKind,
} from "./generated";
export {
AnalysisPoller,
AnalyzeResult,
AnalyzeResultCommon,
DocumentPage,
DocumentLine,
DocumentAnalysisPollOperationState,
AnalyzedDocument,
FormRecognizerRequestBody,
Expand All @@ -63,3 +51,4 @@ export * from "./models";
export * from "./options";
export * from "./prebuilt";
export { EnglishCapitalLetter, Acronymic } from "./util";
export { Point2D } from "./transforms/polygon";
Loading

0 comments on commit e2165a9

Please sign in to comment.