<commit_before>#!/bin/bash

function prerequisite(){
#他スクリプト依存関係
if [ $((NO_DEPENDENCY)) == 0 ]; then
#依存スクリプトなし
exitOnError
fi

#必要ライブラリ
pacman "${PACMAN_INSTALL_OPTS[@]}" \
$MINGW_PACKAGE_PREFIX-leptonica \
$MINGW_PACKAGE_PREFIX-libpng \
$MINGW_PACKAGE_PREFIX-libjpeg \
$MINGW_PACKAGE_PREFIX-libtiff \
$MINGW_PACKAGE_PREFIX-zlib \
$MINGW_PACKAGE_PREFIX-libarchive \
$MINGW_PACKAGE_PREFIX-cairo \
$MINGW_PACKAGE_PREFIX-pango \
$MINGW_PACKAGE_PREFIX-icu \
$MINGW_PACKAGE_PREFIX-asciidoc \
$MINGW_PACKAGE_PREFIX-docbook-xsl \
2>/dev/null

exitOnError
}

function build(){
if [ -e $PREFIX/bin/tesseract.exe -a $((FORCE_INSTALL)) == 0 ]; then
echo "tesseract is already installed."
exit 0
fi


if [ "$TESSERACT_GIT" != "" ]; then
    TESSERACT_SRC_DIR=tesseract-git
    git clone https://github.com/tesseract-ocr/tesseract.git $TESSERACT_SRC_DIR 2> /dev/null
    pushd $TESSERACT_SRC_DIR
    git pull
else
    TESSERACT_VERSION=5.0.1
    TESSERACT_TAG=$TESSERACT_VERSION
    TESSERACT_ARCHIVE=tesseract-$TESSERACT_TAG.tar.gz
    TESSERACT_SRC_DIR=tesseract-$TESSERACT_VERSION
    TESSERACT_BUILD_DIR=$TESSERACT_SRC_DIR-$BIT

    if [ "$TESSERACT_VERSION" == "main" ]; then
    rm $TESSERACT_ARCHIVE 2> /dev/null
    fi

    if [ ! -e $TESSERACT_ARCHIVE ]; then
    wget -c https://github.com/tesseract-ocr/tesseract/archive/$TESSERACT_TAG/$TESSERACT_ARCHIVE
    fi
    rm -rf $TESSERACT_SRC_DIR $TESSERACT_BUILD_DIR 
    tar xf $TESSERACT_ARCHIVE
    mv $TESSERACT_SRC_DIR $TESSERACT_BUILD_DIR
    pushd $TESSERACT_BUILD_DIR
fi

if [ -e Makefile ]; then
make clean
fi<commit_msg>MSYS2Privateを更新<commit_after>#!/bin/bash

function prerequisite(){
#他スクリプト依存関係
if [ $((NO_DEPENDENCY)) == 0 ]; then
#依存スクリプトなし
exitOnError
fi

#必要ライブラリ
pacman "${PACMAN_INSTALL_OPTS[@]}" \
$MINGW_PACKAGE_PREFIX-leptonica \
$MINGW_PACKAGE_PREFIX-libpng \
$MINGW_PACKAGE_PREFIX-libjpeg \
$MINGW_PACKAGE_PREFIX-libtiff \
$MINGW_PACKAGE_PREFIX-zlib \
$MINGW_PACKAGE_PREFIX-libarchive \
$MINGW_PACKAGE_PREFIX-cairo \
$MINGW_PACKAGE_PREFIX-pango \
$MINGW_PACKAGE_PREFIX-icu \
$MINGW_PACKAGE_PREFIX-asciidoc \
$MINGW_PACKAGE_PREFIX-docbook-xsl \
2>/dev/null

exitOnError
}

function build(){
if [ -e $PREFIX/bin/tesseract.exe -a $((FORCE_INSTALL)) == 0 ]; then
echo "tesseract is already installed."
exit 0
fi


if [ "$TESSERACT_GIT" != "" ]; then
    TESSERACT_SRC_DIR=tesseract-git
    git clone https://github.com/tesseract-ocr/tesseract.git $TESSERACT_SRC_DIR 2> /dev/null
    pushd $TESSERACT_SRC_DIR
    git pull
else
    TESSERACT_VERSION=5.1.0
    TESSERACT_TAG=$TESSERACT_VERSION
    TESSERACT_ARCHIVE=tesseract-$TESSERACT_TAG.tar.gz
    TESSERACT_SRC_DIR=tesseract-$TESSERACT_VERSION
    TESSERACT_BUILD_DIR=$TESSERACT_SRC_DIR-$BIT

    if [ "$TESSERACT_VERSION" == "main" ]; then
    rm $TESSERACT_ARCHIVE 2> /dev/null
    fi

    if [ ! -e $TESSERACT_ARCHIVE ]; then
    wget -c https://github.com/tesseract-ocr/tesseract/archive/$TESSERACT_TAG/$TESSERACT_ARCHIVE
    fi
    rm -rf $TESSERACT_SRC_DIR $TESSERACT_BUILD_DIR 
    tar xf $TESSERACT_ARCHIVE
    mv $TESSERACT_SRC_DIR $TESSERACT_BUILD_DIR
    pushd $TESSERACT_BUILD_DIR
fi

if [ -e Makefile ]; then
make clean
fi
{'fraction_non_alphanumeric': 0.1128725428027901, 'fraction_numerical': 0.006024096385542169, 'mean_word_length': 4.564373897707231, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2638296', 'n_tokens_mistral': 1404, 'n_tokens_neox': 1382, 'n_words': 201}