-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a3e1d2
commit 86a1d83
Showing
14 changed files
with
53 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
# Changelog | ||
|
||
## 1.3.0+3 | ||
|
||
* funding | ||
|
||
## 1.3.0+2 | ||
|
||
* dependency bump | ||
* parent project | ||
|
||
## 1.3.0+1 | ||
|
||
* less debug output | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 16 additions & 15 deletions
31
packages/google_vision/example/document_text_detection_file.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,39 @@ | ||
import 'package:google_vision/google_vision.dart'; | ||
import 'package:universal_io/io.dart'; | ||
|
||
void main() async { | ||
final googleVision = | ||
await GoogleVision.withJwtFile('service_credentials.json'); | ||
|
||
print('checking...'); | ||
|
||
const int page = 1; | ||
|
||
final annotateFileResponses = await googleVision.file.documentTextDetection( | ||
InputConfig.fromFilePath('sample_image/allswell.pdf'), | ||
pages: [1], | ||
pages: [page], | ||
); | ||
|
||
String text = ''; | ||
|
||
for (var annotateFileResponse in annotateFileResponses) { | ||
if (annotateFileResponse.error != null) { | ||
print('error'); | ||
} else { | ||
print('pages: ${annotateFileResponse.totalPages}'); | ||
} | ||
print('page: $page of ${annotateFileResponse.totalPages}'); | ||
|
||
for (var annotateImageResponse in annotateFileResponse.responses!) { | ||
annotateImageResponse.fullTextAnnotation!.pages.first.blocks | ||
?.forEach((block) { | ||
block.paragraphs?.forEach((paragraph) { | ||
paragraph.words?.forEach((word) { | ||
var segment = word.symbols?.map((e) => e.text).join(); | ||
for (var annotateImageResponse in annotateFileResponse.responses!) { | ||
annotateImageResponse.fullTextAnnotation!.pages.first.blocks | ||
?.forEach((block) { | ||
block.paragraphs?.forEach((paragraph) { | ||
stdout.write('\n'); | ||
|
||
text += (segment ?? '') + ' '; | ||
paragraph.words?.forEach((word) { | ||
var segment = word.symbols?.map((e) => e.text).join(); | ||
|
||
stdout.write('${segment ?? ''} '); | ||
}); | ||
}); | ||
}); | ||
}); | ||
} | ||
} | ||
} | ||
|
||
print(text); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ dependencies: | |
pcanvas: ^1.1.0 | ||
google_vision: | ||
path: ../ | ||
universal_io: ^2.2.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# Changelog | ||
|
||
## 1.3.0+3 | ||
|
||
* funding | ||
|
||
## 1.3.0+2 | ||
|
||
* removed FutureBuilder nesting | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters