Misc root changes for 3.00

git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@309 d0cd1f9f-072b-0410-8dd7-cf729c803f20
This commit is contained in:
theraysmith 2009-07-11 03:05:57 +00:00
parent 15b67d6a96
commit fea38ee706
32 changed files with 1773 additions and 29590 deletions

View File

@ -1,9 +1,8 @@
# TODO(luc) Add 'doc' to this list when ready
SUBDIRS = ccstruct ccutil classify cutil dict pageseg image textord viewer wordrec ccmain training tessdata testing dlltest java
SUBDIRS = ccstruct ccutil classify cutil dict image textord viewer wordrec ccmain training tessdata testing java api
EXTRA_DIST = eurotext.tif phototest.tif ReleaseNotes tesseract.spec config \
tesseract.dsp tesseract.dsw tesseract.vcproj tesseract.sln \
StdAfx.cpp StdAfx.h tessdll.cpp tessdll.h tessdll.dsp tessdll.vcproj
EXTRA_DIST = eurotext.tif phototest.tif ReleaseNotes \
acinclude.m4 config configure.ac runautoconf tesseract.spec
#EXTRA_DIST = doc/html doc/@PACKAGE_NAME@_@PACKAGE_VERSION@.pdf doc/@PACKAGE_NAME@_@PACKAGE_VERSION@.ps.gz

View File

@ -177,10 +177,9 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
# TODO(luc) Add 'doc' to this list when ready
SUBDIRS = ccstruct ccutil classify cutil dict pageseg image textord viewer wordrec ccmain training tessdata testing dlltest java
EXTRA_DIST = eurotext.tif phototest.tif ReleaseNotes tesseract.spec config \
tesseract.dsp tesseract.dsw tesseract.vcproj tesseract.sln \
StdAfx.cpp StdAfx.h tessdll.cpp tessdll.h tessdll.dsp tessdll.vcproj
SUBDIRS = ccstruct ccutil classify cutil dict image textord viewer wordrec ccmain training tessdata testing java api
EXTRA_DIST = eurotext.tif phototest.tif ReleaseNotes \
acinclude.m4 config configure.ac runautoconf tesseract.spec
all: config_auto.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive

910
aclocal.m4 vendored Normal file
View File

