Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 57bad83

Browse files
committed
Added confidence property to blocks and lines for ios
1 parent 0a44cd2 commit 57bad83

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/mlkit/textrecognition/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ export interface MLKitRecognizeTextResultElement {
1818

1919
export interface MLKitRecognizeTextResultLine {
2020
text: string;
21-
confidence: string;
21+
confidence: number;
2222
bounds: MLKitRecognizeTextResultBounds;
2323
elements: Array<MLKitRecognizeTextResultElement>;
2424
}
2525

2626
export interface MLKitRecognizeTextResultBlock {
2727
text: string;
28-
confidence: string;
28+
confidence: number;
2929
bounds: MLKitRecognizeTextResultBounds;
3030
lines: Array<MLKitRecognizeTextResultLine>;
3131
}

src/mlkit/textrecognition/index.ios.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,15 @@ function getResult(visionText: FIRVisionText): MLKitRecognizeTextResult {
4444
const feature: FIRVisionTextBlock = visionText.blocks.objectAtIndex(i);
4545
const resultFeature = <MLKitRecognizeTextResultBlock>{
4646
text: feature.text,
47+
confidence: feature.confidence,
4748
bounds: feature.frame,
4849
lines: []
4950
};
5051

5152
const addLineToResult = (line: FIRVisionTextLine): void => {
5253
const resultLine = <MLKitRecognizeTextResultLine>{
5354
text: feature.text,
55+
confidence: line.confidence,
5456
bounds: line.frame,
5557
elements: []
5658
};

0 commit comments

Comments
 (0)