Coder Social home page Coder Social logo

Comments (8)

 avatar commented on August 15, 2024

Похоже, что-то не то с версиями софта. Разрабатывалось под OpenSUSE 11.2, bash 4.0.33, curl 7.19.6, getopt 1.1.4

Если знаете как пофиксить, пишите.

from ocrsdk.com.

whalebot-helmsman avatar whalebot-helmsman commented on August 15, 2024

Перед вызовом скрипта необходимо сделать пару экспортов:
export ABBYY_APPID=<ваш app_id>
export ABBYY_PWD=<ваш пароль>

Если использовать значения в скрипте ApplicationId и Password, то в текущем варианте он перетрет их пустыми значениями (как это поправить см whalebot-helmsman@49aaf34)

from ocrsdk.com.

KirillTemnov avatar KirillTemnov commented on August 15, 2024

Проблема в обработке опций, по крайней мере на моей машине,
скрипт не обрабатывает даже два имени файла.

Если узнаю как пофиксить сделаю 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.

whalebot-helmsman avatar whalebot-helmsman commented on August 15, 2024

В чем проблема сходу сказать не могу, но рекомендую запускать скрипт, с опцией -x. Он будет выводить на экран все, что пытается исполнить
То есть так
bash -x ./curl_recognize.sh ~/Downloads/i031011-1.jpg out.txt -f txt -l Russian

from ocrsdk.com.

KirillTemnov avatar KirillTemnov commented on August 15, 2024
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.

 avatar commented on August 15, 2024

Конечно же, под маком другой getopt, кто бы сомневался...

Попробуйте переписать строчку 41 вот так:
params=getopt f:l: "$@"

from ocrsdk.com.

 avatar commented on August 15, 2024

Не подружился с markdown'ом

params=`getopt f:l: "$@"`

from ocrsdk.com.

KirillTemnov avatar KirillTemnov commented on August 15, 2024

в pull request

from ocrsdk.com.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.