Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions sdk/formrecognizer/ai-form-recognizer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Release History

## 4.0.0-beta.3 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes

## 4.0.0-beta.2 (2021-11-09)

### Features Added
Expand Down
2 changes: 1 addition & 1 deletion sdk/formrecognizer/ai-form-recognizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"sdk-type": "client",
"author": "Microsoft Corporation",
"description": "An isomorphic client library for the Azure Form Recognizer service.",
"version": "4.0.0-beta.2",
"version": "4.0.0-beta.3",
"keywords": [
"node",
"azure",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async function main() {
// The form recognizer service will access the following URL to a receipt image and extract data from it
"https://raw.githubusercontent.com/Azure/azure-sdk-for-js/main/sdk/formrecognizer/ai-form-recognizer/assets/receipt/contoso-receipt.png"
);
poller.onProgress((state) => console.log(state.operationId, state.status));
poller.onProgress((state) => console.log("Operation:", state.modelId, state.status));

const {
documents: [result]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ const {
DocumentModelAdministrationClient
} = require("@azure/ai-form-recognizer");

const dotenv = require("dotenv");
dotenv.config();

async function main() {
const endpoint = process.env.FORM_RECOGNIZER_ENDPOINT ?? "<endpoint>";
const credential = new AzureKeyCredential(process.env.FORM_RECOGNIZER_API_KEY ?? "<api key>");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const {
AzureKeyCredential
} = require("@azure/ai-form-recognizer");

// Load the .env file if it exists
const dotenv = require("dotenv");
dotenv.config();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ const {
DocumentModelAdministrationClient
} = require("@azure/ai-form-recognizer");

const dotenv = require("dotenv");
dotenv.config();

async function main() {
const endpoint = process.env.FORM_RECOGNIZER_ENDPOINT ?? "<endpoint>";
const credential = new AzureKeyCredential(process.env.FORM_RECOGNIZER_API_KEY ?? "<api key>");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@ async function main() {
console.log("- Page", page.pageNumber, `(unit: ${page.unit})`);
console.log(` ${page.width}x${page.height}, angle: ${page.angle}`);
console.log(` ${page.lines.length} lines, ${page.words.length} words`);

if (page.lines.length > 0) {
console.log(" Lines:");

for (const line of page.lines) {
console.log(` - "${line.content}"`);

// The words of the line can also be iterated independently. The words are computed based on their
// corresponding spans.
for (const word of line.words()) {
console.log(` - "${word.content}"`);
}
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async function main() {
// The form recognizer service will access the following URL to a receipt image and extract data from it
"https://raw.githubusercontent.com/Azure/azure-sdk-for-js/main/sdk/formrecognizer/ai-form-recognizer/assets/receipt/contoso-receipt.png"
);
poller.onProgress((state) => console.log(state.operationId, state.status));
poller.onProgress((state) => console.log("Operation:", state.modelId, state.status));

const {
documents: [result],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

import { AzureKeyCredential, DocumentModelAdministrationClient } from "@azure/ai-form-recognizer";

import * as dotenv from "dotenv";
dotenv.config();

async function main() {
const endpoint = process.env.FORM_RECOGNIZER_ENDPOINT ?? "<endpoint>";
const credential = new AzureKeyCredential(process.env.FORM_RECOGNIZER_API_KEY ?? "<api key>");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

import { DocumentModelAdministrationClient, AzureKeyCredential } from "@azure/ai-form-recognizer";

// Load the .env file if it exists
import * as dotenv from "dotenv";
dotenv.config();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

import { AzureKeyCredential, DocumentModelAdministrationClient } from "@azure/ai-form-recognizer";

import * as dotenv from "dotenv";
dotenv.config();

async function main() {
const endpoint = process.env.FORM_RECOGNIZER_ENDPOINT ?? "<endpoint>";
const credential = new AzureKeyCredential(process.env.FORM_RECOGNIZER_API_KEY ?? "<api key>");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@ async function main() {
console.log("- Page", page.pageNumber, `(unit: ${page.unit})`);
console.log(` ${page.width}x${page.height}, angle: ${page.angle}`);
console.log(` ${page.lines.length} lines, ${page.words.length} words`);

if (page.lines.length > 0) {
console.log(" Lines:");

for (const line of page.lines) {
console.log(` - "${line.content}"`);

// The words of the line can also be iterated independently. The words are computed based on their
// corresponding spans.
for (const word of line.words()) {
console.log(` - "${word.content}"`);
}
}
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion sdk/formrecognizer/ai-form-recognizer/swagger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ input-file: ./FormRecognizer.yml
override-client-name: GeneratedClient
add-credentials: false
typescript: true
package-version: "4.0.0-beta.2"
package-version: "4.0.0-beta.3"
```

## Customizations for Track 2 Generator
Expand Down