mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-24 02:59:07 +08:00
Remove blanks at line endings
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
394c56ab15
commit
ea446b1eae
10
.github/workflows/autotools.yml
vendored
10
.github/workflows/autotools.yml
vendored
@ -172,12 +172,12 @@ jobs:
|
|||||||
if: startsWith(matrix.config.cxx, 'clang')
|
if: startsWith(matrix.config.cxx, 'clang')
|
||||||
run: |
|
run: |
|
||||||
make check
|
make check
|
||||||
|
|
||||||
- name: Make and run Unit Tests (unset LANG needed for g++-8, g++-9, g++-10 on macOS)
|
- name: Make and run Unit Tests (unset LANG needed for g++-8, g++-9, g++-10 on macOS)
|
||||||
if: startsWith(matrix.config.cxx, 'g')
|
if: startsWith(matrix.config.cxx, 'g')
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
unset LANG LC_ALL LC_CTYPE
|
unset LANG LC_ALL LC_CTYPE
|
||||||
locale
|
locale
|
||||||
make check
|
make check
|
||||||
|
|
||||||
@ -220,7 +220,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cat test-suite.log
|
cat test-suite.log
|
||||||
if: always()
|
if: always()
|
||||||
|
|
||||||
# ============================================================================================
|
# ============================================================================================
|
||||||
|
|
||||||
ports:
|
ports:
|
||||||
@ -299,7 +299,7 @@ jobs:
|
|||||||
tesseract test/testing/hebrew.png - -l heb --oem 1 --tessdata-dir ../tessdata
|
tesseract test/testing/hebrew.png - -l heb --oem 1 --tessdata-dir ../tessdata
|
||||||
tesseract test/testing/eurotext.tif - -l fra --oem 1 --tessdata-dir ../tessdata_best
|
tesseract test/testing/eurotext.tif - -l fra --oem 1 --tessdata-dir ../tessdata_best
|
||||||
tesseract test/testing/arabic.tif - -l ara --oem 1 --psm 6 --tessdata-dir ../tessdata
|
tesseract test/testing/arabic.tif - -l ara --oem 1 --psm 6 --tessdata-dir ../tessdata
|
||||||
|
|
||||||
- name: Run Tesseract basicapitest
|
- name: Run Tesseract basicapitest
|
||||||
run: |
|
run: |
|
||||||
export "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig"
|
export "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig"
|
||||||
@ -317,4 +317,4 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cat test-suite.log
|
cat test-suite.log
|
||||||
if: always()
|
if: always()
|
||||||
|
|
||||||
|
42
.github/workflows/cmake.yml
vendored
42
.github/workflows/cmake.yml
vendored
@ -14,40 +14,40 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
config:
|
config:
|
||||||
|
|
||||||
- { name: macos-10.15-clang-12-cmake, os: macos-10.15, cxx: clang++ } # defualt
|
- { name: macos-10.15-clang-12-cmake, os: macos-10.15, cxx: clang++ } # defualt
|
||||||
- { name: macos-10.15-clang-11-cmake, os: macos-10.15, cxx: '$(brew --prefix llvm)/bin/clang++' } #installed
|
- { name: macos-10.15-clang-11-cmake, os: macos-10.15, cxx: '$(brew --prefix llvm)/bin/clang++' } #installed
|
||||||
- { name: macos-10.15-gcc-8-cmake, os: macos-10.15, cxx: g++-8 } #installed
|
- { name: macos-10.15-gcc-8-cmake, os: macos-10.15, cxx: g++-8 } #installed
|
||||||
- { name: macos-10.15-gcc-9-cmake, os: macos-10.15, cxx: g++-9 } #installed
|
- { name: macos-10.15-gcc-9-cmake, os: macos-10.15, cxx: g++-9 } #installed
|
||||||
- { name: macos-10.15-gcc-10-cmake, os: macos-10.15, cxx: g++-10 } #installed
|
- { name: macos-10.15-gcc-10-cmake, os: macos-10.15, cxx: g++-10 } #installed
|
||||||
|
|
||||||
- { name: ubuntu-18.04-clang-7-cmake, os: ubuntu-18.04, cxx: clang++-7 }
|
- { name: ubuntu-18.04-clang-7-cmake, os: ubuntu-18.04, cxx: clang++-7 }
|
||||||
- { name: ubuntu-18.04-clang-8-cmake, os: ubuntu-18.04, cxx: clang++-8 } #installed
|
- { name: ubuntu-18.04-clang-8-cmake, os: ubuntu-18.04, cxx: clang++-8 } #installed
|
||||||
- { name: ubuntu-18.04-clang-9-cmake, os: ubuntu-18.04, cxx: clang++-9 } #installed
|
- { name: ubuntu-18.04-clang-9-cmake, os: ubuntu-18.04, cxx: clang++-9 } #installed
|
||||||
- { name: ubuntu-18.04-clang-10-cmake, os: ubuntu-18.04, cxx: clang++-10 }
|
- { name: ubuntu-18.04-clang-10-cmake, os: ubuntu-18.04, cxx: clang++-10 }
|
||||||
|
|
||||||
- { name: ubuntu-18.04-gcc-7-cmake, os: ubuntu-18.04, cxx: g++-7 } #installed
|
- { name: ubuntu-18.04-gcc-7-cmake, os: ubuntu-18.04, cxx: g++-7 } #installed
|
||||||
- { name: ubuntu-18.04-gcc-8-cmake, os: ubuntu-18.04, cxx: g++-8 } #installed
|
- { name: ubuntu-18.04-gcc-8-cmake, os: ubuntu-18.04, cxx: g++-8 } #installed
|
||||||
- { name: ubuntu-18.04-gcc-9-cmake, os: ubuntu-18.04, cxx: g++-9 } #installed
|
- { name: ubuntu-18.04-gcc-9-cmake, os: ubuntu-18.04, cxx: g++-9 } #installed
|
||||||
- { name: ubuntu-18.04-gcc-10-cmake, os: ubuntu-18.04, cxx: g++-10 } #installed
|
- { name: ubuntu-18.04-gcc-10-cmake, os: ubuntu-18.04, cxx: g++-10 } #installed
|
||||||
|
|
||||||
- { name: ubuntu-20.04-clang-7-cmake, os: ubuntu-20.04, cxx: clang++-7 }
|
- { name: ubuntu-20.04-clang-7-cmake, os: ubuntu-20.04, cxx: clang++-7 }
|
||||||
- { name: ubuntu-20.04-clang-8-cmake, os: ubuntu-20.04, cxx: clang++-8 } #installed
|
- { name: ubuntu-20.04-clang-8-cmake, os: ubuntu-20.04, cxx: clang++-8 } #installed
|
||||||
- { name: ubuntu-20.04-clang-9-cmake, os: ubuntu-20.04, cxx: clang++-9 } #installed
|
- { name: ubuntu-20.04-clang-9-cmake, os: ubuntu-20.04, cxx: clang++-9 } #installed
|
||||||
- { name: ubuntu-20.04-clang-10-cmake, os: ubuntu-20.04, cxx: clang++-10 } #installed
|
- { name: ubuntu-20.04-clang-10-cmake, os: ubuntu-20.04, cxx: clang++-10 } #installed
|
||||||
|
|
||||||
- { name: ubuntu-20.04-gcc-7-cmake, os: ubuntu-20.04, cxx: g++-7 } #installed
|
- { name: ubuntu-20.04-gcc-7-cmake, os: ubuntu-20.04, cxx: g++-7 } #installed
|
||||||
- { name: ubuntu-20.04-gcc-8-cmake, os: ubuntu-20.04, cxx: g++-8 } #installed
|
- { name: ubuntu-20.04-gcc-8-cmake, os: ubuntu-20.04, cxx: g++-8 } #installed
|
||||||
- { name: ubuntu-20.04-gcc-9-cmake, os: ubuntu-20.04, cxx: g++-9 } #installed
|
- { name: ubuntu-20.04-gcc-9-cmake, os: ubuntu-20.04, cxx: g++-9 } #installed
|
||||||
- { name: ubuntu-20.04-gcc-10-cmake, os: ubuntu-20.04, cxx: g++-10 } #installed
|
- { name: ubuntu-20.04-gcc-10-cmake, os: ubuntu-20.04, cxx: g++-10 } #installed
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install compilers on Linux
|
- name: Install compilers on Linux
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install ${{ matrix.config.cxx }} -y
|
sudo apt-get install ${{ matrix.config.cxx }} -y
|
||||||
if: runner.os == 'Linux'
|
if: runner.os == 'Linux'
|
||||||
|
|
||||||
# sudo apt-get install libarchive-dev libcurl4-openssl-dev libcurl4 curl -y
|
# sudo apt-get install libarchive-dev libcurl4-openssl-dev libcurl4 curl -y
|
||||||
- name: Install dependencies on Linux
|
- name: Install dependencies on Linux
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install autoconf-archive libleptonica-dev -y
|
sudo apt-get install autoconf-archive libleptonica-dev -y
|
||||||
@ -66,12 +66,12 @@ jobs:
|
|||||||
ninja --version
|
ninja --version
|
||||||
cmake --version
|
cmake --version
|
||||||
if: runner.os == 'macOS'
|
if: runner.os == 'macOS'
|
||||||
|
|
||||||
- name: Checkout Source
|
- name: Checkout Source
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Configure Tesseract (Linux)
|
- name: Configure Tesseract (Linux)
|
||||||
run: |
|
run: |
|
||||||
mkdir build
|
mkdir build
|
||||||
@ -102,32 +102,32 @@ jobs:
|
|||||||
-DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
|
-DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
|
||||||
-DCMAKE_INSTALL_PREFIX:PATH=inst
|
-DCMAKE_INSTALL_PREFIX:PATH=inst
|
||||||
if: runner.os == 'macOS'
|
if: runner.os == 'macOS'
|
||||||
|
|
||||||
- name: Build Tesseract
|
- name: Build Tesseract
|
||||||
run: |
|
run: |
|
||||||
cmake --build build --config Release --target install
|
cmake --build build --config Release --target install
|
||||||
|
|
||||||
- name: Display Tesseract Version
|
- name: Display Tesseract Version
|
||||||
run: |
|
run: |
|
||||||
build/inst/bin/tesseract -v
|
build/inst/bin/tesseract -v
|
||||||
|
|
||||||
- name: Display Training Tools Version
|
- name: Display Training Tools Version
|
||||||
run: |
|
run: |
|
||||||
build/inst/bin/lstmtraining -v
|
build/inst/bin/lstmtraining -v
|
||||||
build/inst/bin/text2image -v
|
build/inst/bin/text2image -v
|
||||||
|
|
||||||
- name: Download fonts, tessdata and langdata required for tests
|
- name: Download fonts, tessdata and langdata required for tests
|
||||||
run: |
|
run: |
|
||||||
git clone https://github.com/egorpugin/tessdata tessdata_unittest
|
git clone https://github.com/egorpugin/tessdata tessdata_unittest
|
||||||
cp tessdata_unittest/fonts/* test/testing/
|
cp tessdata_unittest/fonts/* test/testing/
|
||||||
mv tessdata_unittest/* ../
|
mv tessdata_unittest/* ../
|
||||||
|
|
||||||
- name: List languages in different tessdata-dir
|
- name: List languages in different tessdata-dir
|
||||||
run: |
|
run: |
|
||||||
build/inst/bin/tesseract --list-langs --tessdata-dir ../tessdata
|
build/inst/bin/tesseract --list-langs --tessdata-dir ../tessdata
|
||||||
build/inst/bin/tesseract --list-langs --tessdata-dir ../tessdata_best
|
build/inst/bin/tesseract --list-langs --tessdata-dir ../tessdata_best
|
||||||
build/inst/bin/tesseract --list-langs --tessdata-dir ../tessdata_fast
|
build/inst/bin/tesseract --list-langs --tessdata-dir ../tessdata_fast
|
||||||
|
|
||||||
- name: Run Tesseract on test images in different languages
|
- name: Run Tesseract on test images in different languages
|
||||||
run: |
|
run: |
|
||||||
build/inst/bin/tesseract test/testing/phototest.tif - --oem 1 --tessdata-dir ../tessdata
|
build/inst/bin/tesseract test/testing/phototest.tif - --oem 1 --tessdata-dir ../tessdata
|
||||||
@ -136,17 +136,17 @@ jobs:
|
|||||||
build/inst/bin/tesseract test/testing/hebrew.png - -l heb --oem 1 --tessdata-dir ../tessdata
|
build/inst/bin/tesseract test/testing/hebrew.png - -l heb --oem 1 --tessdata-dir ../tessdata
|
||||||
build/inst/bin/tesseract test/testing/eurotext.tif - -l fra --oem 1 --tessdata-dir ../tessdata_best
|
build/inst/bin/tesseract test/testing/eurotext.tif - -l fra --oem 1 --tessdata-dir ../tessdata_best
|
||||||
build/inst/bin/tesseract test/testing/arabic.tif - -l ara --oem 1 --psm 6 --tessdata-dir ../tessdata
|
build/inst/bin/tesseract test/testing/arabic.tif - -l ara --oem 1 --psm 6 --tessdata-dir ../tessdata
|
||||||
|
|
||||||
- name: Build and run basicapitest
|
- name: Build and run basicapitest
|
||||||
run: |
|
run: |
|
||||||
export "PKG_CONFIG_PATH=$GITHUB_WORKSPACE/build/inst/lib/pkgconfig/:$PKG_CONFIG_PATH"
|
export "PKG_CONFIG_PATH=$GITHUB_WORKSPACE/build/inst/lib/pkgconfig/:$PKG_CONFIG_PATH"
|
||||||
cd test
|
cd test
|
||||||
${{ matrix.config.cxx }} -o basicapitest testing/basicapitest.cpp "-I$GITHUB_WORKSPACE/build/inst/include" "-L$GITHUB_WORKSPACE/build/inst/lib" `pkg-config --cflags --libs tesseract lept ` -pthread -std=c++11
|
${{ matrix.config.cxx }} -o basicapitest testing/basicapitest.cpp "-I$GITHUB_WORKSPACE/build/inst/include" "-L$GITHUB_WORKSPACE/build/inst/lib" `pkg-config --cflags --libs tesseract lept ` -pthread -std=c++11
|
||||||
./basicapitest
|
./basicapitest
|
||||||
|
|
||||||
- name: Display Compiler Version
|
- name: Display Compiler Version
|
||||||
run: |
|
run: |
|
||||||
${{ matrix.config.cxx }} --version
|
${{ matrix.config.cxx }} --version
|
||||||
git log -3 --pretty=format:'%h %ad %s | %an'
|
git log -3 --pretty=format:'%h %ad %s | %an'
|
||||||
if: always()
|
if: always()
|
||||||
|
|
||||||
|
10
.github/workflows/sw.yml
vendored
10
.github/workflows/sw.yml
vendored
@ -15,7 +15,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os: [windows-latest, ubuntu-20.04, macOS-latest]
|
os: [windows-latest, ubuntu-20.04, macOS-latest]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
@ -31,21 +31,21 @@ jobs:
|
|||||||
|
|
||||||
- name: download test data
|
- name: download test data
|
||||||
run: git clone https://github.com/egorpugin/tessdata tessdata_unittest
|
run: git clone https://github.com/egorpugin/tessdata tessdata_unittest
|
||||||
|
|
||||||
- name: copy fonts
|
- name: copy fonts
|
||||||
if: matrix.os != 'windows-latest'
|
if: matrix.os != 'windows-latest'
|
||||||
run: cp tessdata_unittest/fonts/* test/testing/
|
run: cp tessdata_unittest/fonts/* test/testing/
|
||||||
|
|
||||||
- name: copy fonts
|
- name: copy fonts
|
||||||
if: matrix.os == 'windows-latest'
|
if: matrix.os == 'windows-latest'
|
||||||
run: Copy-Item -Path "tessdata_unittest\fonts\*" -Destination "test\testing" -Recurse
|
run: Copy-Item -Path "tessdata_unittest\fonts\*" -Destination "test\testing" -Recurse
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
|
|
||||||
- name: test
|
- name: test
|
||||||
if: matrix.os != 'windows-latest'
|
if: matrix.os != 'windows-latest'
|
||||||
run: ./sw -static -shared -config "d,r" test -Dwith-tests=1 "-Dskip-tests=lstm,lstm_recode"
|
run: ./sw -static -shared -config "d,r" test -Dwith-tests=1 "-Dskip-tests=lstm,lstm_recode"
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: test-nightly
|
- name: test-nightly
|
||||||
if: matrix.os != 'windows-latest' && github.event.schedule=='0 0 * * *'
|
if: matrix.os != 'windows-latest' && github.event.schedule=='0 0 * * *'
|
||||||
run: ./sw -static -shared -config "d,r" test -Dwith-tests=1
|
run: ./sw -static -shared -config "d,r" test -Dwith-tests=1
|
||||||
|
16
.github/workflows/unittest-disablelegacy.yml
vendored
16
.github/workflows/unittest-disablelegacy.yml
vendored
@ -20,7 +20,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install autoconf-archive libleptonica-dev libpango1.0-dev -y
|
sudo apt-get install autoconf-archive libleptonica-dev libpango1.0-dev -y
|
||||||
@ -34,7 +34,7 @@ jobs:
|
|||||||
- name: Configure
|
- name: Configure
|
||||||
run: |
|
run: |
|
||||||
./configure '--disable-shared' '--disable-legacy' 'CXX=${{ matrix.compiler }}'
|
./configure '--disable-shared' '--disable-legacy' 'CXX=${{ matrix.compiler }}'
|
||||||
|
|
||||||
- name: Make and Install Tesseract
|
- name: Make and Install Tesseract
|
||||||
run: |
|
run: |
|
||||||
make -j 8
|
make -j 8
|
||||||
@ -44,7 +44,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
make training -j 8
|
make training -j 8
|
||||||
sudo make install training-install
|
sudo make install training-install
|
||||||
|
|
||||||
- name: Display Version
|
- name: Display Version
|
||||||
run: |
|
run: |
|
||||||
${{ matrix.compiler }} --version
|
${{ matrix.compiler }} --version
|
||||||
@ -52,13 +52,13 @@ jobs:
|
|||||||
lstmtraining -v
|
lstmtraining -v
|
||||||
text2image -v
|
text2image -v
|
||||||
if: success() || failure()
|
if: success() || failure()
|
||||||
|
|
||||||
- name: Download fonts, tessdata and langdata required for tests
|
- name: Download fonts, tessdata and langdata required for tests
|
||||||
run: |
|
run: |
|
||||||
git clone https://github.com/egorpugin/tessdata tessdata_unittest
|
git clone https://github.com/egorpugin/tessdata tessdata_unittest
|
||||||
cp tessdata_unittest/fonts/* test/testing/
|
cp tessdata_unittest/fonts/* test/testing/
|
||||||
mv tessdata_unittest/* ../
|
mv tessdata_unittest/* ../
|
||||||
|
|
||||||
- name: Run Tesseract on phototest.tif and devatest.png
|
- name: Run Tesseract on phototest.tif and devatest.png
|
||||||
run: |
|
run: |
|
||||||
tesseract test/testing/phototest.tif - --tessdata-dir ../tessdata
|
tesseract test/testing/phototest.tif - --tessdata-dir ../tessdata
|
||||||
@ -67,10 +67,10 @@ jobs:
|
|||||||
- name: Make and run Unit Tests
|
- name: Make and run Unit Tests
|
||||||
run: |
|
run: |
|
||||||
make check -j 4
|
make check -j 4
|
||||||
|
|
||||||
- name: Display Unit Tests Report
|
- name: Display Unit Tests Report
|
||||||
run: |
|
run: |
|
||||||
git log -3
|
git log -3
|
||||||
${{ matrix.compiler }} --version
|
${{ matrix.compiler }} --version
|
||||||
cat test-suite.log
|
cat test-suite.log
|
||||||
if: always()
|
if: always()
|
||||||
|
14
.github/workflows/unittest.yml
vendored
14
.github/workflows/unittest.yml
vendored
@ -38,7 +38,7 @@ jobs:
|
|||||||
brew install leptonica cairo pango
|
brew install leptonica cairo pango
|
||||||
brew install cabextract abseil
|
brew install cabextract abseil
|
||||||
if: runner.os == 'macOS'
|
if: runner.os == 'macOS'
|
||||||
|
|
||||||
- name: Setup
|
- name: Setup
|
||||||
run: |
|
run: |
|
||||||
mkdir -p m4
|
mkdir -p m4
|
||||||
@ -68,7 +68,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
make training -j 8
|
make training -j 8
|
||||||
sudo make training-install
|
sudo make training-install
|
||||||
|
|
||||||
- name: Display Version
|
- name: Display Version
|
||||||
run: |
|
run: |
|
||||||
${{ matrix.config.cxx }} --version
|
${{ matrix.config.cxx }} --version
|
||||||
@ -76,13 +76,13 @@ jobs:
|
|||||||
lstmtraining -v
|
lstmtraining -v
|
||||||
text2image -v
|
text2image -v
|
||||||
if: success() || failure()
|
if: success() || failure()
|
||||||
|
|
||||||
- name: Download fonts, tessdata and langdata required for tests
|
- name: Download fonts, tessdata and langdata required for tests
|
||||||
run: |
|
run: |
|
||||||
git clone https://github.com/egorpugin/tessdata tessdata_unittest
|
git clone https://github.com/egorpugin/tessdata tessdata_unittest
|
||||||
cp tessdata_unittest/fonts/* test/testing/
|
cp tessdata_unittest/fonts/* test/testing/
|
||||||
mv tessdata_unittest/* ../
|
mv tessdata_unittest/* ../
|
||||||
|
|
||||||
- name: Run Tesseract on phototest.tif and devatest.png
|
- name: Run Tesseract on phototest.tif and devatest.png
|
||||||
run: |
|
run: |
|
||||||
tesseract test/testing/phototest.tif - --tessdata-dir ../tessdata
|
tesseract test/testing/phototest.tif - --tessdata-dir ../tessdata
|
||||||
@ -91,10 +91,10 @@ jobs:
|
|||||||
- name: Make and run Unit Tests
|
- name: Make and run Unit Tests
|
||||||
run: |
|
run: |
|
||||||
make check -j 4
|
make check -j 4
|
||||||
|
|
||||||
- name: Display Unit Tests Report
|
- name: Display Unit Tests Report
|
||||||
run: |
|
run: |
|
||||||
cat test-suite.log
|
cat test-suite.log
|
||||||
${{ matrix.config.cxx }} --version
|
${{ matrix.config.cxx }} --version
|
||||||
git log -3 --pretty=format:'%h %ad %s | %an'
|
git log -3 --pretty=format:'%h %ad %s | %an'
|
||||||
if: always()
|
if: always()
|
||||||
|
26
.github/workflows/vcpkg.yml
vendored
26
.github/workflows/vcpkg.yml
vendored
@ -4,26 +4,26 @@ on:
|
|||||||
#push:
|
#push:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: 0 23 * * *
|
- cron: 0 23 * * *
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [windows-2019]
|
os: [windows-2019]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Tesseract Source (--head from master branch)
|
- name: Checkout Tesseract Source (--head from master branch)
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Visual Studio Setup
|
- name: Visual Studio Setup
|
||||||
shell: cmd
|
shell: cmd
|
||||||
run: |
|
run: |
|
||||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
||||||
|
|
||||||
- name: Install vcpkg
|
- name: Install vcpkg
|
||||||
run: |
|
run: |
|
||||||
git clone https://github.com/microsoft/vcpkg
|
git clone https://github.com/microsoft/vcpkg
|
||||||
@ -33,13 +33,13 @@ jobs:
|
|||||||
- name: Build and Install Leptonica and image libraries using vcpkg
|
- name: Build and Install Leptonica and image libraries using vcpkg
|
||||||
run: |
|
run: |
|
||||||
vcpkg/vcpkg install leptonica:x64-windows
|
vcpkg/vcpkg install leptonica:x64-windows
|
||||||
|
|
||||||
- name: Configure and Build Tesseract (--head from master branch) with cmake
|
- name: Configure and Build Tesseract (--head from master branch) with cmake
|
||||||
run: |
|
run: |
|
||||||
cmake . -B build -DCMAKE_BUILD_TYPE=Release -DSW_BUILD=OFF -DOPENMP_BUILD=OFF -DBUILD_TRAINING_TOOLS=OFF "-DCMAKE_TOOLCHAIN_FILE=${env:GITHUB_WORKSPACE}/vcpkg/scripts/buildsystems/vcpkg.cmake"
|
cmake . -B build -DCMAKE_BUILD_TYPE=Release -DSW_BUILD=OFF -DOPENMP_BUILD=OFF -DBUILD_TRAINING_TOOLS=OFF "-DCMAKE_TOOLCHAIN_FILE=${env:GITHUB_WORKSPACE}/vcpkg/scripts/buildsystems/vcpkg.cmake"
|
||||||
cmake --build build --config Release --target install
|
cmake --build build --config Release --target install
|
||||||
|
|
||||||
- name: Display Tesseract Version
|
- name: Display Tesseract Version
|
||||||
run: |
|
run: |
|
||||||
D:\a\tesseract\tesseract\build\bin\Release\tesseract.exe --version
|
D:\a\tesseract\tesseract\build\bin\Release\tesseract.exe --version
|
||||||
|
|
||||||
@ -62,17 +62,17 @@ jobs:
|
|||||||
target_link_libraries(basicapitest libtesseract)
|
target_link_libraries(basicapitest libtesseract)
|
||||||
EOF
|
EOF
|
||||||
cat CMakeLists.txt
|
cat CMakeLists.txt
|
||||||
|
|
||||||
- name: Configure basicapitest
|
- name: Configure basicapitest
|
||||||
run: |
|
run: |
|
||||||
cd test
|
cd test
|
||||||
cmake . "-DCMAKE_TOOLCHAIN_FILE=${env:GITHUB_WORKSPACE}/vcpkg/scripts/buildsystems/vcpkg.cmake"
|
cmake . "-DCMAKE_TOOLCHAIN_FILE=${env:GITHUB_WORKSPACE}/vcpkg/scripts/buildsystems/vcpkg.cmake"
|
||||||
|
|
||||||
- name: Build basicapitest
|
- name: Build basicapitest
|
||||||
run: |
|
run: |
|
||||||
cd test
|
cd test
|
||||||
cmake --build . --config Release
|
cmake --build . --config Release
|
||||||
|
|
||||||
- name: Download tessdata and image files used for tests
|
- name: Download tessdata and image files used for tests
|
||||||
run: |
|
run: |
|
||||||
git clone https://github.com/egorpugin/tessdata tessdata_unittest
|
git clone https://github.com/egorpugin/tessdata tessdata_unittest
|
||||||
@ -91,7 +91,7 @@ jobs:
|
|||||||
D:\a\tesseract\tesseract\build\bin\Release\tesseract.exe test\testing\hebrew.png - -l heb --oem 1 --tessdata-dir ..\tessdata
|
D:\a\tesseract\tesseract\build\bin\Release\tesseract.exe test\testing\hebrew.png - -l heb --oem 1 --tessdata-dir ..\tessdata
|
||||||
D:\a\tesseract\tesseract\build\bin\Release\tesseract.exe test\testing\eurotext.tif - -l fra --oem 1 --tessdata-dir ..\tessdata_best
|
D:\a\tesseract\tesseract\build\bin\Release\tesseract.exe test\testing\eurotext.tif - -l fra --oem 1 --tessdata-dir ..\tessdata_best
|
||||||
D:\a\tesseract\tesseract\build\bin\Release\tesseract.exe test\testing\arabic.tif - -l ara --oem 1 --psm 6 --tessdata-dir ..\tessdata
|
D:\a\tesseract\tesseract\build\bin\Release\tesseract.exe test\testing\arabic.tif - -l ara --oem 1 --psm 6 --tessdata-dir ..\tessdata
|
||||||
|
|
||||||
- name: List languages in different test tessdata-dir
|
- name: List languages in different test tessdata-dir
|
||||||
run: |
|
run: |
|
||||||
D:\a\tesseract\tesseract\build\bin\Release\tesseract.exe --list-langs --tessdata-dir ..\tessdata
|
D:\a\tesseract\tesseract\build\bin\Release\tesseract.exe --list-langs --tessdata-dir ..\tessdata
|
||||||
|
@ -17,7 +17,7 @@ matrix:
|
|||||||
ccache: true
|
ccache: true
|
||||||
directories:
|
directories:
|
||||||
- $HOME/Library/Caches/Homebrew
|
- $HOME/Library/Caches/Homebrew
|
||||||
before_install:
|
before_install:
|
||||||
- brew install ccache
|
- brew install ccache
|
||||||
install:
|
install:
|
||||||
- brew install ninja libtiff leptonica libarchive pango cairo icu4c
|
- brew install ninja libtiff leptonica libarchive pango cairo icu4c
|
||||||
@ -33,7 +33,7 @@ matrix:
|
|||||||
-G Ninja \
|
-G Ninja \
|
||||||
-DCMAKE_INSTALL_PREFIX:PATH=inst
|
-DCMAKE_INSTALL_PREFIX:PATH=inst
|
||||||
cmake --build build --config Release --target install
|
cmake --build build --config Release --target install
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
dist: bionic
|
dist: bionic
|
||||||
addons:
|
addons:
|
||||||
@ -57,4 +57,3 @@ matrix:
|
|||||||
- cmake .. -DLeptonica_DIR=leptonica-$LEPT_VER/build -DSW_BUILD=OFF
|
- cmake .. -DLeptonica_DIR=leptonica-$LEPT_VER/build -DSW_BUILD=OFF
|
||||||
- make
|
- make
|
||||||
- sudo make install
|
- sudo make install
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
|
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
|
||||||
<Type Name="STRING">
|
<Type Name="STRING">
|
||||||
<DisplayString>{(char*)data_+sizeof(int)*2,s8}</DisplayString>
|
<DisplayString>{(char*)data_+sizeof(int)*2,s8}</DisplayString>
|
||||||
@ -15,7 +15,7 @@
|
|||||||
</ArrayItems>
|
</ArrayItems>
|
||||||
</Expand>
|
</Expand>
|
||||||
</Type>
|
</Type>
|
||||||
|
|
||||||
<Type Name="tesseract::IntParam">
|
<Type Name="tesseract::IntParam">
|
||||||
<DisplayString>{value_}</DisplayString>
|
<DisplayString>{value_}</DisplayString>
|
||||||
</Type>
|
</Type>
|
||||||
@ -30,5 +30,5 @@
|
|||||||
<Type Name="tesseract::DoubleParam">
|
<Type Name="tesseract::DoubleParam">
|
||||||
<DisplayString>{value_}</DisplayString>
|
<DisplayString>{value_}</DisplayString>
|
||||||
</Type>
|
</Type>
|
||||||
|
|
||||||
</AutoVisualizer>
|
</AutoVisualizer>
|
||||||
|
@ -403,7 +403,7 @@ char* TessBaseAPI::GetHOCRText(ETEXT_DESC* monitor, int page_number) {
|
|||||||
tcnt++;
|
tcnt++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Close ocrx_word.
|
// Close ocrx_word.
|
||||||
if (hocr_boxes || lstm_choice_mode > 0) {
|
if (hocr_boxes || lstm_choice_mode > 0) {
|
||||||
hocr_str << "\n ";
|
hocr_str << "\n ";
|
||||||
|
@ -76,13 +76,13 @@ static void Win32WarningHandler(const char* module, const char* fmt,
|
|||||||
class AutoWin32ConsoleOutputCP {
|
class AutoWin32ConsoleOutputCP {
|
||||||
public:
|
public:
|
||||||
explicit AutoWin32ConsoleOutputCP(UINT codeCP) {
|
explicit AutoWin32ConsoleOutputCP(UINT codeCP) {
|
||||||
oldCP_ = GetConsoleOutputCP();
|
oldCP_ = GetConsoleOutputCP();
|
||||||
SetConsoleOutputCP(codeCP);
|
SetConsoleOutputCP(codeCP);
|
||||||
}
|
}
|
||||||
~AutoWin32ConsoleOutputCP() {
|
~AutoWin32ConsoleOutputCP() {
|
||||||
SetConsoleOutputCP(oldCP_);
|
SetConsoleOutputCP(oldCP_);
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
UINT oldCP_;
|
UINT oldCP_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -385,7 +385,7 @@ ChoiceIterator::ChoiceIterator(const LTRResultIterator& result_it) {
|
|||||||
bool lstm_choice_mode = word_res_->tesseract->lstm_choice_mode;
|
bool lstm_choice_mode = word_res_->tesseract->lstm_choice_mode;
|
||||||
rating_coefficient_ = word_res_->tesseract->lstm_rating_coefficient;
|
rating_coefficient_ = word_res_->tesseract->lstm_rating_coefficient;
|
||||||
blanks_before_word_ = result_it.BlanksBeforeWord();
|
blanks_before_word_ = result_it.BlanksBeforeWord();
|
||||||
BLOB_CHOICE_LIST* choices = nullptr;
|
BLOB_CHOICE_LIST* choices = nullptr;
|
||||||
tstep_index_ = &result_it.blob_index_;
|
tstep_index_ = &result_it.blob_index_;
|
||||||
if (oemLSTM_ && !word_res_->CTC_symbol_choices.empty()) {
|
if (oemLSTM_ && !word_res_->CTC_symbol_choices.empty()) {
|
||||||
if (!word_res_->CTC_symbol_choices[0].empty() &&
|
if (!word_res_->CTC_symbol_choices[0].empty() &&
|
||||||
|
10
unittest/third_party/utf/rune.c
vendored
10
unittest/third_party/utf/rune.c
vendored
@ -23,7 +23,7 @@ enum
|
|||||||
Bit2 = 5,
|
Bit2 = 5,
|
||||||
Bit3 = 4,
|
Bit3 = 4,
|
||||||
Bit4 = 3,
|
Bit4 = 3,
|
||||||
Bit5 = 2,
|
Bit5 = 2,
|
||||||
|
|
||||||
T1 = ((1<<(Bit1+1))-1) ^ 0xFF, /* 0000 0000 */
|
T1 = ((1<<(Bit1+1))-1) ^ 0xFF, /* 0000 0000 */
|
||||||
Tx = ((1<<(Bitx+1))-1) ^ 0xFF, /* 1000 0000 */
|
Tx = ((1<<(Bitx+1))-1) ^ 0xFF, /* 1000 0000 */
|
||||||
@ -46,9 +46,9 @@ enum
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Modified by Wei-Hwa Huang, Google Inc., on 2004-09-24
|
* Modified by Wei-Hwa Huang, Google Inc., on 2004-09-24
|
||||||
* This is a slower but "safe" version of the old chartorune
|
* This is a slower but "safe" version of the old chartorune
|
||||||
* that works on strings that are not necessarily null-terminated.
|
* that works on strings that are not necessarily null-terminated.
|
||||||
*
|
*
|
||||||
* If you know for sure that your string is null-terminated,
|
* If you know for sure that your string is null-terminated,
|
||||||
* chartorune will be a bit faster.
|
* chartorune will be a bit faster.
|
||||||
*
|
*
|
||||||
@ -162,7 +162,7 @@ badlen:
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is the older "unsafe" version, which works fine on
|
* This is the older "unsafe" version, which works fine on
|
||||||
* null-terminated strings.
|
* null-terminated strings.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
@ -248,7 +248,7 @@ isvalidcharntorune(const char* str, int length, Rune* rune, int* consumed) {
|
|||||||
*consumed = charntorune(rune, str, length);
|
*consumed = charntorune(rune, str, length);
|
||||||
return *rune != Runeerror || *consumed == 3;
|
return *rune != Runeerror || *consumed == 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
runetochar(char *str, const Rune *rune)
|
runetochar(char *str, const Rune *rune)
|
||||||
{
|
{
|
||||||
|
8
unittest/third_party/utf/utf.h
vendored
8
unittest/third_party/utf/utf.h
vendored
@ -66,7 +66,7 @@ int chartorune(Rune* r, const char* s);
|
|||||||
// n bytes of s. If the UTF sequence is incomplete within n bytes,
|
// n bytes of s. If the UTF sequence is incomplete within n bytes,
|
||||||
// charntorune will set *r to Runeerror and return 0. If it is complete
|
// charntorune will set *r to Runeerror and return 0. If it is complete
|
||||||
// but not in UTF format, it will set *r to Runeerror and return 1.
|
// but not in UTF format, it will set *r to Runeerror and return 1.
|
||||||
//
|
//
|
||||||
// Added 2004-09-24 by Wei-Hwa Huang
|
// Added 2004-09-24 by Wei-Hwa Huang
|
||||||
|
|
||||||
int charntorune(Rune* r, const char* s, int n);
|
int charntorune(Rune* r, const char* s, int n);
|
||||||
@ -150,7 +150,7 @@ char* utfecpy(char *s1, char *es1, const char *s2);
|
|||||||
|
|
||||||
// These functions are rune-string analogues of the corresponding
|
// These functions are rune-string analogues of the corresponding
|
||||||
// functions in strcat (3).
|
// functions in strcat (3).
|
||||||
//
|
//
|
||||||
// These routines first appeared in Plan 9.
|
// These routines first appeared in Plan 9.
|
||||||
// SEE ALSO
|
// SEE ALSO
|
||||||
// memmove (3)
|
// memmove (3)
|
||||||
@ -203,8 +203,8 @@ Rune totitlerune(Rune r);
|
|||||||
|
|
||||||
// isupperrune tests for upper case characters, including Unicode
|
// isupperrune tests for upper case characters, including Unicode
|
||||||
// upper case letters and targets of the toupper mapping. islowerrune
|
// upper case letters and targets of the toupper mapping. islowerrune
|
||||||
// and istitlerune are defined analogously.
|
// and istitlerune are defined analogously.
|
||||||
|
|
||||||
int isupperrune(Rune r);
|
int isupperrune(Rune r);
|
||||||
int islowerrune(Rune r);
|
int islowerrune(Rune r);
|
||||||
int istitlerune(Rune r);
|
int istitlerune(Rune r);
|
||||||
|
Loading…
Reference in New Issue
Block a user