@ -0,0 +1,910 @@
# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(AC_AUTOCONF_VERSION, [2.61],,
[m4_warning([this file was generated for autoconf 2.61.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.10'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.10.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
# _AM_AUTOCONF_VERSION(VERSION)
# -----------------------------
# aclocal traces this macro to find the Autoconf version.
# This is a private macro too. Using m4_define simplifies
# the logic in aclocal, which can simply ignore this definition.
m4_define([_AM_AUTOCONF_VERSION], [])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.10.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
#
# Of course, Automake must honor this variable whenever it calls a
# tool from the auxiliary directory. The problem is that $srcdir (and
# therefore $ac_aux_dir as well) can be either absolute or relative,
# depending on how configure is run. This is pretty annoying, since
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
# source directory, any form will work fine, but in subdirectories a
# relative path needs to be adjusted first.
#
# $ac_aux_dir/missing
# fails when called from a subdirectory if $ac_aux_dir is relative
# $top_srcdir/$ac_aux_dir/missing
# fails if $ac_aux_dir is absolute,
# fails when called from a subdirectory in a VPATH build with
# a relative $ac_aux_dir
#
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
# are both prefixed by $srcdir. In an in-source build this is usually
# harmless because $srcdir is `.', but things will broke when you
# start a VPATH build or use an absolute $srcdir.
#
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
# and then we would define $MISSING as
# MISSING="\${SHELL} $am_aux_dir/missing"
# This will work as long as MISSING is not called from configure, because
# unfortunately $(top_srcdir) has no meaning in configure.
# However there are other variables, like CC, which are often used in
# configure, and could therefore not use this "fixed" $ac_aux_dir.
#
# Another solution, used here, is to always expand $ac_aux_dir to an
# absolute PATH. The drawback is that using absolute paths prevent a
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
[dnl Rely on autoconf to set up CDPATH properly.
AC_PREREQ([2.50])dnl
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 8
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ(2.52)dnl
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])dnl
AC_SUBST([$1_FALSE])dnl
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 9
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
# NAME is "CC", "CXX", "GCJ", or "OBJC".
# We try a few techniques and use that to set a single cache variable.
#
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
# dependency, and given that the user is not expected to run this macro,
# just rely on AC_PROG_CC.
AC_DEFUN([_AM_DEPENDENCIES],
[AC_REQUIRE([AM_SET_DEPDIR])dnl
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
AC_REQUIRE([AM_DEP_TRACK])dnl
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
[$1], CXX, [depcc="$CXX" am_compiler_list=],
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
[$1], UPC, [depcc="$UPC" am_compiler_list=],
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
AC_CACHE_CHECK([dependency style of $depcc],
[am_cv_$1_dependencies_compiler_type],
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named `D' -- because `-MD' means `put the output
# in D'.
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
am_cv_$1_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
# Solaris 8's {/usr,}/bin/sh.
touch sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
case $depmode in
nosideeffect)
# after this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
none) break ;;
esac
# We check with `-c' and `-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle `-M -o', and we need to detect this.
if depmode=$depmode \
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
# that says an option was ignored or not supported.
# When given -MP, icc 7.0 and 7.1 complain thusly:
# icc: Command line warning: ignoring option '-M'; no argument required
# The diagnosis changed in icc 8.0:
# icc: Command line remark: option '-MP' not supported
if (grep 'ignoring option' conftest.err ||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
am_cv_$1_dependencies_compiler_type=$depmode
break
fi
fi
done
cd ..
rm -rf conftest.dir
else
am_cv_$1_dependencies_compiler_type=none
fi
])
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
AM_CONDITIONAL([am__fastdep$1], [
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
])
# AM_SET_DEPDIR
# -------------
# Choose a directory name for dependency files.
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
AC_DEFUN([AM_SET_DEPDIR],
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
])
# AM_DEP_TRACK
# ------------
AC_DEFUN([AM_DEP_TRACK],
[AC_ARG_ENABLE(dependency-tracking,
[ --disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
AC_SUBST([AMDEPBACKSLASH])dnl
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
#serial 3
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[for mf in $CONFIG_FILES; do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named `Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running `make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# When using ansi2knr, U may be empty or an underscore; expand it
U=`sed -n 's/^U = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
AS_MKDIR_P([$dirpart/$fdir])
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
# AM_OUTPUT_DEPENDENCY_COMMANDS
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
# This code is only required when automatic dependency tracking
# is enabled. FIXME. This creates each `.P' file that we will
# need in order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 8
# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 13
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
# The call with PACKAGE and VERSION arguments is the old style
# call (pre autoconf-2.50), which is being phased out. PACKAGE
# and VERSION should now be passed to AC_INIT and removed from
# the call to AM_INIT_AUTOMAKE.
# We support both call styles for the transition. After
# the next Automake release, Autoconf can make the AC_INIT
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.60])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
if test "`cd $srcdir && pwd`" != "`pwd`"; then
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
# is not polluted with repeated "-I."
AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
# test to see if srcdir already configured
if test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
fi
# test whether we have cygpath
if test -z "$CYGPATH_W"; then
if (cygpath --version) >/dev/null 2>/dev/null; then
CYGPATH_W='cygpath -w'
else
CYGPATH_W=echo
fi
fi
AC_SUBST([CYGPATH_W])
# Define the identity of the package.
dnl Distinguish between old-style and new-style calls.
m4_ifval([$2],
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
_AM_IF_OPTION([no-define],,
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
AM_MISSING_PROG(AUTOCONF, autoconf)
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
AM_PROG_INSTALL_SH
AM_PROG_INSTALL_STRIP
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
[_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
[_AM_DEPENDENCIES(CC)],
[define([AC_PROG_CC],
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[_AM_DEPENDENCIES(CXX)],
[define([AC_PROG_CXX],
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
[_AM_DEPENDENCIES(OBJC)],
[define([AC_PROG_OBJC],
defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
])
])
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
# loop where config.status creates the headers, so we can generate
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
_am_arg=$1
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
$_am_arg | $_am_arg:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
AC_SUBST(install_sh)])
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
[rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 4
AC_DEFUN([AM_MAINTAINER_MODE],
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode is disabled by default
AC_ARG_ENABLE(maintainer-mode,
[ --enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer],
USE_MAINTAINER_MODE=$enableval,
USE_MAINTAINER_MODE=no)
AC_MSG_RESULT([$USE_MAINTAINER_MODE])
AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
MAINT=$MAINTAINER_MODE_TRUE
AC_SUBST(MAINT)dnl
]
)
AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 3
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
@echo done
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# We grep out `Entering directory' and `Leaving directory'
# messages which can occur if `w' ends up in MAKEFLAGS.
# In particular we don't look at `^make:' because GNU make might
# be invoked under some other name (usually "gmake"), in which
# case it prints its new name instead of `make'.
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
am__include=include
am__quote=
_am_result=GNU
fi
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
am__include=.include
am__quote="\""
_am_result=BSD
fi
fi
AC_SUBST([am__include])
AC_SUBST([am__quote])
AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 5
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
[AC_REQUIRE([AM_MISSING_HAS_RUN])
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
# AM_MISSING_HAS_RUN
# ------------------
# Define MISSING if not defined so far and test if it supports --run.
# If it does, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
AC_MSG_WARN([`missing' script is too old or missing])
fi
])
# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_MKDIR_P
# ---------------
# Check for `mkdir -p'.
AC_DEFUN([AM_PROG_MKDIR_P],
[AC_PREREQ([2.60])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
dnl while keeping a definition of mkdir_p for backward compatibility.
dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
dnl Makefile.ins that do not define MKDIR_P, so we do our own
dnl adjustment using top_builddir (which is defined more often than
dnl MKDIR_P).
AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
case $mkdir_p in
[[\\/$]]* | ?:[[\\/]]*) ;;
*/*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
esac
])
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 3
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
# _AM_SET_OPTION(NAME)
# ------------------------------
# Set option NAME. Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION],
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
# _AM_SET_OPTIONS(OPTIONS)
# ----------------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
# -------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 4
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftest.file
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
# -L didn't work.
set X `ls -t $srcdir/configure conftest.file`
fi
rm -f conftest.file
if test "$[*]" != "X $srcdir/configure conftest.file" \
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
test "$[2]" = conftest.file
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
AC_MSG_RESULT(yes)])
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_STRIP
# ---------------------
# One issue with vendor `install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
# is unlikely to handle the host's binaries.
# Fortunately install-sh will honor a STRIPPROG variable, so we
# always use install-sh in `make install-strip', and initialize
# STRIPPROG with the value of the STRIP variable (set by the user).
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
# Installed binaries are usually stripped using `strip' when the user
# run `make install-strip'. However `strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the `STRIP' environment variable to overrule this program.
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
# This macro is traced by Automake.
AC_DEFUN([_AM_SUBST_NOTMAKE])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
# FORMAT should be one of `v7', `ustar', or `pax'.
#
# Substitute a variable $(am__tar) that is a command
# writing to stdout a FORMAT-tarball containing the directory
# $tardir.
# tardir=directory && $(am__tar) > result.tar
#
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
# $(am__untar) < result.tar
AC_DEFUN([_AM_PROG_TAR],
[# Always define AMTAR for backward compatibility.
AM_MISSING_PROG([AMTAR], [tar])
m4_if([$1], [v7],
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
[m4_case([$1], [ustar],, [pax],,
[m4_fatal([Unknown tar format])])
AC_MSG_CHECKING([how to create a $1 tar archive])
# Loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
# Do not fold the above two line into one, because Tru64 sh and
# Solaris sh will not grok spaces in the rhs of `-'.
for _am_tool in $_am_tools
do
case $_am_tool in
gnutar)
for _am_tar in tar gnutar gtar;
do
AM_RUN_LOG([$_am_tar --version]) && break
done
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
am__untar="$_am_tar -xf -"
;;
plaintar)
# Must skip GNU tar: if it does not support --format= it doesn't create
# ustar tarball either.
(tar --version) >/dev/null 2>&1 && continue
am__tar='tar chf - "$$tardir"'
am__tar_='tar chf - "$tardir"'
am__untar='tar xf -'
;;
pax)
am__tar='pax -L -x $1 -w "$$tardir"'
am__tar_='pax -L -x $1 -w "$tardir"'
am__untar='pax -r'
;;
cpio)
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
am__untar='cpio -i -H $1 -d'
;;
none)
am__tar=false
am__tar_=false
am__untar=false
;;
esac
# If the value was cached, stop now. We just wanted to have am__tar
# and am__untar set.
test -n "${am_cv_prog_tar_$1}" && break
# tar/untar a dummy directory, and stop if the command works
rm -rf conftest.dir
mkdir conftest.dir
echo GrepMe > conftest.dir/file
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
rm -rf conftest.dir
if test -s conftest.tar; then
AM_RUN_LOG([$am__untar <conftest.tar])
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
fi
done
rm -rf conftest.dir
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
m4_include([acinclude.m4])

View File

@ -7,10 +7,10 @@
# ----------------------------------------
AC_PREREQ(2.50)
AC_INIT(tesseract, 2.04, theraysmith@gmail.com)
AC_INIT(tesseract, 3.00, theraysmith@gmail.com)
AC_REVISION($Id: configure.ac,v 1.4 2007/02/02 22:38:17 theraysmith Exp $)
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_SRCDIR(ccmain/tesseractmain.cpp)
AC_CONFIG_SRCDIR(api/tesseractmain.cpp)
AC_PREFIX_DEFAULT(/usr/local)
AC_CANONICAL_HOST
@ -218,22 +218,6 @@ AC_CHECK_LIB(png,png_read_png)
AC_CHECK_LIB(jpeg,jpeg_read_scanlines)
AC_CHECK_LIB(pthread,sem_init)
# Check location of leptonica/liblept headers.
have_lept=no
for incd in /usr/local/include /usr/include
do
for lept in . leptonica liblept
do
if test -r "$incd/$lept/allheaders.h" ; then
CPPFLAGS="$CPPFLAGS -I$incd/$lept"
have_lept=yes
fi
done
done
if test "$have_lept" = yes ; then
AC_CHECK_LIB(lept,pixCreate)
fi
# ----------------------------------------
# Checks for header files.
# ----------------------------------------
@ -291,6 +275,22 @@ AC_PATH_LIBTIFF(,
[ no_libtiff=yes
AC_MSG_WARN([TIFF support is disabled]) ])
# Check location of leptonica/liblept headers.
have_lept=no
for incd in /usr/local/include /usr/include
do
for lept in . leptonica liblept
do
if test -r "$incd/$lept/allheaders.h" ; then
CPPFLAGS="$CPPFLAGS -I$incd/$lept"
have_lept=yes
fi
done
done
if test "$have_lept" = yes ; then
AC_CHECK_LIB(lept,pixCreate)
fi
# ----------------------------------------
# Final Tasks and Output
@ -303,13 +303,13 @@ AC_PATH_LIBTIFF(,
# Output files
AC_CONFIG_FILES(Makefile)
AC_CONFIG_FILES(api/Makefile)
AC_CONFIG_FILES(ccmain/Makefile)
AC_CONFIG_FILES(ccstruct/Makefile)
AC_CONFIG_FILES(ccutil/Makefile)
AC_CONFIG_FILES(classify/Makefile)
AC_CONFIG_FILES(cutil/Makefile)
AC_CONFIG_FILES(dict/Makefile)
AC_CONFIG_FILES(pageseg/Makefile)
AC_CONFIG_FILES(image/Makefile)
AC_CONFIG_FILES(textord/Makefile)
AC_CONFIG_FILES(viewer/Makefile)
@ -319,7 +319,6 @@ AC_CONFIG_FILES(tessdata/Makefile)
AC_CONFIG_FILES(tessdata/configs/Makefile)
AC_CONFIG_FILES(tessdata/tessconfigs/Makefile)
AC_CONFIG_FILES(testing/Makefile)
AC_CONFIG_FILES(dlltest/Makefile)
AC_CONFIG_FILES(java/Makefile)
AC_CONFIG_FILES(java/com/Makefile)
AC_CONFIG_FILES(java/com/google/Makefile)

View File

@ -46,10 +46,10 @@
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..,../image,../ccutil,../ccmain"
AdditionalIncludeDirectories="..,../image,../ccutil,../ccmain,../api"
PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;__MSW32__;_CRT_SECURE_NO_WARNINGS"
StringPooling="true"
RuntimeLibrary="2"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile=".\Release/dlltest.pch"
AssemblerListingLocation=".\Release/"
@ -135,11 +135,11 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..,../image,../ccutil,../ccmain"
AdditionalIncludeDirectories="..,../image,../ccutil,../ccmain,../api"
PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;__MSW32__;_CRT_SECURE_NO_WARNINGS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
RuntimeLibrary="1"
PrecompiledHeaderFile=".\Debug/dlltest.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"

BIN
glut32.dll Executable file

Binary file not shown.

BIN
jpeg62.dll Executable file

Binary file not shown.

BIN
leptonlib.dll Executable file

Binary file not shown.

BIN
libimage.dll Executable file

Binary file not shown.

BIN
libpng13.dll Executable file

Binary file not shown.

BIN
librle3.dll Executable file

Binary file not shown.

BIN
libtiff3.dll Executable file

Binary file not shown.

View File

@ -1,10 +1,12 @@
#!/bin/bash
winlist="tessdll.dll tessdll.lib tesseract.exe dlltest.exe training/cnTraining.exe training/mfTraining.exe training/unicharset_extractor.exe training/wordlist2dawg.exe java/ScrollView.jar"
winlist="tessdll.dll tessdll.lib tesseract.exe dlltest.exe cntraining.exe mftraining.exe unicharset_extractor.exe wordlist2dawg.exe java/ScrollView.jar"
windeps="glut32.dll jpeg62.dll libimage.dll libpng13.dll librle3.dll libtiff3.dll zlib1.dll leptonlib.dll lib/leptonlib.lib include/*.h dlltest/* tesseract.vcproj tesseract.sln StdAfx.cpp StdAfx.h tessdll.cpp tessdll.h tessdll.vcproj"
ver=`ls -1rt *[0-9].tar.gz |tail -1`
ver=${ver%.tar.gz}
for l in eng deu fra ita spa nld por deu-f vie kan eus
for l in eng deu fra ita spa nld por vie
do
chmod 644 tessdata/$l.*
tar --group root --owner root -chozf $ver.$l.tar.gz tessdata/$l.*
done
tar chozf $ver.exe.tar.gz $winlist
tar chozf $ver.windep.tar.gz $windeps

View File

@ -1,31 +1,111 @@
datadir = @datadir@/tessdata
data_DATA = confsets \
fra.DangAmbigs fra.freq-dawg fra.inttemp fra.normproto \
fra.pffmtable fra.user-words fra.word-dawg fra.unicharset \
ita.DangAmbigs ita.freq-dawg ita.inttemp ita.normproto \
ita.pffmtable ita.user-words ita.word-dawg ita.unicharset \
deu.DangAmbigs deu.freq-dawg deu.inttemp deu.normproto \
deu.pffmtable deu.user-words deu.word-dawg deu.unicharset \
spa.DangAmbigs spa.freq-dawg spa.inttemp spa.normproto \
spa.pffmtable spa.user-words spa.word-dawg spa.unicharset \
nld.DangAmbigs nld.freq-dawg nld.inttemp nld.normproto \
nld.pffmtable nld.user-words nld.word-dawg nld.unicharset \
eng.DangAmbigs eng.freq-dawg eng.inttemp eng.normproto \
eng.pffmtable eng.user-words eng.word-dawg eng.unicharset
data_DATA = bul.traineddata \
cat.traineddata \
ces.traineddata \
chi_sim.traineddata \
chi_tra.traineddata \
dan.traineddata \
deu.traineddata \
ell.traineddata \
eng.traineddata \
fin.traineddata \
fra.traineddata \
hun.traineddata \
ind.traineddata \
ita.traineddata \
jpn.traineddata \
kor.traineddata \
lav.traineddata \
lit.traineddata \
nld.traineddata \
nor.traineddata \
osd.traineddata \
pol.traineddata \
por.traineddata \
ron.traineddata \
rus.traineddata \
slk.traineddata \
slv.traineddata \
spa.traineddata \
srp.traineddata \
swe.traineddata \
tgl.traineddata \
tha.traineddata \
tur.traineddata \
ukr.traineddata \
vie.traineddata
SUBDIRS = configs tessconfigs
EXTRA_DIST = confsets makedummies
EXTRA_DIST = makedummies
eng.DangAmbigs eng.freq-dawg eng.inttemp eng.normproto eng.pffmtable eng.user-words eng.word-dawg eng.unicharset : makedummies
$(top_srcdir)/tessdata/makedummies eng
fra.DangAmbigs fra.freq-dawg fra.inttemp fra.normproto fra.pffmtable fra.user-words fra.word-dawg fra.unicharset : makedummies
$(top_srcdir)/tessdata/makedummies fra
ita.DangAmbigs ita.freq-dawg ita.inttemp ita.normproto ita.pffmtable ita.user-words ita.word-dawg ita.unicharset : makedummies
$(top_srcdir)/tessdata/makedummies ita
deu.DangAmbigs deu.freq-dawg deu.inttemp deu.normproto deu.pffmtable deu.user-words deu.word-dawg deu.unicharset : makedummies
$(top_srcdir)/tessdata/makedummies deu
spa.DangAmbigs spa.freq-dawg spa.inttemp spa.normproto spa.pffmtable spa.user-words spa.word-dawg spa.unicharset : makedummies
$(top_srcdir)/tessdata/makedummies spa
nld.DangAmbigs nld.freq-dawg nld.inttemp nld.normproto nld.pffmtable nld.user-words nld.word-dawg nld.unicharset : makedummies
$(top_srcdir)/tessdata/makedummies nld
bul.traineddata : makedummies
touch bul.traineddata
cat.traineddata : makedummies
touch cat.traineddata
ces.traineddata : makedummies
touch ces.traineddata
chi_sim.traineddata : makedummies
touch chi_sim.traineddata
chi_tra.traineddata : makedummies
touch chi_tra.traineddata
dan.traineddata : makedummies
touch dan.traineddata
deu.traineddata : makedummies
touch deu.traineddata
ell.traineddata : makedummies
touch ell.traineddata
eng.traineddata : makedummies
touch eng.traineddata
fin.traineddata : makedummies
touch fin.traineddata
fra.traineddata : makedummies
touch fra.traineddata
hun.traineddata : makedummies
touch hun.traineddata
ind.traineddata : makedummies
touch ind.traineddata
ita.traineddata : makedummies
touch ita.traineddata
jpn.traineddata : makedummies
touch jpn.traineddata
kor.traineddata : makedummies
touch kor.traineddata
lav.traineddata : makedummies
touch lav.traineddata
lit.traineddata : makedummies
touch lit.traineddata
nld.traineddata : makedummies
touch nld.traineddata
nor.traineddata : makedummies
touch nor.traineddata
osd.traineddata : makedummies
touch osd.traineddata
pol.traineddata : makedummies
touch pol.traineddata
por.traineddata : makedummies
touch por.traineddata
ron.traineddata : makedummies
touch ron.traineddata
rus.traineddata : makedummies
touch rus.traineddata
slk.traineddata : makedummies
touch slk.traineddata
slv.traineddata : makedummies
touch slv.traineddata
spa.traineddata : makedummies
touch spa.traineddata
srp.traineddata : makedummies
touch srp.traineddata
swe.traineddata : makedummies
touch swe.traineddata
tgl.traineddata : makedummies
touch tgl.traineddata
tha.traineddata : makedummies
touch tha.traineddata
tur.traineddata : makedummies
touch tur.traineddata
ukr.traineddata : makedummies
touch ukr.traineddata
vie.traineddata : makedummies
touch vie.traineddata

View File

@ -169,22 +169,44 @@ sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
data_DATA = confsets \
fra.DangAmbigs fra.freq-dawg fra.inttemp fra.normproto \
fra.pffmtable fra.user-words fra.word-dawg fra.unicharset \
ita.DangAmbigs ita.freq-dawg ita.inttemp ita.normproto \
ita.pffmtable ita.user-words ita.word-dawg ita.unicharset \
deu.DangAmbigs deu.freq-dawg deu.inttemp deu.normproto \
deu.pffmtable deu.user-words deu.word-dawg deu.unicharset \
spa.DangAmbigs spa.freq-dawg spa.inttemp spa.normproto \
spa.pffmtable spa.user-words spa.word-dawg spa.unicharset \
nld.DangAmbigs nld.freq-dawg nld.inttemp nld.normproto \
nld.pffmtable nld.user-words nld.word-dawg nld.unicharset \
eng.DangAmbigs eng.freq-dawg eng.inttemp eng.normproto \
eng.pffmtable eng.user-words eng.word-dawg eng.unicharset
data_DATA = bul.traineddata \
cat.traineddata \
ces.traineddata \
chi_sim.traineddata \
chi_tra.traineddata \
dan.traineddata \
deu.traineddata \
ell.traineddata \
eng.traineddata \
fin.traineddata \
fra.traineddata \
hun.traineddata \
ind.traineddata \
ita.traineddata \
jpn.traineddata \
kor.traineddata \
lav.traineddata \
lit.traineddata \
nld.traineddata \
nor.traineddata \
osd.traineddata \
pol.traineddata \
por.traineddata \
ron.traineddata \
rus.traineddata \
slk.traineddata \
slv.traineddata \
spa.traineddata \
srp.traineddata \
swe.traineddata \
tgl.traineddata \
tha.traineddata \
tur.traineddata \
ukr.traineddata \
vie.traineddata
SUBDIRS = configs tessconfigs
EXTRA_DIST = confsets makedummies
EXTRA_DIST = makedummies
all: all-recursive
.SUFFIXES:
@ -512,18 +534,76 @@ uninstall-am: uninstall-dataDATA
uninstall-dataDATA
eng.DangAmbigs eng.freq-dawg eng.inttemp eng.normproto eng.pffmtable eng.user-words eng.word-dawg eng.unicharset : makedummies
$(top_srcdir)/tessdata/makedummies eng
fra.DangAmbigs fra.freq-dawg fra.inttemp fra.normproto fra.pffmtable fra.user-words fra.word-dawg fra.unicharset : makedummies
$(top_srcdir)/tessdata/makedummies fra
ita.DangAmbigs ita.freq-dawg ita.inttemp ita.normproto ita.pffmtable ita.user-words ita.word-dawg ita.unicharset : makedummies
$(top_srcdir)/tessdata/makedummies ita
deu.DangAmbigs deu.freq-dawg deu.inttemp deu.normproto deu.pffmtable deu.user-words deu.word-dawg deu.unicharset : makedummies
$(top_srcdir)/tessdata/makedummies deu
spa.DangAmbigs spa.freq-dawg spa.inttemp spa.normproto spa.pffmtable spa.user-words spa.word-dawg spa.unicharset : makedummies
$(top_srcdir)/tessdata/makedummies spa
nld.DangAmbigs nld.freq-dawg nld.inttemp nld.normproto nld.pffmtable nld.user-words nld.word-dawg nld.unicharset : makedummies
$(top_srcdir)/tessdata/makedummies nld
bul.traineddata : makedummies
touch bul.traineddata
cat.traineddata : makedummies
touch cat.traineddata
ces.traineddata : makedummies
touch ces.traineddata
chi_sim.traineddata : makedummies
touch chi_sim.traineddata
chi_tra.traineddata : makedummies
touch chi_tra.traineddata
dan.traineddata : makedummies
touch dan.traineddata
deu.traineddata : makedummies
touch deu.traineddata
ell.traineddata : makedummies
touch ell.traineddata
eng.traineddata : makedummies
touch eng.traineddata
fin.traineddata : makedummies
touch fin.traineddata
fra.traineddata : makedummies
touch fra.traineddata
hun.traineddata : makedummies
touch hun.traineddata
ind.traineddata : makedummies
touch ind.traineddata
ita.traineddata : makedummies
touch ita.traineddata
jpn.traineddata : makedummies
touch jpn.traineddata
kor.traineddata : makedummies
touch kor.traineddata
lav.traineddata : makedummies
touch lav.traineddata
lit.traineddata : makedummies
touch lit.traineddata
nld.traineddata : makedummies
touch nld.traineddata
nor.traineddata : makedummies
touch nor.traineddata
osd.traineddata : makedummies
touch osd.traineddata
pol.traineddata : makedummies
touch pol.traineddata
por.traineddata : makedummies
touch por.traineddata
ron.traineddata : makedummies
touch ron.traineddata
rus.traineddata : makedummies
touch rus.traineddata
slk.traineddata : makedummies
touch slk.traineddata
slv.traineddata : makedummies
touch slv.traineddata
spa.traineddata : makedummies
touch spa.traineddata
srp.traineddata : makedummies
touch srp.traineddata
swe.traineddata : makedummies
touch swe.traineddata
tgl.traineddata : makedummies
touch tgl.traineddata
tha.traineddata : makedummies
touch tha.traineddata
tur.traineddata : makedummies
touch tur.traineddata
ukr.traineddata : makedummies
touch ukr.traineddata
vie.traineddata : makedummies
touch vie.traineddata
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -1,3 +0,0 @@
ao
ft
ce

View File

@ -70,13 +70,11 @@ BOOL APIENTRY DllMain( HANDLE hModule,
TessDllAPI::TessDllAPI(const char* lang) {
const char *fake_argv[] = { "api_config" };
uinT16 oldlang; //language
ocr_open_shm ("0", "0", "0", "0", "0", "0", &oldlang);
init_tesseract ("TESSEDIT", "tessapi", lang, 0L, 1, fake_argv);
Init(NULL, lang);
if (interactive_mode) {
@ -89,9 +87,6 @@ TessDllAPI::TessDllAPI(const char* lang) {
tessedit_write_txt_map.set_value(FALSE);
page_res=0L;
block_list = 0L;
membuf = (unsigned char *) new BYTE[(sizeof (ETEXT_DESC)+32000L*sizeof (EANYCODE_CHAR))];
}
@ -109,29 +104,7 @@ int TessDllAPI::BeginPage(uinT32 xsize,uinT32 ysize,unsigned char *buf)
}
int TessDllAPI::BeginPage(uinT32 xsize,uinT32 ysize,unsigned char *buf,uinT8 bpp) {
inT16 c;
EndPage();
if (page_image.create (xsize+800, ysize+800, 1)==-1)
return 0L; //make the image bigger to enclose in whitespace
//copy the passed buffer into the center of the image
IMAGE tmp;
tmp.create(xsize, ysize, bpp);
for (c=0;c<ysize;c++)
CopyMemory(tmp.get_buffer ()+(c)*((xsize*bpp + 7)/8),
buf+((ysize-1)-c)*((xsize*bpp + 7)/8),((xsize*bpp + 7)/8));
copy_sub_image(&tmp, 0, 0, 0, 0, &page_image, 400, 400, false);
SetImage(buf, xsize, ysize, bpp/8, (xsize*bpp + 7)/8);
return ProcessPagePass1();
}
int TessDllAPI::BeginPageUpright(uinT32 xsize,uinT32 ysize,unsigned char *buf)
@ -141,54 +114,27 @@ int TessDllAPI::BeginPageUpright(uinT32 xsize,uinT32 ysize,unsigned char *buf)
}
int TessDllAPI::BeginPageUpright(uinT32 xsize,uinT32 ysize,unsigned char *buf, uinT8 bpp) {
EndPage();
//It looks like Adaptive thresholding is disabled so this must be a 1 bpp image
if (page_image.create (xsize+800, ysize+800, 1)==-1)
return 0L; //make the image bigger to enclose in whitespace
//copy the passed buffer into the center of the image
IMAGE tmp;
tmp.capture(buf, xsize, ysize, bpp);
copy_sub_image(&tmp, 0, 0, 0, 0, &page_image, 400, 400, true);
SetPageSegMode(tesseract::PSM_SINGLE_BLOCK);
SetImage(buf, xsize, ysize, bpp/8, (xsize*bpp + 7)/8);
return ProcessPagePass1();
}
int TessDllAPI::ProcessPagePass1() {
STRING pagefile; //input file
static const char *fake_name = "noname.tif";
if (page_res_ != NULL)
ClearResults();
if (FindLines() != 0)
return -1;
//invert just to make it a normal black on white image.
invert_image(&page_image);
page_res_ = new PAGE_RES(block_list_);
block_list = new BLOCK_LIST;
pagefile = fake_name;
pgeditor_read_file(pagefile, block_list);
if (page_res_)
tesseract_->recog_all_words(page_res_, global_monitor,0L,1);
if (tessedit_resegment_from_boxes)
apply_boxes(block_list);
page_res = new PAGE_RES(block_list);
if (page_res)
recog_all_words(page_res, global_monitor,0L,1);
return (page_res!=0);
return (page_res_!=0);
}
void TessDllAPI::EndPage() {
if (page_res) delete page_res;
page_res=0L;
if (block_list) delete block_list;
block_list = 0L;
ClearResults();
}
@ -210,14 +156,16 @@ ETEXT_DESC * TessDllAPI::Recognize_a_Block(uinT32 left,uinT32 right,
global_monitor = ocr_setup_monitor();
recog_all_words(page_res, global_monitor,(right==0 ? 0L : &target_word_box),2);
tesseract_->recog_all_words(page_res_, global_monitor,
(right==0 ? 0L : &target_word_box), 2);
/* Disabled for now
for (i=0;i<global_monitor->count;i++) {
global_monitor->text[i].left-=400;
global_monitor->text[i].right-=400;
global_monitor->text[i].bottom-=400;
global_monitor->text[i].top-=400;
}
*/
global_monitor = 0L;

BIN
tessdll.dll Executable file

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -25,22 +25,13 @@ typedef BOOL bool;
#include "ocrclass.h"
#ifdef TESSDLL_EXPORTS
#define TESSDLL_API __declspec(dllexport)
#else
#define TESSDLL_API __declspec(dllimport)
#endif
#ifdef __cplusplus
#include "baseapi.h"
//This is an exposed C++
class TESSDLL_API TessDllAPI : public TessBaseAPI
class TESSDLL_API TessDllAPI : public tesseract::TessBaseAPI
{
public:
//lang is the code of the language for which the data will be loaded.
@ -74,10 +65,7 @@ class TESSDLL_API TessDllAPI : public TessBaseAPI
private:
int ProcessPagePass1();
PAGE_RES *page_res;
unsigned char *membuf;
BLOCK_LIST* block_list;
};
#endif
@ -87,6 +75,15 @@ extern "C"
{
#endif
#ifndef TESSDLL_API
#ifdef TESSDLL_EXPORTS
#define TESSDLL_API __declspec(dllexport)
#elif defined(TESSDLL_IMPORTS)
#define TESSDLL_API __declspec(dllimport)
#else
#define TESSDLL_API
#endif
#endif
//The functions below provide a c wrapper to a global recognize class object

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,116 +0,0 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "cnTraining"=.\training\cnTraining.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name mfTraining
End Project Dependency
Begin Project Dependency
Project_Dep_Name tesseract
End Project Dependency
Begin Project Dependency
Project_Dep_Name unicharset_extractor
End Project Dependency
Begin Project Dependency
Project_Dep_Name wordlist2dawg
End Project Dependency
}}}
###############################################################################
Project: "dlltest"=.\dlltest\dlltest.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name tessdll
End Project Dependency
}}}
###############################################################################
Project: "mfTraining"=.\training\mfTraining.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "tessdll"=.\tessdll.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "tesseract"=.\tesseract.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "unicharset_extractor"=.\training\unicharset_extractor.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "wordlist2dawg"=.\training\wordlist2dawg.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@ -1,22 +1,97 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual C++ Express 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cnTraining", "training\cntraining.vcproj", "{1AC769A4-E98E-48B9-B87B-90D7837031FA}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cntraining", "training\cntraining.vcproj", "{1AC769A4-E98E-48B9-B87B-90D7837031FA}"
ProjectSection(ProjectDependencies) = postProject
{0BDEFC56-679F-436E-A089-81FCAEBA50F3} = {0BDEFC56-679F-436E-A089-81FCAEBA50F3}
{2C106C68-62EE-43D2-B372-3BDFF6125AD1} = {2C106C68-62EE-43D2-B372-3BDFF6125AD1}
{CE11FF6E-60D3-4E61-AFE2-F8F501100238} = {CE11FF6E-60D3-4E61-AFE2-F8F501100238}
{DF2FA86F-A663-4805-AED7-2F81D9EAC796} = {DF2FA86F-A663-4805-AED7-2F81D9EAC796}
{C7C7FBB5-7082-428C-8F81-8FBA7A37AC85} = {C7C7FBB5-7082-428C-8F81-8FBA7A37AC85}
{1D62F8BB-31D7-4BBF-A4DA-619A29675D06} = {1D62F8BB-31D7-4BBF-A4DA-619A29675D06}
{D67B17CC-4AE5-4356-91F6-00E265942A56} = {D67B17CC-4AE5-4356-91F6-00E265942A56}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dlltest", "dlltest\dlltest.vcproj", "{F8B1406B-1643-4402-B07A-8ADD9A52C01E}"
ProjectSection(ProjectDependencies) = postProject
{DF2FA86F-A663-4805-AED7-2F81D9EAC796} = {DF2FA86F-A663-4805-AED7-2F81D9EAC796}
{CB522274-3353-41AE-A700-F365FC79DEDD} = {CB522274-3353-41AE-A700-F365FC79DEDD}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mfTraining", "training\mftraining.vcproj", "{EC8A9E75-C66E-4320-9D91-97F53ED7021B}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mftraining", "training\mftraining.vcproj", "{EC8A9E75-C66E-4320-9D91-97F53ED7021B}"
ProjectSection(ProjectDependencies) = postProject
{0BDEFC56-679F-436E-A089-81FCAEBA50F3} = {0BDEFC56-679F-436E-A089-81FCAEBA50F3}
{2C106C68-62EE-43D2-B372-3BDFF6125AD1} = {2C106C68-62EE-43D2-B372-3BDFF6125AD1}
{CE11FF6E-60D3-4E61-AFE2-F8F501100238} = {CE11FF6E-60D3-4E61-AFE2-F8F501100238}
{DF2FA86F-A663-4805-AED7-2F81D9EAC796} = {DF2FA86F-A663-4805-AED7-2F81D9EAC796}
{C7C7FBB5-7082-428C-8F81-8FBA7A37AC85} = {C7C7FBB5-7082-428C-8F81-8FBA7A37AC85}
{1D62F8BB-31D7-4BBF-A4DA-619A29675D06} = {1D62F8BB-31D7-4BBF-A4DA-619A29675D06}
{D67B17CC-4AE5-4356-91F6-00E265942A56} = {D67B17CC-4AE5-4356-91F6-00E265942A56}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tessdll", "tessdll.vcproj", "{CB522274-3353-41AE-A700-F365FC79DEDD}"
ProjectSection(ProjectDependencies) = postProject
{EFE93017-B435-46EA-9199-1C83A869595A} = {EFE93017-B435-46EA-9199-1C83A869595A}
{C2342D39-FD84-4448-A050-7FF3B4A33F3D} = {C2342D39-FD84-4448-A050-7FF3B4A33F3D}
{0BDEFC56-679F-436E-A089-81FCAEBA50F3} = {0BDEFC56-679F-436E-A089-81FCAEBA50F3}
{2C106C68-62EE-43D2-B372-3BDFF6125AD1} = {2C106C68-62EE-43D2-B372-3BDFF6125AD1}
{CE11FF6E-60D3-4E61-AFE2-F8F501100238} = {CE11FF6E-60D3-4E61-AFE2-F8F501100238}
{DF2FA86F-A663-4805-AED7-2F81D9EAC796} = {DF2FA86F-A663-4805-AED7-2F81D9EAC796}
{D5C6C872-4561-452D-BCFA-EF9441F95309} = {D5C6C872-4561-452D-BCFA-EF9441F95309}
{C7C7FBB5-7082-428C-8F81-8FBA7A37AC85} = {C7C7FBB5-7082-428C-8F81-8FBA7A37AC85}
{1D62F8BB-31D7-4BBF-A4DA-619A29675D06} = {1D62F8BB-31D7-4BBF-A4DA-619A29675D06}
{D67B17CC-4AE5-4356-91F6-00E265942A56} = {D67B17CC-4AE5-4356-91F6-00E265942A56}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tesseract", "tesseract.vcproj", "{47519557-3296-407A-BE51-8175C77B0868}"
ProjectSection(ProjectDependencies) = postProject
{EFE93017-B435-46EA-9199-1C83A869595A} = {EFE93017-B435-46EA-9199-1C83A869595A}
{C2342D39-FD84-4448-A050-7FF3B4A33F3D} = {C2342D39-FD84-4448-A050-7FF3B4A33F3D}
{0BDEFC56-679F-436E-A089-81FCAEBA50F3} = {0BDEFC56-679F-436E-A089-81FCAEBA50F3}
{2C106C68-62EE-43D2-B372-3BDFF6125AD1} = {2C106C68-62EE-43D2-B372-3BDFF6125AD1}
{CE11FF6E-60D3-4E61-AFE2-F8F501100238} = {CE11FF6E-60D3-4E61-AFE2-F8F501100238}
{DF2FA86F-A663-4805-AED7-2F81D9EAC796} = {DF2FA86F-A663-4805-AED7-2F81D9EAC796}
{D5C6C872-4561-452D-BCFA-EF9441F95309} = {D5C6C872-4561-452D-BCFA-EF9441F95309}
{C7C7FBB5-7082-428C-8F81-8FBA7A37AC85} = {C7C7FBB5-7082-428C-8F81-8FBA7A37AC85}
{1D62F8BB-31D7-4BBF-A4DA-619A29675D06} = {1D62F8BB-31D7-4BBF-A4DA-619A29675D06}
{D67B17CC-4AE5-4356-91F6-00E265942A56} = {D67B17CC-4AE5-4356-91F6-00E265942A56}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unicharset_extractor", "training\unicharset_extractor.vcproj", "{06878883-8785-4C71-89B6-47CEDA3CD300}"
ProjectSection(ProjectDependencies) = postProject
{DF2FA86F-A663-4805-AED7-2F81D9EAC796} = {DF2FA86F-A663-4805-AED7-2F81D9EAC796}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wordlist2dawg", "training\wordlist2dawg.vcproj", "{5B6DC93B-30BE-4E8E-A396-3970A83CB74B}"
ProjectSection(ProjectDependencies) = postProject
{0BDEFC56-679F-436E-A089-81FCAEBA50F3} = {0BDEFC56-679F-436E-A089-81FCAEBA50F3}
{2C106C68-62EE-43D2-B372-3BDFF6125AD1} = {2C106C68-62EE-43D2-B372-3BDFF6125AD1}
{CE11FF6E-60D3-4E61-AFE2-F8F501100238} = {CE11FF6E-60D3-4E61-AFE2-F8F501100238}
{DF2FA86F-A663-4805-AED7-2F81D9EAC796} = {DF2FA86F-A663-4805-AED7-2F81D9EAC796}
{C7C7FBB5-7082-428C-8F81-8FBA7A37AC85} = {C7C7FBB5-7082-428C-8F81-8FBA7A37AC85}
{1D62F8BB-31D7-4BBF-A4DA-619A29675D06} = {1D62F8BB-31D7-4BBF-A4DA-619A29675D06}
{D67B17CC-4AE5-4356-91F6-00E265942A56} = {D67B17CC-4AE5-4356-91F6-00E265942A56}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ccutil", "ccutil\ccutil.vcproj", "{DF2FA86F-A663-4805-AED7-2F81D9EAC796}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "viewer", "viewer\viewer.vcproj", "{CE11FF6E-60D3-4E61-AFE2-F8F501100238}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cutil", "cutil\cutil.vcproj", "{0BDEFC56-679F-436E-A089-81FCAEBA50F3}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "image", "image\image.vcproj", "{2C106C68-62EE-43D2-B372-3BDFF6125AD1}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ccstruct", "ccstruct\ccstruct.vcproj", "{1D62F8BB-31D7-4BBF-A4DA-619A29675D06}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dict", "dict\dict.vcproj", "{D67B17CC-4AE5-4356-91F6-00E265942A56}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "classify", "classify\classify.vcproj", "{C7C7FBB5-7082-428C-8F81-8FBA7A37AC85}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wordrec", "wordrec\wordrec.vcproj", "{C2342D39-FD84-4448-A050-7FF3B4A33F3D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "textord", "textord\textord.vcproj", "{D5C6C872-4561-452D-BCFA-EF9441F95309}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ccmain", "ccmain\ccmain.vcproj", "{EFE93017-B435-46EA-9199-1C83A869595A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -52,6 +127,46 @@ Global
{5B6DC93B-30BE-4E8E-A396-3970A83CB74B}.Debug|Win32.Build.0 = Debug|Win32
{5B6DC93B-30BE-4E8E-A396-3970A83CB74B}.Release|Win32.ActiveCfg = Release|Win32
{5B6DC93B-30BE-4E8E-A396-3970A83CB74B}.Release|Win32.Build.0 = Release|Win32
{DF2FA86F-A663-4805-AED7-2F81D9EAC796}.Debug|Win32.ActiveCfg = Debug|Win32
{DF2FA86F-A663-4805-AED7-2F81D9EAC796}.Debug|Win32.Build.0 = Debug|Win32
{DF2FA86F-A663-4805-AED7-2F81D9EAC796}.Release|Win32.ActiveCfg = Release|Win32
{DF2FA86F-A663-4805-AED7-2F81D9EAC796}.Release|Win32.Build.0 = Release|Win32
{CE11FF6E-60D3-4E61-AFE2-F8F501100238}.Debug|Win32.ActiveCfg = Debug|Win32
{CE11FF6E-60D3-4E61-AFE2-F8F501100238}.Debug|Win32.Build.0 = Debug|Win32
{CE11FF6E-60D3-4E61-AFE2-F8F501100238}.Release|Win32.ActiveCfg = Release|Win32
{CE11FF6E-60D3-4E61-AFE2-F8F501100238}.Release|Win32.Build.0 = Release|Win32
{0BDEFC56-679F-436E-A089-81FCAEBA50F3}.Debug|Win32.ActiveCfg = Debug|Win32
{0BDEFC56-679F-436E-A089-81FCAEBA50F3}.Debug|Win32.Build.0 = Debug|Win32
{0BDEFC56-679F-436E-A089-81FCAEBA50F3}.Release|Win32.ActiveCfg = Release|Win32
{0BDEFC56-679F-436E-A089-81FCAEBA50F3}.Release|Win32.Build.0 = Release|Win32
{2C106C68-62EE-43D2-B372-3BDFF6125AD1}.Debug|Win32.ActiveCfg = Debug|Win32
{2C106C68-62EE-43D2-B372-3BDFF6125AD1}.Debug|Win32.Build.0 = Debug|Win32
{2C106C68-62EE-43D2-B372-3BDFF6125AD1}.Release|Win32.ActiveCfg = Release|Win32
{2C106C68-62EE-43D2-B372-3BDFF6125AD1}.Release|Win32.Build.0 = Release|Win32
{1D62F8BB-31D7-4BBF-A4DA-619A29675D06}.Debug|Win32.ActiveCfg = Debug|Win32
{1D62F8BB-31D7-4BBF-A4DA-619A29675D06}.Debug|Win32.Build.0 = Debug|Win32
{1D62F8BB-31D7-4BBF-A4DA-619A29675D06}.Release|Win32.ActiveCfg = Release|Win32
{1D62F8BB-31D7-4BBF-A4DA-619A29675D06}.Release|Win32.Build.0 = Release|Win32
{D67B17CC-4AE5-4356-91F6-00E265942A56}.Debug|Win32.ActiveCfg = Debug|Win32
{D67B17CC-4AE5-4356-91F6-00E265942A56}.Debug|Win32.Build.0 = Debug|Win32
{D67B17CC-4AE5-4356-91F6-00E265942A56}.Release|Win32.ActiveCfg = Release|Win32
{D67B17CC-4AE5-4356-91F6-00E265942A56}.Release|Win32.Build.0 = Release|Win32
{C7C7FBB5-7082-428C-8F81-8FBA7A37AC85}.Debug|Win32.ActiveCfg = Debug|Win32
{C7C7FBB5-7082-428C-8F81-8FBA7A37AC85}.Debug|Win32.Build.0 = Debug|Win32
{C7C7FBB5-7082-428C-8F81-8FBA7A37AC85}.Release|Win32.ActiveCfg = Release|Win32
{C7C7FBB5-7082-428C-8F81-8FBA7A37AC85}.Release|Win32.Build.0 = Release|Win32
{C2342D39-FD84-4448-A050-7FF3B4A33F3D}.Debug|Win32.ActiveCfg = Debug|Win32
{C2342D39-FD84-4448-A050-7FF3B4A33F3D}.Debug|Win32.Build.0 = Debug|Win32
{C2342D39-FD84-4448-A050-7FF3B4A33F3D}.Release|Win32.ActiveCfg = Release|Win32
{C2342D39-FD84-4448-A050-7FF3B4A33F3D}.Release|Win32.Build.0 = Release|Win32
{D5C6C872-4561-452D-BCFA-EF9441F95309}.Debug|Win32.ActiveCfg = Debug|Win32
{D5C6C872-4561-452D-BCFA-EF9441F95309}.Debug|Win32.Build.0 = Debug|Win32
{D5C6C872-4561-452D-BCFA-EF9441F95309}.Release|Win32.ActiveCfg = Release|Win32
{D5C6C872-4561-452D-BCFA-EF9441F95309}.Release|Win32.Build.0 = Release|Win32
{EFE93017-B435-46EA-9199-1C83A869595A}.Debug|Win32.ActiveCfg = Debug|Win32
{EFE93017-B435-46EA-9199-1C83A869595A}.Debug|Win32.Build.0 = Debug|Win32
{EFE93017-B435-46EA-9199-1C83A869595A}.Release|Win32.ActiveCfg = Release|Win32
{EFE93017-B435-46EA-9199-1C83A869595A}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

File diff suppressed because it is too large Load Diff

View File

@ -1,71 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cnTraining", "training\cnTraining_2008.vcproj", "{1AC769A4-E98E-48B9-B87B-90D7837031FA}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dlltest", "dlltest\dlltest_2008.vcproj", "{F8B1406B-1643-4402-B07A-8ADD9A52C01E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mfTraining", "training\mfTraining_2008.vcproj", "{EC8A9E75-C66E-4320-9D91-97F53ED7021B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tessdll", "tessdll_2008.vcproj", "{CB522274-3353-41AE-A700-F365FC79DEDD}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tesseract", "tesseract_2008.vcproj", "{47519557-3296-407A-BE51-8175C77B0868}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unicharset_extractor", "training\unicharset_extractor_2008.vcproj", "{06878883-8785-4C71-89B6-47CEDA3CD300}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wordlist2dawg", "training\wordlist2dawg_2008.vcproj", "{5B6DC93B-30BE-4E8E-A396-3970A83CB74B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
load|Win32 = load|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1AC769A4-E98E-48B9-B87B-90D7837031FA}.Debug|Win32.ActiveCfg = Debug|Win32
{1AC769A4-E98E-48B9-B87B-90D7837031FA}.Debug|Win32.Build.0 = Debug|Win32
{1AC769A4-E98E-48B9-B87B-90D7837031FA}.load|Win32.ActiveCfg = Debug|Win32
{1AC769A4-E98E-48B9-B87B-90D7837031FA}.load|Win32.Build.0 = Debug|Win32
{1AC769A4-E98E-48B9-B87B-90D7837031FA}.Release|Win32.ActiveCfg = Release|Win32
{1AC769A4-E98E-48B9-B87B-90D7837031FA}.Release|Win32.Build.0 = Release|Win32
{F8B1406B-1643-4402-B07A-8ADD9A52C01E}.Debug|Win32.ActiveCfg = Debug|Win32
{F8B1406B-1643-4402-B07A-8ADD9A52C01E}.Debug|Win32.Build.0 = Debug|Win32
{F8B1406B-1643-4402-B07A-8ADD9A52C01E}.load|Win32.ActiveCfg = Debug|Win32
{F8B1406B-1643-4402-B07A-8ADD9A52C01E}.load|Win32.Build.0 = Debug|Win32
{F8B1406B-1643-4402-B07A-8ADD9A52C01E}.Release|Win32.ActiveCfg = Release|Win32
{F8B1406B-1643-4402-B07A-8ADD9A52C01E}.Release|Win32.Build.0 = Release|Win32
{EC8A9E75-C66E-4320-9D91-97F53ED7021B}.Debug|Win32.ActiveCfg = Debug|Win32
{EC8A9E75-C66E-4320-9D91-97F53ED7021B}.Debug|Win32.Build.0 = Debug|Win32
{EC8A9E75-C66E-4320-9D91-97F53ED7021B}.load|Win32.ActiveCfg = Release|Win32
{EC8A9E75-C66E-4320-9D91-97F53ED7021B}.load|Win32.Build.0 = Release|Win32
{EC8A9E75-C66E-4320-9D91-97F53ED7021B}.Release|Win32.ActiveCfg = Release|Win32
{EC8A9E75-C66E-4320-9D91-97F53ED7021B}.Release|Win32.Build.0 = Release|Win32
{CB522274-3353-41AE-A700-F365FC79DEDD}.Debug|Win32.ActiveCfg = Debug|Win32
{CB522274-3353-41AE-A700-F365FC79DEDD}.Debug|Win32.Build.0 = Debug|Win32
{CB522274-3353-41AE-A700-F365FC79DEDD}.load|Win32.ActiveCfg = load|Win32
{CB522274-3353-41AE-A700-F365FC79DEDD}.load|Win32.Build.0 = load|Win32
{CB522274-3353-41AE-A700-F365FC79DEDD}.Release|Win32.ActiveCfg = Release|Win32
{CB522274-3353-41AE-A700-F365FC79DEDD}.Release|Win32.Build.0 = Release|Win32
{47519557-3296-407A-BE51-8175C77B0868}.Debug|Win32.ActiveCfg = Debug|Win32
{47519557-3296-407A-BE51-8175C77B0868}.Debug|Win32.Build.0 = Debug|Win32
{47519557-3296-407A-BE51-8175C77B0868}.load|Win32.ActiveCfg = Debug|Win32
{47519557-3296-407A-BE51-8175C77B0868}.load|Win32.Build.0 = Debug|Win32
{47519557-3296-407A-BE51-8175C77B0868}.Release|Win32.ActiveCfg = Release|Win32
{47519557-3296-407A-BE51-8175C77B0868}.Release|Win32.Build.0 = Release|Win32
{06878883-8785-4C71-89B6-47CEDA3CD300}.Debug|Win32.ActiveCfg = Debug|Win32
{06878883-8785-4C71-89B6-47CEDA3CD300}.Debug|Win32.Build.0 = Debug|Win32
{06878883-8785-4C71-89B6-47CEDA3CD300}.load|Win32.ActiveCfg = Debug|Win32
{06878883-8785-4C71-89B6-47CEDA3CD300}.load|Win32.Build.0 = Debug|Win32
{06878883-8785-4C71-89B6-47CEDA3CD300}.Release|Win32.ActiveCfg = Release|Win32
{06878883-8785-4C71-89B6-47CEDA3CD300}.Release|Win32.Build.0 = Release|Win32
{5B6DC93B-30BE-4E8E-A396-3970A83CB74B}.Debug|Win32.ActiveCfg = Debug|Win32
{5B6DC93B-30BE-4E8E-A396-3970A83CB74B}.Debug|Win32.Build.0 = Debug|Win32
{5B6DC93B-30BE-4E8E-A396-3970A83CB74B}.load|Win32.ActiveCfg = Debug|Win32
{5B6DC93B-30BE-4E8E-A396-3970A83CB74B}.load|Win32.Build.0 = Debug|Win32
{5B6DC93B-30BE-4E8E-A396-3970A83CB74B}.Release|Win32.ActiveCfg = Release|Win32
{5B6DC93B-30BE-4E8E-A396-3970A83CB74B}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

File diff suppressed because it is too large Load Diff

View File

@ -1,769 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="unicharset_extractor"
ProjectGUID="{06878883-8785-4C71-89B6-47CEDA3CD300}"
Keyword="MFCProj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\."
IntermediateDirectory=".\uce.Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\./unicharset_extractor.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../ccutil"
PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;__MSW32__"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile=".\uce.Release/unicharset_extractor.pch"
AssemblerListingLocation=".\uce.Release/"
ObjectFile=".\uce.Release/"
ProgramDataBaseFileName=".\uce.Release/"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="user32.lib"
OutputFile=".\./unicharset_extractor.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
ProgramDatabaseFile=".\./unicharset_extractor.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile=".\./unicharset_extractor.bsc"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\../bin.dbg"
IntermediateDirectory=".\uce.Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\../bin.dbg/unicharset_extractor.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../ccutil"
PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;__MSW32__"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
PrecompiledHeaderFile=".\uce.Debug/unicharset_extractor.pch"
AssemblerListingLocation=".\uce.Debug/"
ObjectFile=".\uce.Debug/"
ProgramDataBaseFileName=".\uce.Debug/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="user32.lib"
OutputFile=".\../bin.dbg/unicharset_extractor.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\../bin.dbg/unicharset_extractor.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile=".\../bin.dbg/unicharset_extractor.bsc"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="..\ccutil\serialis.cpp"
>
</File>
<File
RelativePath="unicharset_extractor.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<Filter
Name="ccutil"
>
<File
RelativePath="..\ccutil\boxread.cpp"
>
</File>
<File
RelativePath="..\ccutil\clst.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="mfcpch.h"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="mfcpch.h"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\ccutil\debugwin.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="mfcpch.h"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="mfcpch.h"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\ccutil\errcode.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="mfcpch.h"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="mfcpch.h"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\ccutil\globaloc.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="mfcpch.h"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="mfcpch.h"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\ccutil\hashfn.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="mfcpch.h"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="mfcpch.h"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\ccutil\memblk.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="mfcpch.h"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="mfcpch.h"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\ccutil\memry.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="mfcpch.h"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="mfcpch.h"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\ccutil\mfcpch.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="1"
PrecompiledHeaderThrough="mfcpch.h"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="1"
PrecompiledHeaderThrough="mfcpch.h"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\ccutil\strngs.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\ccutil\tessopt.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\ccutil\tprintf.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="mfcpch.h"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="mfcpch.h"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\ccutil\unichar.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\ccutil\unicharmap.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\ccutil\unicharset.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\ccutil\varable.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
</Filter>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath="..\ccutil\basedir.h"
>
</File>
<File
RelativePath="..\ccutil\bits16.h"
>
</File>
<File
RelativePath="..\ccutil\boxread.h"
>
</File>
<File
RelativePath="..\ccutil\clst.h"
>
</File>
<File
RelativePath="..\ccutil\debugwin.h"
>
</File>
<File
RelativePath="..\ccutil\elst.h"
>
</File>
<File
RelativePath="..\ccutil\elst2.h"
>
</File>
<File
RelativePath="..\ccutil\errcode.h"
>
</File>
<File
RelativePath="..\ccutil\fileerr.h"
>
</File>
<File
RelativePath="..\ccutil\globaloc.h"
>
</File>
<File
RelativePath="..\ccutil\hashfn.h"
>
</File>
<File
RelativePath="..\ccutil\host.h"
>
</File>
<File
RelativePath="..\ccutil\hosthplb.h"
>
</File>
<File
RelativePath="..\ccutil\lsterr.h"
>
</File>
<File
RelativePath="..\ccutil\mainblk.h"
>
</File>
<File
RelativePath="..\ccutil\memblk.h"
>
</File>
<File
RelativePath="..\ccutil\memry.h"
>
</File>
<File
RelativePath="..\ccutil\memryerr.h"
>
</File>
<File
RelativePath="..\ccutil\mfcpch.h"
>
</File>
<File
RelativePath="..\ccutil\ndminx.h"
>
</File>
<File
RelativePath="..\ccutil\notdll.h"
>
</File>
<File
RelativePath="..\ccutil\nwmain.h"
>
</File>
<File
RelativePath="..\ccutil\ocrclass.h"
>
</File>
<File
RelativePath="..\ccutil\ocrshell.h"
>
</File>
<File
RelativePath="..\ccutil\platform.h"
>
</File>
<File
RelativePath="..\ccutil\scanutils.h"
>
</File>
<File
RelativePath="..\ccutil\secname.h"
>
</File>
<File
RelativePath="..\ccutil\serialis.h"
>
</File>
<File
RelativePath="..\ccutil\stderr.h"
>
</File>
<File
RelativePath="..\ccutil\strngs.h"
>
</File>
<File
RelativePath="..\ccutil\tessclas.h"
>
</File>
<File
RelativePath="..\ccutil\tessopt.h"
>
</File>
<File
RelativePath="..\ccutil\tprintf.h"
>
</File>
<File
RelativePath="..\ccutil\unichar.h"
>
</File>
<File
RelativePath="..\ccutil\unicharmap.h"
>
</File>
<File
RelativePath="..\ccutil\unicharset.h"
>
</File>
<File
RelativePath="..\ccutil\varable.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -29,19 +29,25 @@
#include <assert.h>
#include "bestfirst.h"
#include "heuristic.h"
#include "plotseg.h"
#include "tordvars.h"
#include "debug.h"
#include "pieces.h"
#include "stopper.h"
#include "metrics.h"
#include "states.h"
#include "baseline.h"
#include "bitvec.h"
#include "callback.h"
#include "dict.h"
#include "freelist.h"
#include "globals.h"
#include "heuristic.h"
#include "metrics.h"
#include "permute.h"
#include "pieces.h"
#include "plotseg.h"
#include "ratngs.h"
#include "states.h"
#include "stopper.h"
#include "structures.h"
#include "tordvars.h"
#include "unicharset.h"
#include "wordclass.h"
#include "wordrec.h"
void call_caller();
@ -52,26 +58,14 @@ int num_joints; /* Number of chunks - 1 */
int num_pushed = 0;
int num_popped = 0;
make_int_var (num_seg_states, 30, make_seg_states,
9, 1, set_seg_states, "Segmentation states");
INT_VAR(wordrec_num_seg_states, 30, "Segmentation states");
double_VAR(wordrec_worst_state, 1, "Worst segmentation state");
make_float_var (worst_state, 1, make_worst_state,
9, 9, set_worst_state, "Worst segmentation state");
/**/
/*----------------------------------------------------------------------
F u n c t i o n s
----------------------------------------------------------------------*/
/**********************************************************************
* init_bestfirst_vars
*
* Create and initialize references to debug variables that control
* operations in this file.
**********************************************************************/
void init_bestfirst_vars() {
make_seg_states();
make_worst_state();
}
/**********************************************************************
* best_first_search
@ -79,85 +73,129 @@ void init_bestfirst_vars() {
* Find the best segmentation by doing a best first search of the
* solution space.
**********************************************************************/
void best_first_search(CHUNKS_RECORD *chunks_record,
A_CHOICE *best_choice,
A_CHOICE *raw_choice,
STATE *state,
DANGERR *fixpt,
STATE *best_state,
inT32 pass) {
namespace tesseract {
void Wordrec::best_first_search(CHUNKS_RECORD *chunks_record,
WERD_CHOICE *best_choice,
WERD_CHOICE *raw_choice,
STATE *state,
DANGERR *fixpt,
STATE *best_state) {
SEARCH_RECORD *the_search;
inT16 keep_going;
STATE guided_state;
STATE guided_state; // not used
num_joints = matrix_dimension (chunks_record->ratings) - 1;
the_search = new_search (chunks_record, num_joints,
best_choice, raw_choice, state);
num_joints = chunks_record->ratings->dimension() - 1;
the_search = new_search(chunks_record, num_joints,
best_choice, raw_choice, state);
// The default state is initialized as the best choice. In order to apply
// segmentation adjustment, or any other contextual processing in permute,
// we give the best choice a poor rating to force the processed raw choice
// to be promoted to best choice.
the_search->best_choice->set_rating(100000.0);
evaluate_state(chunks_record, the_search, fixpt);
if (permute_debug) {
tprintf("\n\n\n =========== BestFirstSearch ==============\n");
best_choice->print("**Initial BestChoice**");
}
#ifndef GRAPHICS_DISABLED
save_best_state(chunks_record);
#endif
start_recording();
FLOAT32 worst_priority = 2.0f * prioritize_state(chunks_record,
the_search,
best_state);
if (worst_priority < worst_state)
worst_priority = worst_state;
FLOAT32 worst_priority = 2.0f * prioritize_state(chunks_record, the_search);
if (worst_priority < wordrec_worst_state)
worst_priority = wordrec_worst_state;
if (segment_debug) {
print_state("BestFirstSearch", best_state, num_joints);
}
guided_state = *state;
do {
/* Look for answer */
if (!hash_lookup (the_search->closed_states, the_search->this_state)) {
if (blob_skip) {
if (tord_blob_skip) {
free_state (the_search->this_state);
break;
}
guided_state = *(the_search->this_state);
keep_going =
evaluate_state(chunks_record, the_search, fixpt, best_state, pass);
keep_going = evaluate_state(chunks_record, the_search, fixpt);
hash_add (the_search->closed_states, the_search->this_state);
if (!keep_going ||
(the_search->num_states > num_seg_states) || (blob_skip)) {
(the_search->num_states > wordrec_num_seg_states) ||
(tord_blob_skip)) {
if (segment_debug)
tprintf("Breaking best_first_search on keep_going %s numstates %d\n",
((keep_going) ? "T" :"F"), the_search->num_states);
free_state (the_search->this_state);
break;
}
FLOAT32 new_worst_priority = 2.0f * prioritize_state(chunks_record,
the_search);
if (new_worst_priority < worst_priority) {
if (segment_debug)
tprintf("Lowering WorstPriority %f --> %f\n",
worst_priority, new_worst_priority);
// Tighten the threshold for admitting new paths as better search
// candidates are found. After lowering this threshold, we can safely
// popout everything that is worse than this score also.
worst_priority = new_worst_priority;
}
expand_node(worst_priority, chunks_record, the_search);
}
free_state (the_search->this_state);
num_popped++;
the_search->this_state = pop_queue (the_search->open_states);
if (segment_debug && !the_search->this_state)
tprintf("No more states to evalaute after %d evals", num_popped);
}
while (the_search->this_state);
state->part1 = the_search->best_state->part1;
state->part2 = the_search->best_state->part2;
stop_recording();
if (permute_debug) {
tprintf("\n\n\n =========== BestFirstSearch ==============\n");
// best_choice->debug_string(getDict().getUnicharset()).string());
best_choice->print("**Final BestChoice**");
}
// save the best_state stats
delete_search(the_search);
}
} // namespace tesseract
/**********************************************************************
* chunks_width
*
* Return the width of several of the chunks (if they were joined to-
* gether.
* Return the width of a chunk which is a composed of several blobs
* blobs[start_blob..last_blob] inclusively,
* whose individual widths and gaps are record in width_record in the form
* width_record->num_char = n
* width_record->widths[2*n-1] = w0,g0,w1,g1..w(n-1),g(n-1)
**********************************************************************/
int chunks_width(WIDTH_RECORD *width_record, int start_chunk, int last_chunk) {
int chunks_width(WIDTH_RECORD *width_record, int start_blob, int last_blob) {
int result = 0;
int x;
for (x = start_chunk * 2; x <= last_chunk * 2; x++)
for (int x = start_blob * 2; x <= last_blob * 2; x++)
result += width_record->widths[x];
return (result);
}
/**********************************************************************
* chunks_gap
*
* Return the width of between the specified chunk and next.
**********************************************************************/
int chunks_gap(WIDTH_RECORD *width_record, int last_chunk) {
return (last_chunk < width_record->num_chars - 1) ?
width_record->widths[last_chunk * 2 + 1] : 0;
}
/**********************************************************************
* delete_search
@ -191,18 +229,16 @@ void delete_search(SEARCH_RECORD *the_search) {
* A particular word level segmentation has been chosen. Evaluation
* this to find the word list that corresponds to it.
**********************************************************************/
CHOICES_LIST evaluate_chunks(CHUNKS_RECORD *chunks_record,
SEARCH_STATE search_state,
STATE *this_state,
STATE *best_state,
inT32 pass) {
CHOICES_LIST char_choices;
CHOICES this_choice;
namespace tesseract {
BLOB_CHOICE_LIST_VECTOR *Wordrec::evaluate_chunks(CHUNKS_RECORD *chunks_record,
SEARCH_STATE search_state) {
BLOB_CHOICE_LIST_VECTOR *char_choices = new BLOB_CHOICE_LIST_VECTOR();
BLOB_CHOICE_LIST *blob_choices;
BLOB_CHOICE_IT blob_choice_it;
int i;
int x = 0;
int y;
char_choices = new_choice_list ();
/* Iterate sub-paths */
for (i = 1; i <= search_state[0] + 1; i++) {
if (i > search_state[0])
@ -210,85 +246,87 @@ CHOICES_LIST evaluate_chunks(CHUNKS_RECORD *chunks_record,
else
y = x + search_state[i];
if (blob_skip) {
array_free(char_choices);
if (tord_blob_skip) {
delete char_choices;
return (NULL);
} /* Process one square */
/* Classify if needed */
this_choice = get_piece_rating (chunks_record->ratings,
chunks_record->chunks,
chunks_record->splits,
x, y,
chunks_record->fx,
this_state, best_state, pass, i - 1);
blob_choices = get_piece_rating(chunks_record->ratings,
chunks_record->chunks,
chunks_record->splits,
x, y);
if (this_choice == NIL) {
array_free(char_choices);
if (blob_choices == NULL) {
delete char_choices;
return (NULL);
}
/* Add permuted ratings */
last_segmentation[i - 1].certainty = best_certainty (this_choice);
last_segmentation[i - 1].match = best_probability (this_choice);
blob_choice_it.set_to_list(blob_choices);
last_segmentation[i - 1].certainty = blob_choice_it.data()->certainty();
last_segmentation[i - 1].match = blob_choice_it.data()->rating();
last_segmentation[i - 1].width =
chunks_width (chunks_record->chunk_widths, x, y);
last_segmentation[i - 1].gap =
chunks_gap (chunks_record->chunk_widths, y);
char_choices = array_push (char_choices, this_choice);
*char_choices += blob_choices;
x = y + 1;
}
return (char_choices);
}
/**********************************************************************
* evaluate_state
*
* Evaluate the segmentation that is represented by this state in the
* best first search. Add this state to the "states_seen" list.
**********************************************************************/
inT16 evaluate_state(CHUNKS_RECORD *chunks_record,
SEARCH_RECORD *the_search,
DANGERR *fixpt,
STATE *best_state,
inT32 pass) {
CHOICES_LIST char_choices;
inT16 Wordrec::evaluate_state(CHUNKS_RECORD *chunks_record,
SEARCH_RECORD *the_search,
DANGERR *fixpt) {
BLOB_CHOICE_LIST_VECTOR *char_choices;
SEARCH_STATE chunk_groups;
float rating_limit = class_probability (the_search->best_choice);
float rating_limit = the_search->best_choice->rating();
inT16 keep_going = TRUE;
PIECES_STATE widths;
the_search->num_states++;
chunk_groups = bin_to_chunks (the_search->this_state,
the_search->num_joints);
chunk_groups = bin_to_chunks(the_search->this_state,
the_search->num_joints);
bin_to_pieces (the_search->this_state, the_search->num_joints, widths);
LogNewSegmentation(widths);
getDict().LogNewSegmentation(widths);
rating_limit = class_probability (the_search->best_choice);
char_choices =
evaluate_chunks (chunks_record, chunk_groups, the_search->this_state,
best_state, pass);
if (char_choices != NULL) {
permute_characters (char_choices,
rating_limit,
the_search->best_choice, the_search->raw_choice);
if (AcceptableChoice (char_choices, the_search->best_choice,
the_search->raw_choice, fixpt))
char_choices = evaluate_chunks(chunks_record, chunk_groups);
wordseg_rating_adjust_factor = -1.0f;
if (char_choices != NULL && char_choices->length() > 0) {
// Compute the segmentation cost and include the cost in word rating.
// TODO(dsl): We should change the SEARCH_RECORD to store this cost
// from state evaluation and avoid recomputing it here.
prioritize_state(chunks_record, the_search);
wordseg_rating_adjust_factor = the_search->segcost_bias;
getDict().permute_characters(*char_choices, rating_limit,
the_search->best_choice,
the_search->raw_choice);
bool replaced = false;
if (getDict().AcceptableChoice(char_choices, the_search->best_choice,
*(the_search->raw_choice), fixpt,
ASSOCIATOR_CALLER, &replaced)) {
keep_going = FALSE;
array_free(char_choices);
}
}
wordseg_rating_adjust_factor = -1.0f;
#ifndef GRAPHICS_DISABLED
if (display_segmentations) {
if (wordrec_display_segmentations) {
display_segmentation (chunks_record->chunks, chunk_groups);
if (display_segmentations > 1)
if (wordrec_display_segmentations > 1)
window_wait(segm_window);
}
#endif
if (rating_limit != class_probability (the_search->best_choice)) {
if (rating_limit != the_search->best_choice->rating()) {
the_search->before_best = the_search->num_states;
the_search->best_state->part1 = the_search->this_state->part1;
the_search->best_state->part2 = the_search->this_state->part2;
@ -297,6 +335,7 @@ inT16 evaluate_state(CHUNKS_RECORD *chunks_record,
else if (char_choices != NULL)
fixpt->index = -1;
if (char_choices != NULL) delete char_choices;
memfree(chunk_groups);
return (keep_going);
@ -309,72 +348,196 @@ inT16 evaluate_state(CHUNKS_RECORD *chunks_record,
* Evaluate the segmentation that is represented by this state in the
* best first search. Add this state to the "states_seen" list.
**********************************************************************/
CHOICES_LIST rebuild_current_state(TBLOB *blobs,
SEAMS seam_list,
STATE *state,
CHOICES_LIST old_choices,
int fx) {
CHOICES_LIST char_choices;
SEARCH_STATE search_state;
int i;
int num_joints = array_count (seam_list);
int x = 0;
int blobindex; /*current blob */
TBLOB *p_blob;
TBLOB *blob;
TBLOB *next_blob;
int y;
BLOB_CHOICE_LIST_VECTOR *Wordrec::rebuild_current_state(
TBLOB *blobs,
SEAMS seam_list,
STATE *state,
BLOB_CHOICE_LIST_VECTOR *old_choices,
int fx,
bool force_rebuild,
const WERD_CHOICE &best_choice,
const MATRIX *ratings) {
// Initialize search_state, num_joints, x, y.
int num_joints = array_count(seam_list);
#ifndef GRAPHICS_DISABLED
if (display_segmentations) {
if (wordrec_display_segmentations) {
print_state("Rebuiling state", state, num_joints);
}
#endif
search_state = bin_to_chunks (state, num_joints);
char_choices = new_choice_list ();
/* Iterate sub-paths */
SEARCH_STATE search_state = bin_to_chunks(state, num_joints);
int x = 0;
int y;
int i;
for (i = 1; i <= search_state[0]; i++) {
y = x + search_state[i];
x = y + 1;
char_choices = array_push (char_choices, NULL);
}
char_choices = array_push (char_choices, NULL);
y = count_blobs (blobs) - 1;
for (i = search_state[0]; i >= 0; i--) {
if (x == y) { /*single fragment */
array_value (char_choices, i) = array_value (old_choices, x);
/*grab the list */
array_value (old_choices, x) = NULL;
}
else {
join_pieces(blobs, seam_list, x, y);
for (blob = blobs, blobindex = 0, p_blob = NULL; blobindex < x;
blobindex++) {
p_blob = blob;
blob = blob->next;
}
while (blobindex < y) {
next_blob = blob->next;
blob->next = next_blob->next;
oldblob(next_blob); /*junk dead blobs */
blobindex++;
}
array_value (char_choices, i) =
(char *) classify_blob (p_blob, blob, blob->next, NULL, fx,
"rebuild", Orange, NULL, NULL, 0, 0);
}
// Initialize char_choices, expanded_fragment_lengths:
// e.g. if fragment_lengths = {1 1 2 3 1},
// expanded_fragment_lengths_str = {1 1 2 2 3 3 3 1}.
BLOB_CHOICE_LIST_VECTOR *char_choices = new BLOB_CHOICE_LIST_VECTOR();
STRING expanded_fragment_lengths_str = "";
bool state_has_fragments = false;
const char *fragment_lengths = NULL;
if (best_choice.length() > 0) {
fragment_lengths = best_choice.fragment_lengths();
}
if (fragment_lengths) {
for (int i = 0; i < best_choice.length(); ++i) {
*char_choices += NULL;
if (fragment_lengths[i] > 1) {
state_has_fragments = true;
}
for (int j = 0; j < fragment_lengths[i]; ++j) {
expanded_fragment_lengths_str += fragment_lengths[i];
}
}
} else {
for (i = 0; i <= search_state[0]; ++i) {
expanded_fragment_lengths_str += (char)1;
*char_choices += NULL;
}
}
// Finish early if force_rebuld is false and there are no fragments to merge.
if (!force_rebuild && !state_has_fragments) {
delete char_choices;
memfree(search_state);
return old_choices;
}
// Set up variables for concatenating fragments.
const char *word_lengths_ptr = NULL;
const char *word_ptr = NULL;
if (state_has_fragments) {
// Make word_lengths_ptr point to the last element in
// best_choice->unichar_lengths().
word_lengths_ptr = best_choice.unichar_lengths().string();
word_lengths_ptr += (strlen(word_lengths_ptr)-1);
// Make word_str point to the beginning of the last
// unichar in best_choice->unichar_string().
word_ptr = best_choice.unichar_string().string();
word_ptr += (strlen(word_ptr)-*word_lengths_ptr);
}
const char *expanded_fragment_lengths =
expanded_fragment_lengths_str.string();
bool merging_fragment = false;
int true_y = -1;
char unichar[UNICHAR_LEN + 1];
int fragment_pieces = -1;
float rating = 0.0;
float certainty = -MAX_FLOAT32;
// Populate char_choices list such that it corresponds to search_state.
//
// If we are rebuilding a state that contains character fragments:
// -- combine blobs that belong to character fragments
// -- re-classify the blobs to obtain choices list for the merged blob
// -- ensure that correct classification appears in the new choices list
// NOTE: a choice composed form original fragment choices will be always
// added to the new choices list for each character composed from
// fragments (even if the choice for the corresponding character appears
// in the re-classified choices list of for the newly merged blob).
BLOB_CHOICE_IT temp_it;
int char_choices_index = char_choices->length() - 1;
for (i = search_state[0]; i >= 0; i--) {
BLOB_CHOICE_LIST *current_choices = join_blobs_and_classify(
blobs, seam_list, x, y, fx, ratings, old_choices);
// Combine character fragments.
if (expanded_fragment_lengths[i] > 1) {
// Start merging character fragments.
if (!merging_fragment) {
merging_fragment = true;
true_y = y;
fragment_pieces = expanded_fragment_lengths[i];
rating = 0.0;
certainty = -MAX_FLOAT32;
strncpy(unichar, word_ptr, *word_lengths_ptr);
unichar[*word_lengths_ptr] = '\0';
}
// Take into account the fact that we could have joined pieces
// since we first recorded the ending point of a fragment (true_y).
true_y -= y - x;
// Populate fragment with updated values and look for the
// fragment with the same values in current_choices.
// Update rating and certainty of the character being composed.
fragment_pieces--;
CHAR_FRAGMENT fragment;
fragment.set_all(unichar, fragment_pieces,
expanded_fragment_lengths[i]);
temp_it.set_to_list(current_choices);
for (temp_it.mark_cycle_pt(); !temp_it.cycled_list();
temp_it.forward()) {
const CHAR_FRAGMENT *current_fragment =
getDict().getUnicharset().get_fragment(temp_it.data()->unichar_id());
if (current_fragment && fragment.equals(current_fragment)) {
rating += temp_it.data()->rating();
if (temp_it.data()->certainty() > certainty) {
certainty = temp_it.data()->certainty();
}
break;
}
}
assert(!temp_it.cycled_list()); // make sure we found the fragment
// Free current_choices for the fragmented character.
delete current_choices;
// Finish composing character from fragments.
if (fragment_pieces == 0) {
// Populate current_choices with the classification of
// the blob merged from blobs of each character fragment.
current_choices = join_blobs_and_classify(blobs, seam_list, x,
true_y, fx, ratings, NULL);
BLOB_CHOICE *merged_choice =
new BLOB_CHOICE(getDict().getUnicharset().unichar_to_id(unichar),
rating, certainty, 0, NO_PERM);
// Insert merged_blob into current_choices, such that current_choices
// are still sorted in non-descending order by rating.
ASSERT_HOST(!current_choices->empty());
temp_it.set_to_list(current_choices);
for (temp_it.mark_cycle_pt();
!temp_it.cycled_list() &&
merged_choice->rating() > temp_it.data()->rating();
temp_it.forward());
temp_it.add_before_stay_put(merged_choice);
// Done merging this fragmented character.
merging_fragment = false;
}
}
if (!merging_fragment) {
// Get rid of fragments in current_choices.
temp_it.set_to_list(current_choices);
for (temp_it.mark_cycle_pt(); !temp_it.cycled_list();
temp_it.forward()) {
if (getDict().getUnicharset().get_fragment(
temp_it.data()->unichar_id())) {
delete temp_it.extract();
}
}
char_choices->set(current_choices, char_choices_index);
char_choices_index--;
// Update word_ptr and word_lengths_ptr.
if (word_lengths_ptr != NULL && word_ptr != NULL) {
word_lengths_ptr--;
word_ptr -= (*word_lengths_ptr);
}
}
y = x - 1;
x = y - search_state[i];
}
old_choices->delete_data_pointers();
delete old_choices;
memfree(search_state);
free_all_choices(old_choices, x);
return (char_choices);
return (char_choices);
}
} // namespace tesseract
/**********************************************************************
@ -384,21 +547,39 @@ CHOICES_LIST rebuild_current_state(TBLOB *blobs,
* each one has not already been visited. If not add it to the priority
* queue.
**********************************************************************/
void expand_node(FLOAT32 worst_priority,
CHUNKS_RECORD *chunks_record, SEARCH_RECORD *the_search) {
namespace tesseract {
void Wordrec::expand_node(FLOAT32 worst_priority,
CHUNKS_RECORD *chunks_record,
SEARCH_RECORD *the_search) {
STATE old_state;
int nodes_added = 0;
int x;
int mask = 1 << (the_search->num_joints - 1 - 32);
uinT32 mask = 1 << (the_search->num_joints - 1 - 32);
old_state.part1 = the_search->this_state->part1;
old_state.part2 = the_search->this_state->part2;
// We need to expand the search more intelligently, or we get stuck
// with a bad starting segmentation in a long word sequence as in CJK.
// Expand a child node only if it is within the global bound, and no
// worse than 2x of its parent.
// TODO(dsl): There is some redudency here in recomputing the priority,
// and in filtering of old_merit and worst_priority.
the_search->this_state->part2 = old_state.part2;
for (x = the_search->num_joints; x > 32; x--) {
the_search->this_state->part1 = mask ^ old_state.part1;
if (!hash_lookup (the_search->closed_states, the_search->this_state))
push_queue (the_search->open_states, the_search->this_state,
worst_priority,
prioritize_state (chunks_record, the_search, &old_state));
if (!hash_lookup (the_search->closed_states, the_search->this_state)) {
FLOAT32 new_merit = prioritize_state(chunks_record, the_search);
if (segment_debug && permute_debug) {
cprintf ("....checking state: %8.3f ", new_merit);
print_state ("", the_search->this_state, num_joints);
}
if (new_merit < worst_priority) {
push_queue (the_search->open_states, the_search->this_state,
worst_priority, new_merit);
nodes_added++;
}
}
mask >>= 1;
}
@ -409,15 +590,25 @@ void expand_node(FLOAT32 worst_priority,
mask = 1 << (the_search->num_joints - 1);
}
the_search->this_state->part1 = old_state.part1;
while (x--) {
the_search->this_state->part2 = mask ^ old_state.part2;
if (!hash_lookup (the_search->closed_states, the_search->this_state))
push_queue (the_search->open_states, the_search->this_state,
worst_priority,
prioritize_state (chunks_record, the_search, &old_state));
if (!hash_lookup (the_search->closed_states, the_search->this_state)) {
FLOAT32 new_merit = prioritize_state(chunks_record, the_search);
if (segment_debug && permute_debug) {
cprintf ("....checking state: %8.3f ", new_merit);
print_state ("", the_search->this_state, num_joints);
}
if (new_merit < worst_priority) {
push_queue(the_search->open_states, the_search->this_state,
worst_priority, new_merit);
nodes_added++;
}
}
mask >>= 1;
}
}
} // namespace tesseract
/**********************************************************************
@ -427,14 +618,14 @@ void expand_node(FLOAT32 worst_priority,
**********************************************************************/
SEARCH_RECORD *new_search(CHUNKS_RECORD *chunks_record,
int num_joints,
A_CHOICE *best_choice,
A_CHOICE *raw_choice,
WERD_CHOICE *best_choice,
WERD_CHOICE *raw_choice,
STATE *state) {
SEARCH_RECORD *this_search;
this_search = (SEARCH_RECORD *) memalloc (sizeof (SEARCH_RECORD));
this_search->open_states = MakeHeap (num_seg_states * 20);
this_search->open_states = MakeHeap (wordrec_num_seg_states * 20);
this_search->closed_states = new_hash_table ();
if (state)
@ -451,6 +642,7 @@ SEARCH_RECORD *new_search(CHUNKS_RECORD *chunks_record,
this_search->num_joints = num_joints;
this_search->num_states = 0;
this_search->before_best = 0;
this_search->segcost_bias = 0;
return (this_search);
}
@ -467,7 +659,7 @@ STATE *pop_queue(HEAP *queue) {
if (GetTopOfHeap (queue, &entry) == OK) {
#ifndef GRAPHICS_DISABLED
if (display_segmentations) {
if (wordrec_display_segmentations) {
cprintf ("eval state: %8.3f ", entry.Key);
print_state ("", (STATE *) entry.Data, num_joints);
}
@ -489,7 +681,13 @@ void push_queue(HEAP *queue, STATE *state, FLOAT32 worst_priority,
FLOAT32 priority) {
HEAPENTRY entry;
if (SizeOfHeap (queue) < MaxSizeOfHeap (queue) && priority < worst_priority) {
if (priority < worst_priority) {
if (SizeOfHeap (queue) >= MaxSizeOfHeap(queue)) {
if (segment_debug) tprintf("Heap is Full\n");
return;
}
if (segment_debug)
tprintf("\tpushing %d node %f\n", num_pushed, priority);
entry.Data = (char *) new_state (state);
num_pushed++;
entry.Key = priority;
@ -524,3 +722,53 @@ void replace_char_widths(CHUNKS_RECORD *chunks_record, SEARCH_STATE state) {
}
chunks_record->char_widths = width_record;
}
namespace tesseract {
BLOB_CHOICE_LIST *Wordrec::join_blobs_and_classify(
TBLOB *blobs, SEAMS seam_list,
int x, int y, int fx, const MATRIX *ratings,
BLOB_CHOICE_LIST_VECTOR *old_choices) {
BLOB_CHOICE_LIST *choices = NULL;
// First check to see if we can look up the classificaiton
// in old_choices (if there is no need to merge blobs).
if (x == y && old_choices != NULL && ratings == NULL) {
choices = old_choices->get(x);
old_choices->set(NULL, x);
return choices;
}
// The ratings matrix filled in by the associator will contain the most
// up-to-date classification info. Thus we look up the classification there
// first, and only call classify_blob() if the classification is not found.
if (ratings != NULL) {
BLOB_CHOICE_LIST *choices_ptr = ratings->get(x, y);
if (choices_ptr != NOT_CLASSIFIED) {
choices = new BLOB_CHOICE_LIST();
choices->deep_copy(choices_ptr, &BLOB_CHOICE::deep_copy);
}
}
if (x != y) {
join_pieces(blobs, seam_list, x, y);
int blobindex; // current blob
TBLOB *p_blob;
TBLOB *blob;
TBLOB *next_blob;
for (blob = blobs, blobindex = 0, p_blob = NULL;
blobindex < x; blobindex++) {
p_blob = blob;
blob = blob->next;
}
while (blobindex < y) {
next_blob = blob->next;
blob->next = next_blob->next;
oldblob(next_blob); // junk dead blobs
blobindex++;
}
if (choices == NULL) {
choices = classify_blob(p_blob, blob, blob->next,
NULL, "rebuild", Orange);
}
}
return choices;
}
} // namespace tesseract

View File

@ -34,8 +34,9 @@
#include "wordclass.h"
#include "intmatcher.h"
#include "freelist.h"
#include "djmenus.h"
#include "callcpp.h"
#include "ndminx.h"
#include "wordrec.h"
/*----------------------------------------------------------------------
V a r i a b l e s
@ -114,7 +115,7 @@ void init_metrics() {
end_metrics();
states_before_best = new_tally (min (100, num_seg_states));
states_before_best = new_tally (MIN (100, wordrec_num_seg_states));
best_certainties[0] = new_tally (CERTAINTY_BUCKETS);
best_certainties[1] = new_tally (CERTAINTY_BUCKETS);
@ -164,13 +165,13 @@ void record_search_status(int num_states, int before_best, float closeness) {
inc_tally_bucket(states_before_best, before_best);
if (first_pass) {
if (num_states == num_seg_states + 1)
if (num_states == wordrec_num_seg_states + 1)
states_timed_out1++;
segmentation_states1 += num_states;
words_segmented1++;
}
else {
if (num_states == num_seg_states + 1)
if (num_states == wordrec_num_seg_states + 1)
states_timed_out2++;
segmentation_states2 += num_states;
words_segmented2++;
@ -183,16 +184,16 @@ void record_search_status(int num_states, int before_best, float closeness) {
*
* Save the summary information into the file "file.sta".
**********************************************************************/
void save_summary(inT32 elapsed_time) {
namespace tesseract {
void Wordrec::save_summary(inT32 elapsed_time) {
#ifndef SECURE_NAMES
char outfilename[CHARS_PER_LINE];
STRING outfilename;
FILE *f;
int x;
int total;
strcpy(outfilename, imagefile);
strcat (outfilename, ".sta");
f = open_file (outfilename, "w");
outfilename = imagefile + ".sta";
f = open_file (outfilename.string(), "w");
fprintf (f, INT32FORMAT " seconds elapsed\n", elapsed_time);
fprintf (f, "\n");
@ -254,6 +255,7 @@ void save_summary(inT32 elapsed_time) {
fclose(f);
#endif
}
} // namespace tesseract
/**********************************************************************
@ -264,7 +266,6 @@ void save_summary(inT32 elapsed_time) {
* doing clustering.
**********************************************************************/
void record_priorities(SEARCH_RECORD *the_search,
STATE *old_state,
FLOAT32 priority_1,
FLOAT32 priority_2) {
record_samples(priority_1, priority_2);
@ -308,7 +309,7 @@ void save_best_state(CHUNKS_RECORD *chunks_record) {
int num_joints;
if (save_priorities) {
num_joints = matrix_dimension (chunks_record->ratings) - 1;
num_joints = chunks_record->ratings->dimension() - 1;
state.part1 = 0xffffffff;
state.part2 = 0xffffffff;

BIN
zlib1.dll Executable file

Binary file not shown.