tesseract_bin 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/Gemfile +14 -0
- data/Gemfile.lock +23 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +19 -0
- data/Rakefile +46 -0
- data/VERSION +1 -0
- data/ext/tesseract_bin/extconf.rb +17 -0
- data/lib/tesseract_bin.rb +12 -0
- data/tesseract_bin.gemspec +660 -0
- data/test/helper.rb +18 -0
- data/test/test_tesseract_bin.rb +7 -0
- data/vendor/tesseract-2.04/AUTHORS +8 -0
- data/vendor/tesseract-2.04/COPYING +23 -0
- data/vendor/tesseract-2.04/ChangeLog +71 -0
- data/vendor/tesseract-2.04/INSTALL +229 -0
- data/vendor/tesseract-2.04/Makefile.am +20 -0
- data/vendor/tesseract-2.04/Makefile.in +641 -0
- data/vendor/tesseract-2.04/NEWS +1 -0
- data/vendor/tesseract-2.04/README +138 -0
- data/vendor/tesseract-2.04/ReleaseNotes +213 -0
- data/vendor/tesseract-2.04/StdAfx.cpp +8 -0
- data/vendor/tesseract-2.04/StdAfx.h +24 -0
- data/vendor/tesseract-2.04/ccmain/Makefile.am +63 -0
- data/vendor/tesseract-2.04/ccmain/Makefile.in +735 -0
- data/vendor/tesseract-2.04/ccmain/adaptions.cpp +1082 -0
- data/vendor/tesseract-2.04/ccmain/adaptions.h +109 -0
- data/vendor/tesseract-2.04/ccmain/applybox.cpp +891 -0
- data/vendor/tesseract-2.04/ccmain/applybox.h +73 -0
- data/vendor/tesseract-2.04/ccmain/baseapi.cpp +1105 -0
- data/vendor/tesseract-2.04/ccmain/baseapi.h +256 -0
- data/vendor/tesseract-2.04/ccmain/blobcmp.cpp +76 -0
- data/vendor/tesseract-2.04/ccmain/blobcmp.h +29 -0
- data/vendor/tesseract-2.04/ccmain/callnet.cpp +93 -0
- data/vendor/tesseract-2.04/ccmain/callnet.h +32 -0
- data/vendor/tesseract-2.04/ccmain/charcut.cpp +704 -0
- data/vendor/tesseract-2.04/ccmain/charcut.h +120 -0
- data/vendor/tesseract-2.04/ccmain/charsample.cpp +699 -0
- data/vendor/tesseract-2.04/ccmain/control.cpp +1842 -0
- data/vendor/tesseract-2.04/ccmain/control.h +198 -0
- data/vendor/tesseract-2.04/ccmain/docqual.cpp +1481 -0
- data/vendor/tesseract-2.04/ccmain/docqual.h +155 -0
- data/vendor/tesseract-2.04/ccmain/expandblob.cpp +82 -0
- data/vendor/tesseract-2.04/ccmain/expandblob.h +13 -0
- data/vendor/tesseract-2.04/ccmain/fixspace.cpp +989 -0
- data/vendor/tesseract-2.04/ccmain/fixspace.h +72 -0
- data/vendor/tesseract-2.04/ccmain/fixxht.cpp +825 -0
- data/vendor/tesseract-2.04/ccmain/fixxht.h +93 -0
- data/vendor/tesseract-2.04/ccmain/imgscale.cpp +154 -0
- data/vendor/tesseract-2.04/ccmain/imgscale.h +32 -0
- data/vendor/tesseract-2.04/ccmain/matmatch.cpp +391 -0
- data/vendor/tesseract-2.04/ccmain/matmatch.h +48 -0
- data/vendor/tesseract-2.04/ccmain/output.cpp +1273 -0
- data/vendor/tesseract-2.04/ccmain/output.h +116 -0
- data/vendor/tesseract-2.04/ccmain/pagewalk.cpp +666 -0
- data/vendor/tesseract-2.04/ccmain/pagewalk.h +155 -0
- data/vendor/tesseract-2.04/ccmain/paircmp.cpp +107 -0
- data/vendor/tesseract-2.04/ccmain/paircmp.h +43 -0
- data/vendor/tesseract-2.04/ccmain/pgedit.cpp +1867 -0
- data/vendor/tesseract-2.04/ccmain/pgedit.h +181 -0
- data/vendor/tesseract-2.04/ccmain/reject.cpp +1775 -0
- data/vendor/tesseract-2.04/ccmain/reject.h +181 -0
- data/vendor/tesseract-2.04/ccmain/scaleimg.cpp +366 -0
- data/vendor/tesseract-2.04/ccmain/scaleimg.h +35 -0
- data/vendor/tesseract-2.04/ccmain/tessbox.cpp +375 -0
- data/vendor/tesseract-2.04/ccmain/tessbox.h +110 -0
- data/vendor/tesseract-2.04/ccmain/tessedit.cpp +278 -0
- data/vendor/tesseract-2.04/ccmain/tessedit.h +49 -0
- data/vendor/tesseract-2.04/ccmain/tessembedded.cpp +110 -0
- data/vendor/tesseract-2.04/ccmain/tessembedded.h +38 -0
- data/vendor/tesseract-2.04/ccmain/tesseractfull.cc +37 -0
- data/vendor/tesseract-2.04/ccmain/tesseractmain.cpp +387 -0
- data/vendor/tesseract-2.04/ccmain/tesseractmain.h +58 -0
- data/vendor/tesseract-2.04/ccmain/tessio.h +110 -0
- data/vendor/tesseract-2.04/ccmain/tessvars.cpp +38 -0
- data/vendor/tesseract-2.04/ccmain/tessvars.h +48 -0
- data/vendor/tesseract-2.04/ccmain/tfacep.h +62 -0
- data/vendor/tesseract-2.04/ccmain/tfacepp.cpp +443 -0
- data/vendor/tesseract-2.04/ccmain/tfacepp.h +85 -0
- data/vendor/tesseract-2.04/ccmain/tstruct.cpp +549 -0
- data/vendor/tesseract-2.04/ccmain/tstruct.h +108 -0
- data/vendor/tesseract-2.04/ccmain/varabled.cpp +346 -0
- data/vendor/tesseract-2.04/ccmain/varabled.h +125 -0
- data/vendor/tesseract-2.04/ccmain/werdit.cpp +193 -0
- data/vendor/tesseract-2.04/ccmain/werdit.h +67 -0
- data/vendor/tesseract-2.04/ccstruct/Makefile.am +25 -0
- data/vendor/tesseract-2.04/ccstruct/Makefile.in +650 -0
- data/vendor/tesseract-2.04/ccstruct/blckerr.h +29 -0
- data/vendor/tesseract-2.04/ccstruct/blobbox.cpp +778 -0
- data/vendor/tesseract-2.04/ccstruct/blobbox.h +381 -0
- data/vendor/tesseract-2.04/ccstruct/blobs.cpp +247 -0
- data/vendor/tesseract-2.04/ccstruct/blobs.h +119 -0
- data/vendor/tesseract-2.04/ccstruct/blread.cpp +537 -0
- data/vendor/tesseract-2.04/ccstruct/blread.h +63 -0
- data/vendor/tesseract-2.04/ccstruct/callcpp.cpp +252 -0
- data/vendor/tesseract-2.04/ccstruct/coutln.cpp +650 -0
- data/vendor/tesseract-2.04/ccstruct/coutln.h +186 -0
- data/vendor/tesseract-2.04/ccstruct/crakedge.h +39 -0
- data/vendor/tesseract-2.04/ccstruct/genblob.cpp +133 -0
- data/vendor/tesseract-2.04/ccstruct/genblob.h +52 -0
- data/vendor/tesseract-2.04/ccstruct/hpddef.h +39 -0
- data/vendor/tesseract-2.04/ccstruct/hpdsizes.h +8 -0
- data/vendor/tesseract-2.04/ccstruct/ipoints.h +479 -0
- data/vendor/tesseract-2.04/ccstruct/labls.cpp +188 -0
- data/vendor/tesseract-2.04/ccstruct/labls.h +38 -0
- data/vendor/tesseract-2.04/ccstruct/linlsq.cpp +249 -0
- data/vendor/tesseract-2.04/ccstruct/linlsq.h +102 -0
- data/vendor/tesseract-2.04/ccstruct/lmedsq.cpp +453 -0
- data/vendor/tesseract-2.04/ccstruct/lmedsq.h +84 -0
- data/vendor/tesseract-2.04/ccstruct/mod128.cpp +100 -0
- data/vendor/tesseract-2.04/ccstruct/mod128.h +85 -0
- data/vendor/tesseract-2.04/ccstruct/normalis.cpp +176 -0
- data/vendor/tesseract-2.04/ccstruct/normalis.h +108 -0
- data/vendor/tesseract-2.04/ccstruct/ocrblock.cpp +369 -0
- data/vendor/tesseract-2.04/ccstruct/ocrblock.h +235 -0
- data/vendor/tesseract-2.04/ccstruct/ocrrow.cpp +216 -0
- data/vendor/tesseract-2.04/ccstruct/ocrrow.h +133 -0
- data/vendor/tesseract-2.04/ccstruct/pageblk.cpp +879 -0
- data/vendor/tesseract-2.04/ccstruct/pageblk.h +318 -0
- data/vendor/tesseract-2.04/ccstruct/pageres.cpp +330 -0
- data/vendor/tesseract-2.04/ccstruct/pageres.h +313 -0
- data/vendor/tesseract-2.04/ccstruct/pdblock.cpp +361 -0
- data/vendor/tesseract-2.04/ccstruct/pdblock.h +181 -0
- data/vendor/tesseract-2.04/ccstruct/pdclass.h +54 -0
- data/vendor/tesseract-2.04/ccstruct/points.cpp +102 -0
- data/vendor/tesseract-2.04/ccstruct/points.h +299 -0
- data/vendor/tesseract-2.04/ccstruct/polyaprx.cpp +588 -0
- data/vendor/tesseract-2.04/ccstruct/polyaprx.h +51 -0
- data/vendor/tesseract-2.04/ccstruct/polyblk.cpp +398 -0
- data/vendor/tesseract-2.04/ccstruct/polyblk.h +122 -0
- data/vendor/tesseract-2.04/ccstruct/polyblob.cpp +357 -0
- data/vendor/tesseract-2.04/ccstruct/polyblob.h +102 -0
- data/vendor/tesseract-2.04/ccstruct/polyvert.cpp +23 -0
- data/vendor/tesseract-2.04/ccstruct/polyvert.h +58 -0
- data/vendor/tesseract-2.04/ccstruct/poutline.cpp +441 -0
- data/vendor/tesseract-2.04/ccstruct/poutline.h +125 -0
- data/vendor/tesseract-2.04/ccstruct/quadlsq.cpp +147 -0
- data/vendor/tesseract-2.04/ccstruct/quadlsq.h +67 -0
- data/vendor/tesseract-2.04/ccstruct/quadratc.cpp +21 -0
- data/vendor/tesseract-2.04/ccstruct/quadratc.h +63 -0
- data/vendor/tesseract-2.04/ccstruct/quspline.cpp +382 -0
- data/vendor/tesseract-2.04/ccstruct/quspline.h +113 -0
- data/vendor/tesseract-2.04/ccstruct/ratngs.cpp +372 -0
- data/vendor/tesseract-2.04/ccstruct/ratngs.h +198 -0
- data/vendor/tesseract-2.04/ccstruct/rect.cpp +229 -0
- data/vendor/tesseract-2.04/ccstruct/rect.h +320 -0
- data/vendor/tesseract-2.04/ccstruct/rejctmap.cpp +545 -0
- data/vendor/tesseract-2.04/ccstruct/rejctmap.h +284 -0
- data/vendor/tesseract-2.04/ccstruct/rwpoly.cpp +89 -0
- data/vendor/tesseract-2.04/ccstruct/rwpoly.h +45 -0
- data/vendor/tesseract-2.04/ccstruct/statistc.cpp +905 -0
- data/vendor/tesseract-2.04/ccstruct/statistc.h +135 -0
- data/vendor/tesseract-2.04/ccstruct/stepblob.cpp +296 -0
- data/vendor/tesseract-2.04/ccstruct/stepblob.h +88 -0
- data/vendor/tesseract-2.04/ccstruct/txtregn.cpp +230 -0
- data/vendor/tesseract-2.04/ccstruct/txtregn.h +155 -0
- data/vendor/tesseract-2.04/ccstruct/vecfuncs.cpp +63 -0
- data/vendor/tesseract-2.04/ccstruct/vecfuncs.h +91 -0
- data/vendor/tesseract-2.04/ccstruct/werd.cpp +967 -0
- data/vendor/tesseract-2.04/ccstruct/werd.h +277 -0
- data/vendor/tesseract-2.04/ccutil/Makefile.am +19 -0
- data/vendor/tesseract-2.04/ccutil/Makefile.in +626 -0
- data/vendor/tesseract-2.04/ccutil/basedir.cpp +118 -0
- data/vendor/tesseract-2.04/ccutil/basedir.h +32 -0
- data/vendor/tesseract-2.04/ccutil/bits16.cpp +30 -0
- data/vendor/tesseract-2.04/ccutil/bits16.h +61 -0
- data/vendor/tesseract-2.04/ccutil/boxread.cpp +105 -0
- data/vendor/tesseract-2.04/ccutil/boxread.h +44 -0
- data/vendor/tesseract-2.04/ccutil/clst.cpp +626 -0
- data/vendor/tesseract-2.04/ccutil/clst.h +1085 -0
- data/vendor/tesseract-2.04/ccutil/debugwin.cpp +500 -0
- data/vendor/tesseract-2.04/ccutil/debugwin.h +103 -0
- data/vendor/tesseract-2.04/ccutil/elst.cpp +593 -0
- data/vendor/tesseract-2.04/ccutil/elst.h +1125 -0
- data/vendor/tesseract-2.04/ccutil/elst2.cpp +606 -0
- data/vendor/tesseract-2.04/ccutil/elst2.h +1121 -0
- data/vendor/tesseract-2.04/ccutil/errcode.cpp +104 -0
- data/vendor/tesseract-2.04/ccutil/errcode.h +104 -0
- data/vendor/tesseract-2.04/ccutil/fileerr.h +34 -0
- data/vendor/tesseract-2.04/ccutil/globaloc.cpp +115 -0
- data/vendor/tesseract-2.04/ccutil/globaloc.h +40 -0
- data/vendor/tesseract-2.04/ccutil/hashfn.cpp +57 -0
- data/vendor/tesseract-2.04/ccutil/hashfn.h +30 -0
- data/vendor/tesseract-2.04/ccutil/host.h +180 -0
- data/vendor/tesseract-2.04/ccutil/hosthplb.h +1 -0
- data/vendor/tesseract-2.04/ccutil/lsterr.h +43 -0
- data/vendor/tesseract-2.04/ccutil/mainblk.cpp +126 -0
- data/vendor/tesseract-2.04/ccutil/mainblk.h +39 -0
- data/vendor/tesseract-2.04/ccutil/memblk.cpp +1106 -0
- data/vendor/tesseract-2.04/ccutil/memblk.h +189 -0
- data/vendor/tesseract-2.04/ccutil/memry.cpp +532 -0
- data/vendor/tesseract-2.04/ccutil/memry.h +192 -0
- data/vendor/tesseract-2.04/ccutil/memryerr.h +38 -0
- data/vendor/tesseract-2.04/ccutil/mfcpch.cpp +5 -0
- data/vendor/tesseract-2.04/ccutil/mfcpch.h +37 -0
- data/vendor/tesseract-2.04/ccutil/ndminx.h +31 -0
- data/vendor/tesseract-2.04/ccutil/notdll.h +28 -0
- data/vendor/tesseract-2.04/ccutil/nwmain.h +176 -0
- data/vendor/tesseract-2.04/ccutil/ocrclass.h +345 -0
- data/vendor/tesseract-2.04/ccutil/ocrshell.cpp +772 -0
- data/vendor/tesseract-2.04/ccutil/ocrshell.h +191 -0
- data/vendor/tesseract-2.04/ccutil/platform.h +18 -0
- data/vendor/tesseract-2.04/ccutil/scanutils.cpp +543 -0
- data/vendor/tesseract-2.04/ccutil/scanutils.h +55 -0
- data/vendor/tesseract-2.04/ccutil/secname.h +9 -0
- data/vendor/tesseract-2.04/ccutil/serialis.cpp +117 -0
- data/vendor/tesseract-2.04/ccutil/serialis.h +93 -0
- data/vendor/tesseract-2.04/ccutil/stderr.h +26 -0
- data/vendor/tesseract-2.04/ccutil/strngs.cpp +495 -0
- data/vendor/tesseract-2.04/ccutil/strngs.h +138 -0
- data/vendor/tesseract-2.04/ccutil/tessclas.h +135 -0
- data/vendor/tesseract-2.04/ccutil/tessopt.cpp +61 -0
- data/vendor/tesseract-2.04/ccutil/tessopt.h +30 -0
- data/vendor/tesseract-2.04/ccutil/tprintf.cpp +122 -0
- data/vendor/tesseract-2.04/ccutil/tprintf.h +35 -0
- data/vendor/tesseract-2.04/ccutil/unichar.cpp +144 -0
- data/vendor/tesseract-2.04/ccutil/unichar.h +84 -0
- data/vendor/tesseract-2.04/ccutil/unicharmap.cpp +172 -0
- data/vendor/tesseract-2.04/ccutil/unicharmap.h +82 -0
- data/vendor/tesseract-2.04/ccutil/unicharset.cpp +307 -0
- data/vendor/tesseract-2.04/ccutil/unicharset.h +267 -0
- data/vendor/tesseract-2.04/ccutil/varable.cpp +672 -0
- data/vendor/tesseract-2.04/ccutil/varable.h +419 -0
- data/vendor/tesseract-2.04/classify/Makefile.am +24 -0
- data/vendor/tesseract-2.04/classify/Makefile.in +647 -0
- data/vendor/tesseract-2.04/classify/adaptive.cpp +535 -0
- data/vendor/tesseract-2.04/classify/adaptive.h +199 -0
- data/vendor/tesseract-2.04/classify/adaptmatch.cpp +2958 -0
- data/vendor/tesseract-2.04/classify/adaptmatch.h +86 -0
- data/vendor/tesseract-2.04/classify/baseline.cpp +58 -0
- data/vendor/tesseract-2.04/classify/baseline.h +91 -0
- data/vendor/tesseract-2.04/classify/blobclass.cpp +123 -0
- data/vendor/tesseract-2.04/classify/blobclass.h +49 -0
- data/vendor/tesseract-2.04/classify/chartoname.cpp +74 -0
- data/vendor/tesseract-2.04/classify/chartoname.h +21 -0
- data/vendor/tesseract-2.04/classify/cluster.cpp +2834 -0
- data/vendor/tesseract-2.04/classify/cluster.h +158 -0
- data/vendor/tesseract-2.04/classify/clusttool.cpp +507 -0
- data/vendor/tesseract-2.04/classify/clusttool.h +70 -0
- data/vendor/tesseract-2.04/classify/cutoffs.cpp +73 -0
- data/vendor/tesseract-2.04/classify/cutoffs.h +49 -0
- data/vendor/tesseract-2.04/classify/extern.h +32 -0
- data/vendor/tesseract-2.04/classify/extract.cpp +100 -0
- data/vendor/tesseract-2.04/classify/extract.h +36 -0
- data/vendor/tesseract-2.04/classify/featdefs.cpp +244 -0
- data/vendor/tesseract-2.04/classify/featdefs.h +71 -0
- data/vendor/tesseract-2.04/classify/flexfx.cpp +87 -0
- data/vendor/tesseract-2.04/classify/flexfx.h +34 -0
- data/vendor/tesseract-2.04/classify/float2int.cpp +126 -0
- data/vendor/tesseract-2.04/classify/float2int.h +65 -0
- data/vendor/tesseract-2.04/classify/fpoint.cpp +73 -0
- data/vendor/tesseract-2.04/classify/fpoint.h +63 -0
- data/vendor/tesseract-2.04/classify/fxdefs.cpp +74 -0
- data/vendor/tesseract-2.04/classify/fxdefs.h +93 -0
- data/vendor/tesseract-2.04/classify/fxid.h +69 -0
- data/vendor/tesseract-2.04/classify/hideedge.cpp +35 -0
- data/vendor/tesseract-2.04/classify/hideedge.h +76 -0
- data/vendor/tesseract-2.04/classify/intfx.cpp +608 -0
- data/vendor/tesseract-2.04/classify/intfx.h +63 -0
- data/vendor/tesseract-2.04/classify/intmatcher.cpp +1524 -0
- data/vendor/tesseract-2.04/classify/intmatcher.h +199 -0
- data/vendor/tesseract-2.04/classify/intproto.cpp +1823 -0
- data/vendor/tesseract-2.04/classify/intproto.h +320 -0
- data/vendor/tesseract-2.04/classify/kdtree.cpp +884 -0
- data/vendor/tesseract-2.04/classify/kdtree.h +118 -0
- data/vendor/tesseract-2.04/classify/mf.cpp +106 -0
- data/vendor/tesseract-2.04/classify/mf.h +43 -0
- data/vendor/tesseract-2.04/classify/mfdefs.cpp +58 -0
- data/vendor/tesseract-2.04/classify/mfdefs.h +60 -0
- data/vendor/tesseract-2.04/classify/mfoutline.cpp +1087 -0
- data/vendor/tesseract-2.04/classify/mfoutline.h +277 -0
- data/vendor/tesseract-2.04/classify/mfx.cpp +436 -0
- data/vendor/tesseract-2.04/classify/mfx.h +52 -0
- data/vendor/tesseract-2.04/classify/normfeat.cpp +132 -0
- data/vendor/tesseract-2.04/classify/normfeat.h +63 -0
- data/vendor/tesseract-2.04/classify/normmatch.cpp +305 -0
- data/vendor/tesseract-2.04/classify/normmatch.h +38 -0
- data/vendor/tesseract-2.04/classify/ocrfeatures.cpp +310 -0
- data/vendor/tesseract-2.04/classify/ocrfeatures.h +148 -0
- data/vendor/tesseract-2.04/classify/outfeat.cpp +262 -0
- data/vendor/tesseract-2.04/classify/outfeat.h +76 -0
- data/vendor/tesseract-2.04/classify/picofeat.cpp +297 -0
- data/vendor/tesseract-2.04/classify/picofeat.h +65 -0
- data/vendor/tesseract-2.04/classify/protos.cpp +472 -0
- data/vendor/tesseract-2.04/classify/protos.h +258 -0
- data/vendor/tesseract-2.04/classify/sigmenu.cpp +225 -0
- data/vendor/tesseract-2.04/classify/sigmenu.h +39 -0
- data/vendor/tesseract-2.04/classify/speckle.cpp +127 -0
- data/vendor/tesseract-2.04/classify/speckle.h +69 -0
- data/vendor/tesseract-2.04/classify/xform2d.cpp +120 -0
- data/vendor/tesseract-2.04/classify/xform2d.h +60 -0
- data/vendor/tesseract-2.04/config/config.guess +1466 -0
- data/vendor/tesseract-2.04/config/config.h.in +188 -0
- data/vendor/tesseract-2.04/config/config.sub +1579 -0
- data/vendor/tesseract-2.04/config/depcomp +530 -0
- data/vendor/tesseract-2.04/config/install-sh +269 -0
- data/vendor/tesseract-2.04/config/missing +198 -0
- data/vendor/tesseract-2.04/config/mkinstalldirs +40 -0
- data/vendor/tesseract-2.04/config/stamp-h.in +0 -0
- data/vendor/tesseract-2.04/configure +10424 -0
- data/vendor/tesseract-2.04/cutil/Makefile.am +14 -0
- data/vendor/tesseract-2.04/cutil/Makefile.in +612 -0
- data/vendor/tesseract-2.04/cutil/bitvec.cpp +115 -0
- data/vendor/tesseract-2.04/cutil/bitvec.h +100 -0
- data/vendor/tesseract-2.04/cutil/callcpp.h +190 -0
- data/vendor/tesseract-2.04/cutil/const.h +108 -0
- data/vendor/tesseract-2.04/cutil/cutil.cpp +92 -0
- data/vendor/tesseract-2.04/cutil/cutil.h +159 -0
- data/vendor/tesseract-2.04/cutil/danerror.cpp +144 -0
- data/vendor/tesseract-2.04/cutil/danerror.h +41 -0
- data/vendor/tesseract-2.04/cutil/debug.cpp +97 -0
- data/vendor/tesseract-2.04/cutil/debug.h +348 -0
- data/vendor/tesseract-2.04/cutil/efio.cpp +62 -0
- data/vendor/tesseract-2.04/cutil/efio.h +32 -0
- data/vendor/tesseract-2.04/cutil/emalloc.cpp +91 -0
- data/vendor/tesseract-2.04/cutil/emalloc.h +44 -0
- data/vendor/tesseract-2.04/cutil/freelist.cpp +75 -0
- data/vendor/tesseract-2.04/cutil/freelist.h +45 -0
- data/vendor/tesseract-2.04/cutil/funcdefs.h +35 -0
- data/vendor/tesseract-2.04/cutil/general.h +33 -0
- data/vendor/tesseract-2.04/cutil/globals.cpp +69 -0
- data/vendor/tesseract-2.04/cutil/globals.h +70 -0
- data/vendor/tesseract-2.04/cutil/listio.cpp +68 -0
- data/vendor/tesseract-2.04/cutil/listio.h +43 -0
- data/vendor/tesseract-2.04/cutil/minmax.h +40 -0
- data/vendor/tesseract-2.04/cutil/oldheap.cpp +337 -0
- data/vendor/tesseract-2.04/cutil/oldheap.h +126 -0
- data/vendor/tesseract-2.04/cutil/oldlist.cpp +393 -0
- data/vendor/tesseract-2.04/cutil/oldlist.h +350 -0
- data/vendor/tesseract-2.04/cutil/structures.cpp +66 -0
- data/vendor/tesseract-2.04/cutil/structures.h +112 -0
- data/vendor/tesseract-2.04/cutil/tessarray.cpp +115 -0
- data/vendor/tesseract-2.04/cutil/tessarray.h +166 -0
- data/vendor/tesseract-2.04/cutil/tordvars.cpp +95 -0
- data/vendor/tesseract-2.04/cutil/tordvars.h +61 -0
- data/vendor/tesseract-2.04/cutil/variables.cpp +317 -0
- data/vendor/tesseract-2.04/cutil/variables.h +170 -0
- data/vendor/tesseract-2.04/dict/Makefile.am +13 -0
- data/vendor/tesseract-2.04/dict/Makefile.in +609 -0
- data/vendor/tesseract-2.04/dict/choicearr.h +96 -0
- data/vendor/tesseract-2.04/dict/choices.cpp +210 -0
- data/vendor/tesseract-2.04/dict/choices.h +241 -0
- data/vendor/tesseract-2.04/dict/context.cpp +270 -0
- data/vendor/tesseract-2.04/dict/context.h +82 -0
- data/vendor/tesseract-2.04/dict/dawg.cpp +363 -0
- data/vendor/tesseract-2.04/dict/dawg.h +394 -0
- data/vendor/tesseract-2.04/dict/hyphen.cpp +84 -0
- data/vendor/tesseract-2.04/dict/hyphen.h +125 -0
- data/vendor/tesseract-2.04/dict/lookdawg.cpp +228 -0
- data/vendor/tesseract-2.04/dict/lookdawg.h +76 -0
- data/vendor/tesseract-2.04/dict/makedawg.cpp +449 -0
- data/vendor/tesseract-2.04/dict/makedawg.h +83 -0
- data/vendor/tesseract-2.04/dict/matchdefs.h +145 -0
- data/vendor/tesseract-2.04/dict/permdawg.cpp +415 -0
- data/vendor/tesseract-2.04/dict/permdawg.h +98 -0
- data/vendor/tesseract-2.04/dict/permngram.cpp +358 -0
- data/vendor/tesseract-2.04/dict/permngram.h +33 -0
- data/vendor/tesseract-2.04/dict/permnum.cpp +522 -0
- data/vendor/tesseract-2.04/dict/permnum.h +83 -0
- data/vendor/tesseract-2.04/dict/permute.cpp +1704 -0
- data/vendor/tesseract-2.04/dict/permute.h +93 -0
- data/vendor/tesseract-2.04/dict/reduce.cpp +424 -0
- data/vendor/tesseract-2.04/dict/reduce.h +112 -0
- data/vendor/tesseract-2.04/dict/states.cpp +382 -0
- data/vendor/tesseract-2.04/dict/states.h +111 -0
- data/vendor/tesseract-2.04/dict/stopper.cpp +1458 -0
- data/vendor/tesseract-2.04/dict/stopper.h +103 -0
- data/vendor/tesseract-2.04/dict/trie.cpp +683 -0
- data/vendor/tesseract-2.04/dict/trie.h +190 -0
- data/vendor/tesseract-2.04/dlltest/Makefile.am +2 -0
- data/vendor/tesseract-2.04/dlltest/Makefile.in +388 -0
- data/vendor/tesseract-2.04/dlltest/dlltest.cpp +163 -0
- data/vendor/tesseract-2.04/dlltest/dlltest.dsp +186 -0
- data/vendor/tesseract-2.04/dlltest/dlltest.vcproj +637 -0
- data/vendor/tesseract-2.04/eurotext.tif +0 -0
- data/vendor/tesseract-2.04/image/Makefile.am +10 -0
- data/vendor/tesseract-2.04/image/Makefile.in +596 -0
- data/vendor/tesseract-2.04/image/bitstrm.cpp +157 -0
- data/vendor/tesseract-2.04/image/bitstrm.h +73 -0
- data/vendor/tesseract-2.04/image/img.h +336 -0
- data/vendor/tesseract-2.04/image/imgbmp.cpp +223 -0
- data/vendor/tesseract-2.04/image/imgbmp.h +50 -0
- data/vendor/tesseract-2.04/image/imgerrs.h +35 -0
- data/vendor/tesseract-2.04/image/imgio.cpp +321 -0
- data/vendor/tesseract-2.04/image/imgio.h +22 -0
- data/vendor/tesseract-2.04/image/imgs.cpp +1764 -0
- data/vendor/tesseract-2.04/image/imgs.h +102 -0
- data/vendor/tesseract-2.04/image/imgtiff.cpp +723 -0
- data/vendor/tesseract-2.04/image/imgtiff.h +89 -0
- data/vendor/tesseract-2.04/image/imgunpk.h +1377 -0
- data/vendor/tesseract-2.04/image/svshowim.cpp +40 -0
- data/vendor/tesseract-2.04/image/svshowim.h +25 -0
- data/vendor/tesseract-2.04/java/Makefile.am +4 -0
- data/vendor/tesseract-2.04/java/Makefile.in +473 -0
- data/vendor/tesseract-2.04/java/com/Makefile.am +1 -0
- data/vendor/tesseract-2.04/java/com/Makefile.in +470 -0
- data/vendor/tesseract-2.04/java/com/google/Makefile.am +1 -0
- data/vendor/tesseract-2.04/java/com/google/Makefile.in +470 -0
- data/vendor/tesseract-2.04/java/com/google/scrollview/Makefile.am +4 -0
- data/vendor/tesseract-2.04/java/com/google/scrollview/Makefile.in +473 -0
- data/vendor/tesseract-2.04/java/com/google/scrollview/ScrollView.java +421 -0
- data/vendor/tesseract-2.04/java/com/google/scrollview/events/Makefile.am +5 -0
- data/vendor/tesseract-2.04/java/com/google/scrollview/events/Makefile.in +474 -0
- data/vendor/tesseract-2.04/java/com/google/scrollview/events/SVEvent.java +87 -0
- data/vendor/tesseract-2.04/java/com/google/scrollview/events/SVEventHandler.java +296 -0
- data/vendor/tesseract-2.04/java/com/google/scrollview/events/SVEventType.java +31 -0
- data/vendor/tesseract-2.04/java/com/google/scrollview/ui/Makefile.am +7 -0
- data/vendor/tesseract-2.04/java/com/google/scrollview/ui/Makefile.in +476 -0
- data/vendor/tesseract-2.04/java/com/google/scrollview/ui/SVAbstractMenuItem.java +58 -0
- data/vendor/tesseract-2.04/java/com/google/scrollview/ui/SVCheckboxMenuItem.java +60 -0
- data/vendor/tesseract-2.04/java/com/google/scrollview/ui/SVEmptyMenuItem.java +48 -0
- data/vendor/tesseract-2.04/java/com/google/scrollview/ui/SVImageHandler.java +228 -0
- data/vendor/tesseract-2.04/java/com/google/scrollview/ui/SVMenuBar.java +130 -0
- data/vendor/tesseract-2.04/java/com/google/scrollview/ui/SVMenuItem.java +61 -0
- data/vendor/tesseract-2.04/java/com/google/scrollview/ui/SVPopupMenu.java +142 -0
- data/vendor/tesseract-2.04/java/com/google/scrollview/ui/SVSubMenuItem.java +41 -0
- data/vendor/tesseract-2.04/java/com/google/scrollview/ui/SVWindow.java +643 -0
- data/vendor/tesseract-2.04/java/makefile +55 -0
- data/vendor/tesseract-2.04/pageseg/Makefile.am +13 -0
- data/vendor/tesseract-2.04/pageseg/Makefile.in +596 -0
- data/vendor/tesseract-2.04/pageseg/leptonica_pageseg.cpp +363 -0
- data/vendor/tesseract-2.04/pageseg/leptonica_pageseg.h +90 -0
- data/vendor/tesseract-2.04/pageseg/leptonica_pageseg_interface.cpp +82 -0
- data/vendor/tesseract-2.04/pageseg/leptonica_pageseg_interface.h +30 -0
- data/vendor/tesseract-2.04/pageseg/pageseg.cpp +170 -0
- data/vendor/tesseract-2.04/pageseg/pageseg.h +29 -0
- data/vendor/tesseract-2.04/phototest.tif +0 -0
- data/vendor/tesseract-2.04/tessdata/Makefile.am +31 -0
- data/vendor/tesseract-2.04/tessdata/Makefile.in +529 -0
- data/vendor/tesseract-2.04/tessdata/configs/Makefile.am +3 -0
- data/vendor/tesseract-2.04/tessdata/configs/Makefile.in +344 -0
- data/vendor/tesseract-2.04/tessdata/configs/api_config +1 -0
- data/vendor/tesseract-2.04/tessdata/configs/box.train +19 -0
- data/vendor/tesseract-2.04/tessdata/configs/box.train.stderr +18 -0
- data/vendor/tesseract-2.04/tessdata/configs/inter +4 -0
- data/vendor/tesseract-2.04/tessdata/configs/kannada +4 -0
- data/vendor/tesseract-2.04/tessdata/configs/makebox +1 -0
- data/vendor/tesseract-2.04/tessdata/configs/unlv +3 -0
- data/vendor/tesseract-2.04/tessdata/confsets +3 -0
- data/vendor/tesseract-2.04/tessdata/eng.DangAmbigs +39 -0
- data/vendor/tesseract-2.04/tessdata/eng.freq-dawg +0 -0
- data/vendor/tesseract-2.04/tessdata/eng.inttemp +0 -0
- data/vendor/tesseract-2.04/tessdata/eng.normproto +1247 -0
- data/vendor/tesseract-2.04/tessdata/eng.pffmtable +111 -0
- data/vendor/tesseract-2.04/tessdata/eng.unicharset +113 -0
- data/vendor/tesseract-2.04/tessdata/eng.user-words +921 -0
- data/vendor/tesseract-2.04/tessdata/eng.word-dawg +0 -0
- data/vendor/tesseract-2.04/tessdata/makedummies +8 -0
- data/vendor/tesseract-2.04/tessdata/tessconfigs/Makefile.am +3 -0
- data/vendor/tesseract-2.04/tessdata/tessconfigs/Makefile.in +344 -0
- data/vendor/tesseract-2.04/tessdata/tessconfigs/batch +2 -0
- data/vendor/tesseract-2.04/tessdata/tessconfigs/batch.nochop +2 -0
- data/vendor/tesseract-2.04/tessdata/tessconfigs/matdemo +7 -0
- data/vendor/tesseract-2.04/tessdata/tessconfigs/msdemo +13 -0
- data/vendor/tesseract-2.04/tessdata/tessconfigs/nobatch +2 -0
- data/vendor/tesseract-2.04/tessdata/tessconfigs/segdemo +9 -0
- data/vendor/tesseract-2.04/tessdll.cpp +351 -0
- data/vendor/tesseract-2.04/tessdll.dsp +2050 -0
- data/vendor/tesseract-2.04/tessdll.h +143 -0
- data/vendor/tesseract-2.04/tessdll.vcproj +5495 -0
- data/vendor/tesseract-2.04/tesseract.dsp +2124 -0
- data/vendor/tesseract-2.04/tesseract.dsw +116 -0
- data/vendor/tesseract-2.04/tesseract.sln +59 -0
- data/vendor/tesseract-2.04/tesseract.spec +188 -0
- data/vendor/tesseract-2.04/tesseract.vcproj +5859 -0
- data/vendor/tesseract-2.04/testing/Makefile.am +2 -0
- data/vendor/tesseract-2.04/testing/Makefile.in +312 -0
- data/vendor/tesseract-2.04/testing/README +43 -0
- data/vendor/tesseract-2.04/testing/counttestset.sh +61 -0
- data/vendor/tesseract-2.04/testing/reorgdata.sh +44 -0
- data/vendor/tesseract-2.04/testing/reports/1995.bus.3B.sum +1 -0
- data/vendor/tesseract-2.04/testing/reports/1995.doe3.3B.sum +1 -0
- data/vendor/tesseract-2.04/testing/reports/1995.mag.3B.sum +1 -0
- data/vendor/tesseract-2.04/testing/reports/1995.news.3B.sum +1 -0
- data/vendor/tesseract-2.04/testing/reports/2.03.summary +9 -0
- data/vendor/tesseract-2.04/testing/reports/2.04.summary +9 -0
- data/vendor/tesseract-2.04/testing/runalltests.sh +110 -0
- data/vendor/tesseract-2.04/testing/runtestset.sh +61 -0
- data/vendor/tesseract-2.04/textord/Makefile.am +20 -0
- data/vendor/tesseract-2.04/textord/Makefile.in +624 -0
- data/vendor/tesseract-2.04/textord/blkocc.cpp +809 -0
- data/vendor/tesseract-2.04/textord/blkocc.h +327 -0
- data/vendor/tesseract-2.04/textord/blobcmpl.h +31 -0
- data/vendor/tesseract-2.04/textord/drawedg.cpp +77 -0
- data/vendor/tesseract-2.04/textord/drawedg.h +34 -0
- data/vendor/tesseract-2.04/textord/drawtord.cpp +469 -0
- data/vendor/tesseract-2.04/textord/drawtord.h +107 -0
- data/vendor/tesseract-2.04/textord/edgblob.cpp +412 -0
- data/vendor/tesseract-2.04/textord/edgblob.h +100 -0
- data/vendor/tesseract-2.04/textord/edgloop.cpp +211 -0
- data/vendor/tesseract-2.04/textord/edgloop.h +66 -0
- data/vendor/tesseract-2.04/textord/fpchop.cpp +1641 -0
- data/vendor/tesseract-2.04/textord/fpchop.h +238 -0
- data/vendor/tesseract-2.04/textord/gap_map.cpp +166 -0
- data/vendor/tesseract-2.04/textord/gap_map.h +40 -0
- data/vendor/tesseract-2.04/textord/makerow.cpp +2628 -0
- data/vendor/tesseract-2.04/textord/makerow.h +295 -0
- data/vendor/tesseract-2.04/textord/oldbasel.cpp +1761 -0
- data/vendor/tesseract-2.04/textord/oldbasel.h +195 -0
- data/vendor/tesseract-2.04/textord/pithsync.cpp +696 -0
- data/vendor/tesseract-2.04/textord/pithsync.h +134 -0
- data/vendor/tesseract-2.04/textord/pitsync1.cpp +425 -0
- data/vendor/tesseract-2.04/textord/pitsync1.h +135 -0
- data/vendor/tesseract-2.04/textord/scanedg.cpp +452 -0
- data/vendor/tesseract-2.04/textord/scanedg.h +74 -0
- data/vendor/tesseract-2.04/textord/sortflts.cpp +80 -0
- data/vendor/tesseract-2.04/textord/sortflts.h +64 -0
- data/vendor/tesseract-2.04/textord/tessout.h +76 -0
- data/vendor/tesseract-2.04/textord/topitch.cpp +2019 -0
- data/vendor/tesseract-2.04/textord/topitch.h +195 -0
- data/vendor/tesseract-2.04/textord/tordmain.cpp +907 -0
- data/vendor/tesseract-2.04/textord/tordmain.h +132 -0
- data/vendor/tesseract-2.04/textord/tospace.cpp +1939 -0
- data/vendor/tesseract-2.04/textord/tospace.h +193 -0
- data/vendor/tesseract-2.04/textord/tovars.cpp +87 -0
- data/vendor/tesseract-2.04/textord/tovars.h +94 -0
- data/vendor/tesseract-2.04/textord/underlin.cpp +312 -0
- data/vendor/tesseract-2.04/textord/underlin.h +53 -0
- data/vendor/tesseract-2.04/textord/wordseg.cpp +620 -0
- data/vendor/tesseract-2.04/textord/wordseg.h +70 -0
- data/vendor/tesseract-2.04/training/Makefile.am +54 -0
- data/vendor/tesseract-2.04/training/Makefile.in +720 -0
- data/vendor/tesseract-2.04/training/cnTraining.cpp +855 -0
- data/vendor/tesseract-2.04/training/cntraining.dsp +243 -0
- data/vendor/tesseract-2.04/training/cntraining.vcproj +950 -0
- data/vendor/tesseract-2.04/training/mergenf.cpp +451 -0
- data/vendor/tesseract-2.04/training/mergenf.h +106 -0
- data/vendor/tesseract-2.04/training/mfTraining.cpp +1341 -0
- data/vendor/tesseract-2.04/training/mftraining.dsp +285 -0
- data/vendor/tesseract-2.04/training/mftraining.vcproj +1055 -0
- data/vendor/tesseract-2.04/training/name2char.cpp +166 -0
- data/vendor/tesseract-2.04/training/name2char.h +38 -0
- data/vendor/tesseract-2.04/training/training.cpp +190 -0
- data/vendor/tesseract-2.04/training/training.h +130 -0
- data/vendor/tesseract-2.04/training/unicharset_extractor.cpp +140 -0
- data/vendor/tesseract-2.04/training/unicharset_extractor.dsp +335 -0
- data/vendor/tesseract-2.04/training/unicharset_extractor.vcproj +769 -0
- data/vendor/tesseract-2.04/training/wordlist2dawg.cpp +69 -0
- data/vendor/tesseract-2.04/training/wordlist2dawg.dsp +319 -0
- data/vendor/tesseract-2.04/training/wordlist2dawg.vcproj +1113 -0
- data/vendor/tesseract-2.04/viewer/Makefile.am +9 -0
- data/vendor/tesseract-2.04/viewer/Makefile.in +591 -0
- data/vendor/tesseract-2.04/viewer/scrollview.cpp +825 -0
- data/vendor/tesseract-2.04/viewer/scrollview.h +414 -0
- data/vendor/tesseract-2.04/viewer/svmnode.cpp +140 -0
- data/vendor/tesseract-2.04/viewer/svmnode.h +94 -0
- data/vendor/tesseract-2.04/viewer/svpaint.cpp +220 -0
- data/vendor/tesseract-2.04/viewer/svutil.cpp +347 -0
- data/vendor/tesseract-2.04/viewer/svutil.h +138 -0
- data/vendor/tesseract-2.04/wordrec/Makefile.am +23 -0
- data/vendor/tesseract-2.04/wordrec/Makefile.in +641 -0
- data/vendor/tesseract-2.04/wordrec/associate.cpp +62 -0
- data/vendor/tesseract-2.04/wordrec/associate.h +93 -0
- data/vendor/tesseract-2.04/wordrec/badwords.cpp +106 -0
- data/vendor/tesseract-2.04/wordrec/badwords.h +51 -0
- data/vendor/tesseract-2.04/wordrec/bestfirst.cpp +526 -0
- data/vendor/tesseract-2.04/wordrec/bestfirst.h +203 -0
- data/vendor/tesseract-2.04/wordrec/charsample.h +208 -0
- data/vendor/tesseract-2.04/wordrec/chop.cpp +458 -0
- data/vendor/tesseract-2.04/wordrec/chop.h +153 -0
- data/vendor/tesseract-2.04/wordrec/chopper.cpp +750 -0
- data/vendor/tesseract-2.04/wordrec/chopper.h +104 -0
- data/vendor/tesseract-2.04/wordrec/closed.cpp +136 -0
- data/vendor/tesseract-2.04/wordrec/closed.h +65 -0
- data/vendor/tesseract-2.04/wordrec/djmenus.cpp +118 -0
- data/vendor/tesseract-2.04/wordrec/djmenus.h +33 -0
- data/vendor/tesseract-2.04/wordrec/drawfx.cpp +92 -0
- data/vendor/tesseract-2.04/wordrec/drawfx.h +33 -0
- data/vendor/tesseract-2.04/wordrec/findseam.cpp +566 -0
- data/vendor/tesseract-2.04/wordrec/findseam.h +69 -0
- data/vendor/tesseract-2.04/wordrec/gradechop.cpp +226 -0
- data/vendor/tesseract-2.04/wordrec/gradechop.h +91 -0
- data/vendor/tesseract-2.04/wordrec/heuristic.cpp +194 -0
- data/vendor/tesseract-2.04/wordrec/heuristic.h +120 -0
- data/vendor/tesseract-2.04/wordrec/makechop.cpp +281 -0
- data/vendor/tesseract-2.04/wordrec/makechop.h +69 -0
- data/vendor/tesseract-2.04/wordrec/matchtab.cpp +191 -0
- data/vendor/tesseract-2.04/wordrec/matchtab.h +45 -0
- data/vendor/tesseract-2.04/wordrec/matrix.cpp +118 -0
- data/vendor/tesseract-2.04/wordrec/matrix.h +104 -0
- data/vendor/tesseract-2.04/wordrec/measure.h +135 -0
- data/vendor/tesseract-2.04/wordrec/metrics.cpp +363 -0
- data/vendor/tesseract-2.04/wordrec/metrics.h +130 -0
- data/vendor/tesseract-2.04/wordrec/mfvars.cpp +51 -0
- data/vendor/tesseract-2.04/wordrec/mfvars.h +27 -0
- data/vendor/tesseract-2.04/wordrec/msmenus.cpp +110 -0
- data/vendor/tesseract-2.04/wordrec/msmenus.h +45 -0
- data/vendor/tesseract-2.04/wordrec/olutil.cpp +153 -0
- data/vendor/tesseract-2.04/wordrec/olutil.h +128 -0
- data/vendor/tesseract-2.04/wordrec/outlines.cpp +172 -0
- data/vendor/tesseract-2.04/wordrec/outlines.h +148 -0
- data/vendor/tesseract-2.04/wordrec/pieces.cpp +410 -0
- data/vendor/tesseract-2.04/wordrec/pieces.h +154 -0
- data/vendor/tesseract-2.04/wordrec/plotedges.cpp +134 -0
- data/vendor/tesseract-2.04/wordrec/plotedges.h +71 -0
- data/vendor/tesseract-2.04/wordrec/plotseg.cpp +116 -0
- data/vendor/tesseract-2.04/wordrec/plotseg.h +73 -0
- data/vendor/tesseract-2.04/wordrec/render.cpp +152 -0
- data/vendor/tesseract-2.04/wordrec/render.h +58 -0
- data/vendor/tesseract-2.04/wordrec/seam.cpp +482 -0
- data/vendor/tesseract-2.04/wordrec/seam.h +136 -0
- data/vendor/tesseract-2.04/wordrec/split.cpp +182 -0
- data/vendor/tesseract-2.04/wordrec/split.h +115 -0
- data/vendor/tesseract-2.04/wordrec/tally.cpp +68 -0
- data/vendor/tesseract-2.04/wordrec/tally.h +94 -0
- data/vendor/tesseract-2.04/wordrec/tessinit.cpp +108 -0
- data/vendor/tesseract-2.04/wordrec/tessinit.h +46 -0
- data/vendor/tesseract-2.04/wordrec/tface.cpp +272 -0
- data/vendor/tesseract-2.04/wordrec/tface.h +35 -0
- data/vendor/tesseract-2.04/wordrec/wordclass.cpp +284 -0
- data/vendor/tesseract-2.04/wordrec/wordclass.h +64 -0
- metadata +708 -0
@@ -0,0 +1,526 @@
|
|
1
|
+
/* -*-C-*-
|
2
|
+
********************************************************************************
|
3
|
+
*
|
4
|
+
* File: bestfirst.c (Formerly bestfirst.c)
|
5
|
+
* Description: Best first search functions
|
6
|
+
* Author: Mark Seaman, OCR Technology
|
7
|
+
* Created: Mon May 14 11:23:29 1990
|
8
|
+
* Modified: Tue Jul 30 16:08:47 1991 (Mark Seaman) marks@hpgrlt
|
9
|
+
* Language: C
|
10
|
+
* Package: N/A
|
11
|
+
* Status: Experimental (Do Not Distribute)
|
12
|
+
*
|
13
|
+
* (c) Copyright 1990, Hewlett-Packard Company.
|
14
|
+
** Licensed under the Apache License, Version 2.0 (the "License");
|
15
|
+
** you may not use this file except in compliance with the License.
|
16
|
+
** You may obtain a copy of the License at
|
17
|
+
** http://www.apache.org/licenses/LICENSE-2.0
|
18
|
+
** Unless required by applicable law or agreed to in writing, software
|
19
|
+
** distributed under the License is distributed on an "AS IS" BASIS,
|
20
|
+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
21
|
+
** See the License for the specific language governing permissions and
|
22
|
+
** limitations under the License.
|
23
|
+
*
|
24
|
+
***************************************************************************/
|
25
|
+
|
26
|
+
/*----------------------------------------------------------------------
|
27
|
+
I n c l u d e s
|
28
|
+
---------------------------------------------------------------------*/
|
29
|
+
#include <assert.h>
|
30
|
+
|
31
|
+
#include "bestfirst.h"
|
32
|
+
#include "heuristic.h"
|
33
|
+
#include "plotseg.h"
|
34
|
+
#include "tordvars.h"
|
35
|
+
#include "debug.h"
|
36
|
+
#include "pieces.h"
|
37
|
+
#include "stopper.h"
|
38
|
+
#include "metrics.h"
|
39
|
+
#include "states.h"
|
40
|
+
#include "bitvec.h"
|
41
|
+
#include "freelist.h"
|
42
|
+
#include "permute.h"
|
43
|
+
#include "structures.h"
|
44
|
+
#include "wordclass.h"
|
45
|
+
|
46
|
+
void call_caller();
|
47
|
+
|
48
|
+
/*----------------------------------------------------------------------
|
49
|
+
V a r i a b l e s
|
50
|
+
---------------------------------------------------------------------*/
|
51
|
+
int num_joints; /* Number of chunks - 1 */
|
52
|
+
int num_pushed = 0;
|
53
|
+
int num_popped = 0;
|
54
|
+
|
55
|
+
make_int_var (num_seg_states, 30, make_seg_states,
|
56
|
+
9, 1, set_seg_states, "Segmentation states");
|
57
|
+
|
58
|
+
make_float_var (worst_state, 1, make_worst_state,
|
59
|
+
9, 9, set_worst_state, "Worst segmentation state");
|
60
|
+
/**/
|
61
|
+
/*----------------------------------------------------------------------
|
62
|
+
F u n c t i o n s
|
63
|
+
----------------------------------------------------------------------*/
|
64
|
+
/**********************************************************************
|
65
|
+
* init_bestfirst_vars
|
66
|
+
*
|
67
|
+
* Create and initialize references to debug variables that control
|
68
|
+
* operations in this file.
|
69
|
+
**********************************************************************/
|
70
|
+
void init_bestfirst_vars() {
|
71
|
+
make_seg_states();
|
72
|
+
make_worst_state();
|
73
|
+
}
|
74
|
+
|
75
|
+
|
76
|
+
/**********************************************************************
|
77
|
+
* best_first_search
|
78
|
+
*
|
79
|
+
* Find the best segmentation by doing a best first search of the
|
80
|
+
* solution space.
|
81
|
+
**********************************************************************/
|
82
|
+
void best_first_search(CHUNKS_RECORD *chunks_record,
|
83
|
+
A_CHOICE *best_choice,
|
84
|
+
A_CHOICE *raw_choice,
|
85
|
+
STATE *state,
|
86
|
+
DANGERR *fixpt,
|
87
|
+
STATE *best_state,
|
88
|
+
inT32 pass) {
|
89
|
+
SEARCH_RECORD *the_search;
|
90
|
+
inT16 keep_going;
|
91
|
+
STATE guided_state;
|
92
|
+
|
93
|
+
num_joints = matrix_dimension (chunks_record->ratings) - 1;
|
94
|
+
the_search = new_search (chunks_record, num_joints,
|
95
|
+
best_choice, raw_choice, state);
|
96
|
+
|
97
|
+
#ifndef GRAPHICS_DISABLED
|
98
|
+
save_best_state(chunks_record);
|
99
|
+
#endif
|
100
|
+
start_recording();
|
101
|
+
FLOAT32 worst_priority = 2.0f * prioritize_state(chunks_record,
|
102
|
+
the_search,
|
103
|
+
best_state);
|
104
|
+
if (worst_priority < worst_state)
|
105
|
+
worst_priority = worst_state;
|
106
|
+
|
107
|
+
guided_state = *state;
|
108
|
+
do {
|
109
|
+
/* Look for answer */
|
110
|
+
if (!hash_lookup (the_search->closed_states, the_search->this_state)) {
|
111
|
+
|
112
|
+
if (blob_skip) {
|
113
|
+
free_state (the_search->this_state);
|
114
|
+
break;
|
115
|
+
}
|
116
|
+
|
117
|
+
guided_state = *(the_search->this_state);
|
118
|
+
keep_going =
|
119
|
+
evaluate_state(chunks_record, the_search, fixpt, best_state, pass);
|
120
|
+
|
121
|
+
hash_add (the_search->closed_states, the_search->this_state);
|
122
|
+
|
123
|
+
if (!keep_going ||
|
124
|
+
(the_search->num_states > num_seg_states) || (blob_skip)) {
|
125
|
+
free_state (the_search->this_state);
|
126
|
+
break;
|
127
|
+
}
|
128
|
+
|
129
|
+
expand_node(worst_priority, chunks_record, the_search);
|
130
|
+
}
|
131
|
+
|
132
|
+
free_state (the_search->this_state);
|
133
|
+
num_popped++;
|
134
|
+
the_search->this_state = pop_queue (the_search->open_states);
|
135
|
+
}
|
136
|
+
while (the_search->this_state);
|
137
|
+
|
138
|
+
state->part1 = the_search->best_state->part1;
|
139
|
+
state->part2 = the_search->best_state->part2;
|
140
|
+
stop_recording();
|
141
|
+
delete_search(the_search);
|
142
|
+
}
|
143
|
+
|
144
|
+
|
145
|
+
/**********************************************************************
|
146
|
+
* chunks_width
|
147
|
+
*
|
148
|
+
* Return the width of several of the chunks (if they were joined to-
|
149
|
+
* gether.
|
150
|
+
**********************************************************************/
|
151
|
+
int chunks_width(WIDTH_RECORD *width_record, int start_chunk, int last_chunk) {
|
152
|
+
int result = 0;
|
153
|
+
int x;
|
154
|
+
|
155
|
+
for (x = start_chunk * 2; x <= last_chunk * 2; x++)
|
156
|
+
result += width_record->widths[x];
|
157
|
+
|
158
|
+
return (result);
|
159
|
+
}
|
160
|
+
|
161
|
+
|
162
|
+
/**********************************************************************
|
163
|
+
* delete_search
|
164
|
+
*
|
165
|
+
* Terminate the current search and free all the memory involved.
|
166
|
+
**********************************************************************/
|
167
|
+
void delete_search(SEARCH_RECORD *the_search) {
|
168
|
+
float closeness;
|
169
|
+
|
170
|
+
closeness = (the_search->num_joints ?
|
171
|
+
(hamming_distance(reinterpret_cast<uinT32*>(the_search->first_state),
|
172
|
+
reinterpret_cast<uinT32*>(the_search->best_state), 2) /
|
173
|
+
(float) the_search->num_joints) : 0.0f);
|
174
|
+
|
175
|
+
record_search_status (the_search->num_states,
|
176
|
+
the_search->before_best, closeness);
|
177
|
+
|
178
|
+
free_state (the_search->first_state);
|
179
|
+
free_state (the_search->best_state);
|
180
|
+
|
181
|
+
free_hash_table (the_search->closed_states);
|
182
|
+
FreeHeapData (the_search->open_states, (void_dest) free_state);
|
183
|
+
|
184
|
+
memfree(the_search);
|
185
|
+
}
|
186
|
+
|
187
|
+
|
188
|
+
/**********************************************************************
|
189
|
+
* evaluate_chunks
|
190
|
+
*
|
191
|
+
* A particular word level segmentation has been chosen. Evaluation
|
192
|
+
* this to find the word list that corresponds to it.
|
193
|
+
**********************************************************************/
|
194
|
+
CHOICES_LIST evaluate_chunks(CHUNKS_RECORD *chunks_record,
|
195
|
+
SEARCH_STATE search_state,
|
196
|
+
STATE *this_state,
|
197
|
+
STATE *best_state,
|
198
|
+
inT32 pass) {
|
199
|
+
CHOICES_LIST char_choices;
|
200
|
+
CHOICES this_choice;
|
201
|
+
int i;
|
202
|
+
int x = 0;
|
203
|
+
int y;
|
204
|
+
|
205
|
+
char_choices = new_choice_list ();
|
206
|
+
/* Iterate sub-paths */
|
207
|
+
for (i = 1; i <= search_state[0] + 1; i++) {
|
208
|
+
if (i > search_state[0])
|
209
|
+
y = count_blobs (chunks_record->chunks) - 1;
|
210
|
+
else
|
211
|
+
y = x + search_state[i];
|
212
|
+
|
213
|
+
if (blob_skip) {
|
214
|
+
array_free(char_choices);
|
215
|
+
return (NULL);
|
216
|
+
} /* Process one square */
|
217
|
+
/* Classify if needed */
|
218
|
+
this_choice = get_piece_rating (chunks_record->ratings,
|
219
|
+
chunks_record->chunks,
|
220
|
+
chunks_record->splits,
|
221
|
+
x, y,
|
222
|
+
chunks_record->fx,
|
223
|
+
this_state, best_state, pass, i - 1);
|
224
|
+
|
225
|
+
if (this_choice == NIL) {
|
226
|
+
array_free(char_choices);
|
227
|
+
return (NULL);
|
228
|
+
}
|
229
|
+
/* Add permuted ratings */
|
230
|
+
last_segmentation[i - 1].certainty = best_certainty (this_choice);
|
231
|
+
last_segmentation[i - 1].match = best_probability (this_choice);
|
232
|
+
|
233
|
+
last_segmentation[i - 1].width =
|
234
|
+
chunks_width (chunks_record->chunk_widths, x, y);
|
235
|
+
last_segmentation[i - 1].gap =
|
236
|
+
chunks_gap (chunks_record->chunk_widths, y);
|
237
|
+
|
238
|
+
char_choices = array_push (char_choices, this_choice);
|
239
|
+
x = y + 1;
|
240
|
+
}
|
241
|
+
return (char_choices);
|
242
|
+
}
|
243
|
+
|
244
|
+
|
245
|
+
/**********************************************************************
|
246
|
+
* evaluate_state
|
247
|
+
*
|
248
|
+
* Evaluate the segmentation that is represented by this state in the
|
249
|
+
* best first search. Add this state to the "states_seen" list.
|
250
|
+
**********************************************************************/
|
251
|
+
inT16 evaluate_state(CHUNKS_RECORD *chunks_record,
|
252
|
+
SEARCH_RECORD *the_search,
|
253
|
+
DANGERR *fixpt,
|
254
|
+
STATE *best_state,
|
255
|
+
inT32 pass) {
|
256
|
+
CHOICES_LIST char_choices;
|
257
|
+
SEARCH_STATE chunk_groups;
|
258
|
+
float rating_limit = class_probability (the_search->best_choice);
|
259
|
+
inT16 keep_going = TRUE;
|
260
|
+
PIECES_STATE widths;
|
261
|
+
|
262
|
+
the_search->num_states++;
|
263
|
+
chunk_groups = bin_to_chunks (the_search->this_state,
|
264
|
+
the_search->num_joints);
|
265
|
+
bin_to_pieces (the_search->this_state, the_search->num_joints, widths);
|
266
|
+
LogNewSegmentation(widths);
|
267
|
+
|
268
|
+
rating_limit = class_probability (the_search->best_choice);
|
269
|
+
|
270
|
+
char_choices =
|
271
|
+
evaluate_chunks (chunks_record, chunk_groups, the_search->this_state,
|
272
|
+
best_state, pass);
|
273
|
+
if (char_choices != NULL) {
|
274
|
+
permute_characters (char_choices,
|
275
|
+
rating_limit,
|
276
|
+
the_search->best_choice, the_search->raw_choice);
|
277
|
+
if (AcceptableChoice (char_choices, the_search->best_choice,
|
278
|
+
the_search->raw_choice, fixpt))
|
279
|
+
keep_going = FALSE;
|
280
|
+
array_free(char_choices);
|
281
|
+
}
|
282
|
+
|
283
|
+
#ifndef GRAPHICS_DISABLED
|
284
|
+
if (display_segmentations) {
|
285
|
+
display_segmentation (chunks_record->chunks, chunk_groups);
|
286
|
+
if (display_segmentations > 1)
|
287
|
+
window_wait(segm_window);
|
288
|
+
}
|
289
|
+
#endif
|
290
|
+
|
291
|
+
if (rating_limit != class_probability (the_search->best_choice)) {
|
292
|
+
the_search->before_best = the_search->num_states;
|
293
|
+
the_search->best_state->part1 = the_search->this_state->part1;
|
294
|
+
the_search->best_state->part2 = the_search->this_state->part2;
|
295
|
+
replace_char_widths(chunks_record, chunk_groups);
|
296
|
+
}
|
297
|
+
else if (char_choices != NULL)
|
298
|
+
fixpt->index = -1;
|
299
|
+
|
300
|
+
memfree(chunk_groups);
|
301
|
+
|
302
|
+
return (keep_going);
|
303
|
+
}
|
304
|
+
|
305
|
+
|
306
|
+
/**********************************************************************
|
307
|
+
* rebuild_current_state
|
308
|
+
*
|
309
|
+
* Evaluate the segmentation that is represented by this state in the
|
310
|
+
* best first search. Add this state to the "states_seen" list.
|
311
|
+
**********************************************************************/
|
312
|
+
CHOICES_LIST rebuild_current_state(TBLOB *blobs,
|
313
|
+
SEAMS seam_list,
|
314
|
+
STATE *state,
|
315
|
+
CHOICES_LIST old_choices,
|
316
|
+
int fx) {
|
317
|
+
CHOICES_LIST char_choices;
|
318
|
+
SEARCH_STATE search_state;
|
319
|
+
int i;
|
320
|
+
int num_joints = array_count (seam_list);
|
321
|
+
int x = 0;
|
322
|
+
int blobindex; /*current blob */
|
323
|
+
TBLOB *p_blob;
|
324
|
+
TBLOB *blob;
|
325
|
+
TBLOB *next_blob;
|
326
|
+
int y;
|
327
|
+
|
328
|
+
#ifndef GRAPHICS_DISABLED
|
329
|
+
if (display_segmentations) {
|
330
|
+
print_state("Rebuiling state", state, num_joints);
|
331
|
+
}
|
332
|
+
#endif
|
333
|
+
search_state = bin_to_chunks (state, num_joints);
|
334
|
+
|
335
|
+
char_choices = new_choice_list ();
|
336
|
+
/* Iterate sub-paths */
|
337
|
+
for (i = 1; i <= search_state[0]; i++) {
|
338
|
+
y = x + search_state[i];
|
339
|
+
x = y + 1;
|
340
|
+
char_choices = array_push (char_choices, NULL);
|
341
|
+
}
|
342
|
+
char_choices = array_push (char_choices, NULL);
|
343
|
+
|
344
|
+
y = count_blobs (blobs) - 1;
|
345
|
+
for (i = search_state[0]; i >= 0; i--) {
|
346
|
+
if (x == y) { /*single fragment */
|
347
|
+
array_value (char_choices, i) = array_value (old_choices, x);
|
348
|
+
/*grab the list */
|
349
|
+
array_value (old_choices, x) = NULL;
|
350
|
+
}
|
351
|
+
else {
|
352
|
+
join_pieces(blobs, seam_list, x, y);
|
353
|
+
for (blob = blobs, blobindex = 0, p_blob = NULL; blobindex < x;
|
354
|
+
blobindex++) {
|
355
|
+
p_blob = blob;
|
356
|
+
blob = blob->next;
|
357
|
+
}
|
358
|
+
while (blobindex < y) {
|
359
|
+
next_blob = blob->next;
|
360
|
+
blob->next = next_blob->next;
|
361
|
+
oldblob(next_blob); /*junk dead blobs */
|
362
|
+
blobindex++;
|
363
|
+
}
|
364
|
+
array_value (char_choices, i) =
|
365
|
+
(char *) classify_blob (p_blob, blob, blob->next, NULL, fx,
|
366
|
+
"rebuild", Orange, NULL, NULL, 0, 0);
|
367
|
+
}
|
368
|
+
|
369
|
+
y = x - 1;
|
370
|
+
x = y - search_state[i];
|
371
|
+
}
|
372
|
+
|
373
|
+
memfree(search_state);
|
374
|
+
free_all_choices(old_choices, x);
|
375
|
+
return (char_choices);
|
376
|
+
|
377
|
+
}
|
378
|
+
|
379
|
+
|
380
|
+
/**********************************************************************
|
381
|
+
* expand_node
|
382
|
+
*
|
383
|
+
* Create the states that are attached to this one. Check to see that
|
384
|
+
* each one has not already been visited. If not add it to the priority
|
385
|
+
* queue.
|
386
|
+
**********************************************************************/
|
387
|
+
void expand_node(FLOAT32 worst_priority,
|
388
|
+
CHUNKS_RECORD *chunks_record, SEARCH_RECORD *the_search) {
|
389
|
+
STATE old_state;
|
390
|
+
int x;
|
391
|
+
int mask = 1 << (the_search->num_joints - 1 - 32);
|
392
|
+
|
393
|
+
old_state.part1 = the_search->this_state->part1;
|
394
|
+
old_state.part2 = the_search->this_state->part2;
|
395
|
+
|
396
|
+
for (x = the_search->num_joints; x > 32; x--) {
|
397
|
+
the_search->this_state->part1 = mask ^ old_state.part1;
|
398
|
+
if (!hash_lookup (the_search->closed_states, the_search->this_state))
|
399
|
+
push_queue (the_search->open_states, the_search->this_state,
|
400
|
+
worst_priority,
|
401
|
+
prioritize_state (chunks_record, the_search, &old_state));
|
402
|
+
mask >>= 1;
|
403
|
+
}
|
404
|
+
|
405
|
+
if (the_search->num_joints > 32) {
|
406
|
+
mask = 1 << 31;
|
407
|
+
}
|
408
|
+
else {
|
409
|
+
mask = 1 << (the_search->num_joints - 1);
|
410
|
+
}
|
411
|
+
|
412
|
+
while (x--) {
|
413
|
+
the_search->this_state->part2 = mask ^ old_state.part2;
|
414
|
+
if (!hash_lookup (the_search->closed_states, the_search->this_state))
|
415
|
+
push_queue (the_search->open_states, the_search->this_state,
|
416
|
+
worst_priority,
|
417
|
+
prioritize_state (chunks_record, the_search, &old_state));
|
418
|
+
mask >>= 1;
|
419
|
+
}
|
420
|
+
}
|
421
|
+
|
422
|
+
|
423
|
+
/**********************************************************************
|
424
|
+
* new_search
|
425
|
+
*
|
426
|
+
* Create and initialize a new search record.
|
427
|
+
**********************************************************************/
|
428
|
+
SEARCH_RECORD *new_search(CHUNKS_RECORD *chunks_record,
|
429
|
+
int num_joints,
|
430
|
+
A_CHOICE *best_choice,
|
431
|
+
A_CHOICE *raw_choice,
|
432
|
+
STATE *state) {
|
433
|
+
SEARCH_RECORD *this_search;
|
434
|
+
|
435
|
+
this_search = (SEARCH_RECORD *) memalloc (sizeof (SEARCH_RECORD));
|
436
|
+
|
437
|
+
this_search->open_states = MakeHeap (num_seg_states * 20);
|
438
|
+
this_search->closed_states = new_hash_table ();
|
439
|
+
|
440
|
+
if (state)
|
441
|
+
this_search->this_state = new_state (state);
|
442
|
+
else
|
443
|
+
cprintf ("error: bad initial state in new_search\n");
|
444
|
+
|
445
|
+
this_search->first_state = new_state (this_search->this_state);
|
446
|
+
this_search->best_state = new_state (this_search->this_state);
|
447
|
+
|
448
|
+
this_search->best_choice = best_choice;
|
449
|
+
this_search->raw_choice = raw_choice;
|
450
|
+
|
451
|
+
this_search->num_joints = num_joints;
|
452
|
+
this_search->num_states = 0;
|
453
|
+
this_search->before_best = 0;
|
454
|
+
|
455
|
+
return (this_search);
|
456
|
+
}
|
457
|
+
|
458
|
+
|
459
|
+
/**********************************************************************
|
460
|
+
* pop_queue
|
461
|
+
*
|
462
|
+
* Get this state from the priority queue. It should be the state that
|
463
|
+
* has the greatest urgency to be evaluated.
|
464
|
+
**********************************************************************/
|
465
|
+
STATE *pop_queue(HEAP *queue) {
|
466
|
+
HEAPENTRY entry;
|
467
|
+
|
468
|
+
if (GetTopOfHeap (queue, &entry) == OK) {
|
469
|
+
#ifndef GRAPHICS_DISABLED
|
470
|
+
if (display_segmentations) {
|
471
|
+
cprintf ("eval state: %8.3f ", entry.Key);
|
472
|
+
print_state ("", (STATE *) entry.Data, num_joints);
|
473
|
+
}
|
474
|
+
#endif
|
475
|
+
return ((STATE *) entry.Data);
|
476
|
+
}
|
477
|
+
else {
|
478
|
+
return (NULL);
|
479
|
+
}
|
480
|
+
}
|
481
|
+
|
482
|
+
|
483
|
+
/**********************************************************************
|
484
|
+
* push_queue
|
485
|
+
*
|
486
|
+
* Add this state into the priority queue.
|
487
|
+
**********************************************************************/
|
488
|
+
void push_queue(HEAP *queue, STATE *state, FLOAT32 worst_priority,
|
489
|
+
FLOAT32 priority) {
|
490
|
+
HEAPENTRY entry;
|
491
|
+
|
492
|
+
if (SizeOfHeap (queue) < MaxSizeOfHeap (queue) && priority < worst_priority) {
|
493
|
+
entry.Data = (char *) new_state (state);
|
494
|
+
num_pushed++;
|
495
|
+
entry.Key = priority;
|
496
|
+
HeapStore(queue, &entry);
|
497
|
+
}
|
498
|
+
}
|
499
|
+
|
500
|
+
|
501
|
+
/**********************************************************************
|
502
|
+
* replace_char_widths
|
503
|
+
*
|
504
|
+
* Replace the value of the char_width field in the chunks_record with
|
505
|
+
* the updated width measurements from the last_segmentation.
|
506
|
+
**********************************************************************/
|
507
|
+
void replace_char_widths(CHUNKS_RECORD *chunks_record, SEARCH_STATE state) {
|
508
|
+
WIDTH_RECORD *width_record;
|
509
|
+
int num_blobs;
|
510
|
+
int i;
|
511
|
+
|
512
|
+
free_widths (chunks_record->char_widths);
|
513
|
+
|
514
|
+
num_blobs = state[0] + 1;
|
515
|
+
width_record = (WIDTH_RECORD *) memalloc (sizeof (int) * num_blobs * 2);
|
516
|
+
width_record->num_chars = num_blobs;
|
517
|
+
|
518
|
+
for (i = 0; i < num_blobs; i++) {
|
519
|
+
|
520
|
+
width_record->widths[2 * i] = last_segmentation[i].width;
|
521
|
+
|
522
|
+
if (i + 1 < num_blobs)
|
523
|
+
width_record->widths[2 * i + 1] = last_segmentation[i].gap;
|
524
|
+
}
|
525
|
+
chunks_record->char_widths = width_record;
|
526
|
+
}
|