Comments (8)
Похоже, что-то не то с версиями софта. Разрабатывалось под OpenSUSE 11.2, bash 4.0.33, curl 7.19.6, getopt 1.1.4
Если знаете как пофиксить, пишите.
from ocrsdk.com.
Перед вызовом скрипта необходимо сделать пару экспортов:
export ABBYY_APPID=<ваш app_id>
export ABBYY_PWD=<ваш пароль>
Если использовать значения в скрипте ApplicationId и Password, то в текущем варианте он перетрет их пустыми значениями (как это поправить см whalebot-helmsman@49aaf34)
from ocrsdk.com.
Проблема в обработке опций, по крайней мере на моей машине,
скрипт не обрабатывает даже два имени файла.
Если узнаю как пофиксить сделаю pull request, пока новые ошибки
./curl_recognize.sh ~/Downloads/i031011-1.jpg out.txt -f txt -l Russian
ABBYY Cloud OCR SDK demo recognition script
Invalid argument: out.txt
Usage:
./curl_recognize.sh <input> <output> [-f output_format] [-l language]
output_format: txt|rtf|docx|xlsx|pptx|pdfSearchable|pdfTextAndImages|xml
Some language examples: Russian Russian,English English,ChinesePRC etc. For full list see ocrsdk documentation
./curl_recognize.sh ~/Downloads/i031011-1.jpg out.txt
ABBYY Cloud OCR SDK demo recognition script
Invalid argument: out.txt
Usage:
./curl_recognize.sh <input> <output> [-f output_format] [-l language]
output_format: txt|rtf|docx|xlsx|pptx|pdfSearchable|pdfTextAndImages|xml
Some language examples: Russian Russian,English English,ChinesePRC etc. For full list see ocrsdk documentation
и данные по системе
uname -a
Darwin selead.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386
bash --version
GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)
Copyright (C) 2007 Free Software Foundation, Inc.
Экспорты естественно сделаны.
from ocrsdk.com.
В чем проблема сходу сказать не могу, но рекомендую запускать скрипт, с опцией -x. Он будет выводить на экран все, что пытается исполнить
То есть так
bash -x ./curl_recognize.sh ~/Downloads/i031011-1.jpg out.txt -f txt -l Russian
from ocrsdk.com.
bash -x ./curl_recognize.sh ~/Downloads/i031011-1.jpg out.txt -f txt -l Russian
+ ServerUrl=http://cloud.ocrsdk.com
+ ApplicationId=_my_application_
+ Password=_mypassword_
+ echo 'ABBYY Cloud OCR SDK demo recognition script'
ABBYY Cloud OCR SDK demo recognition script
+ echo
+ '[' -n MYKEY ']'
+ ApplicationId=MYKEY
+ '[' -n MYSECRET ']'
+ Password=MYSECRET
+ echo
++ getopt -o f:l: -- ~/Downloads/i031011-1.jpg out.txt -f txt -l Russian
+ params=' -- f:l: -- ~/Downloads/i031011-1.jpg out.txt -f txt -l Russian'
+ '[' 0 '!=' 0 ']'
+ OutFormat=txt
+ Language=english
+ eval set -- ' -- f:l: -- ~/Downloads/i031011-1.jpg out.txt -f txt -l Russian'
++ set -- -- f:l: -- ~/Downloads/i031011-1.jpg out.txt -f txt -l Russian
+ true
+ case "$1" in
+ shift
+ true
+ case "$1" in
+ '[' -z f:l: ']'
+ '[' -z ']'
+ SourceFile=f:l:
+ shift
+ true
+ case "$1" in
+ shift
+ true
+ case "$1" in
+ '[' -z ~/Downloads/i031011-1.jpg ']'
+ '[' -z f:l: ']'
+ '[' -z ']'
+ TargetFile=~/Downloads/i031011-1.jpg
+ shift
+ true
+ case "$1" in
+ '[' -z out.txt ']'
+ '[' -z f:l: ']'
+ '[' -z ~/Downloads/i031011-1.jpg ']'
+ echo 'Invalid argument: out.txt'
Invalid argument: out.txt
+ printUsage
+ echo Usage:
Usage:
+ echo './curl_recognize.sh <input> <output> [-f output_format] [-l language]'
./curl_recognize.sh <input> <output> [-f output_format] [-l language]
+ echo 'output_format: txt|rtf|docx|xlsx|pptx|pdfSearchable|pdfTextAndImages|xml'
output_format: txt|rtf|docx|xlsx|pptx|pdfSearchable|pdfTextAndImages|xml
+ echo 'Some language examples: Russian Russian,English English,ChinesePRC etc. For full list see ocrsdk documentation'
Some language examples: Russian Russian,English English,ChinesePRC etc. For full list see ocrsdk documentation
+ exit 1
from ocrsdk.com.
Конечно же, под маком другой getopt, кто бы сомневался...
Попробуйте переписать строчку 41 вот так:
params=getopt f:l: "$@"
from ocrsdk.com.
Не подружился с markdown'ом
params=`getopt f:l: "$@"`
from ocrsdk.com.
в pull request
from ocrsdk.com.
Related Issues (20)
- NullPointer Exception in Java
- `/listFinishedTasks` unclear how to use or what the benefit is
- Conflicting info about URL for data processing location
- [iOS] The download operation should be a standard HTTPOperation, not a ProcessingOperation.
- [iOS] Target main thread instead of current thread (in case a dispatch queue is used).
- Business card image process Cloud OCR SDK below get error HOT 10
- How to use this to parse driving license and credit card
- How to find firstname and lastname from german Id passport?
- requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: http://cloud.ocrsdk.com/processImage?exportFormat=xml%2CpdfTextAndImages&language=English HOT 2
- JavaScript sample error : ECONNREFUSED 127.0.0.1:443 HOT 2
- Not able to use json method of process image in android HOT 2
- Test issue HOT 3
- offline image processing. HOT 2
- XML:writeFormatting is not working HOT 4
- Getting Error "Error uploading file" on cURL HOT 2
- Response format is perfect to extract
- PDF U/A compatible
- How to process a txtUnstructured image/document with paragraphAsOneLine?
- node.js example is not working: Error: Non-whitespace before first tag.
- Abbyy OCR
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ocrsdk.com.