Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit 92fd41f4541e2c67a9f0d0c5018b8548d7a6fcf2 @charlesw committed Dec 8, 2012
Showing with 13,676 additions and 0 deletions.
  1. +49 −0 .gitattributes
  2. +178 −0 .gitignore
  3. +81 −0 BaseApiTester/BaseApiTester.csproj
  4. +85 −0 BaseApiTester/FormattedConsoleLogger.cs
  5. +87 −0 BaseApiTester/Program.cs
  6. +31 −0 BaseApiTester/Properties/AssemblyInfo.cs
  7. +6 −0 BaseApiTester/app.config
  8. BIN BaseApiTester/phototest.tif
  9. +30 −0 ReadMe.md
  10. +45 −0 Tesseract.Net20/DisposableBase.cs
  11. +42 −0 Tesseract.Net20/ElementProperties.cs
  12. +134 −0 Tesseract.Net20/Engine.cs
  13. +25 −0 Tesseract.Net20/EngineConfig.cs
  14. +13 −0 Tesseract.Net20/EngineMode.cs
  15. +29 −0 Tesseract.Net20/ImageFormat.cs
  16. +164 −0 Tesseract.Net20/Interop/BaseApi.cs
  17. +14 −0 Tesseract.Net20/Interop/Constants.cs
  18. +80 −0 Tesseract.Net20/Interop/EmbeddedDllLoader.cs
  19. +42 −0 Tesseract.Net20/Interop/LeptonicaApi.cs
  20. +30 −0 Tesseract.Net20/Interop/MarshalHelper.cs
  21. +12 −0 Tesseract.Net20/Interop/PixColormap.cs
  22. +21 −0 Tesseract.Net20/MathHelper.cs
  23. +14 −0 Tesseract.Net20/Orientation.cs
  24. +158 −0 Tesseract.Net20/PageIterator.cs
  25. +15 −0 Tesseract.Net20/PageIteratorLevel.cs
  26. +337 −0 Tesseract.Net20/Pix.cs
  27. +24 −0 Tesseract.Net20/PolyBlockType.cs
  28. +30 −0 Tesseract.Net20/Properties/AssemblyInfo.cs
  29. +107 −0 Tesseract.Net20/Rect.cs
  30. +22 −0 Tesseract.Net20/ResultIterator.cs
  31. +91 −0 Tesseract.Net20/Tesseract.Net20.csproj
  32. +29 −0 Tesseract.Net20/TesseractException.cs
  33. +10 −0 Tesseract.Net20/TextLineOrder.cs
  34. +13 −0 Tesseract.Net20/WritingDirection.cs
  35. +133 −0 Tesseract.Net40/Tesseract.Net40.csproj
  36. +132 −0 Tesseract.Net45/Tesseract.Net45.csproj
  37. +18 −0 Tesseract.Tests/BaseApiTests.cs
  38. +37 −0 Tesseract.Tests/EngineTests.cs
  39. +19 −0 Tesseract.Tests/Leptonica/LoadFromFileTests.cs
  40. +122 −0 Tesseract.Tests/Leptonica/PixDataAccessTests.cs
  41. +31 −0 Tesseract.Tests/Properties/AssemblyInfo.cs
  42. +76 −0 Tesseract.Tests/Tesseract.Tests.csproj
  43. +58 −0 Tesseract.Tests/TesseractResultSet.cs
  44. BIN Tesseract.Tests/phototest.tif
  45. +13 −0 Tesseract.nunit
  46. +78 −0 Tesseract.sln
  47. BIN lib/NUnit/nunit.framework.dll
  48. +10,899 −0 lib/NUnit/nunit.framework.xml
  49. BIN lib/TesseractOcr/liblept168.dll
  50. BIN lib/TesseractOcr/libtesseract302.dll
  51. +12 −0 todo.md
@@ -0,0 +1,49 @@
+*.doc diff=astextplain
+*.DOC diff=astextplain
+*.docx diff=astextplain
+*.DOCX diff=astextplain
+*.dot diff=astextplain
+*.DOT diff=astextplain
+*.pdf diff=astextplain
+*.PDF diff=astextplain
+*.rtf diff=astextplain
+*.RTF diff=astextplain
+
+*.jpg binary
+*.png binary
+*.gif binary
+
+*.cs text=auto diff=csharp
+*.vb text=auto
+*.c text=auto
+*.cpp text=auto
+*.cxx text=auto
+*.h text=auto
+*.hxx text=auto
+*.py text=auto
+*.rb text=auto
+*.java text=auto
+*.html text=auto
+*.htm text=auto
+*.css text=auto
+*.scss text=auto
+*.sass text=auto
+*.less text=auto
+*.js text=auto
+*.lisp text=auto
+*.clj text=auto
+*.sql text=auto
+*.php text=auto
+*.lua text=auto
+*.m text=auto
+*.asm text=auto
+*.erl text=auto
+*.fs text=auto
+*.fsx text=auto
+*.hs text=auto
+
+*.csproj text=auto merge=union
+*.vbproj text=auto merge=union
+*.fsproj text=auto merge=union
+*.dbproj text=auto merge=union
+*.sln text=auto eol=crlf merge=union
@@ -0,0 +1,178 @@
+
+#################
+## Eclipse
+#################
+
+*.pydevproject
+.project
+.metadata
+bin/**
+tmp/**
+tmp/**/*
+*.tmp
+*.bak
+*.swp
+*~.nib
+local.properties
+.classpath
+.settings/
+.loadpath
+
+# External tool builders
+.externalToolBuilders/
+
+# Locally stored "Eclipse launch configurations"
+*.launch
+
+# CDT-specific
+.cproject
+
+# PDT-specific
+.buildpath
+
+#################
+## Nunit
+#################
+
+*.VisualState.xml
+TestResult.xml
+
+#################
+## SharpDevelop
+#################
+
+## Profiling
+*.sdps
+
+#################
+## Visual Studio
+#################
+
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+
+# User-specific files
+*.suo
+*.user
+*.sln.docstates
+
+# Build results
+**/[Dd]ebug/
+**/[Rr]elease/
+*_i.c
+*_p.c
+*.ilk
+*.meta
+*.obj
+*.pch
+*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.vspscc
+.builds
+**/*.dotCover
+
+## TODO: If you have NuGet Package Restore enabled, uncomment this
+#**/packages/
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opensdf
+*.sdf
+
+# Visual Studio profiler
+*.psess
+*.vsp
+
+# ReSharper is a .NET coding add-in
+_ReSharper*
+
+# Installshield output folder
+[Ee]xpress
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish
+
+# Others
+[Bb]in
+[Oo]bj
+sql
+TestResults
+*.Cache
+ClientBin
+stylecop.*
+~$*
+*.dbmdl
+Generated_Code #added for RIA/Silverlight projects
+
+# Backup & report files from converting an old project file to a newer
+# Visual Studio version. Backup files are not needed, because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+
+
+
+############
+## Windows
+############
+
+# Windows image file caches
+Thumbs.db
+
+# Folder config file
+Desktop.ini
+
+
+#############
+## Python
+#############
+
+*.py[co]
+
+# Packages
+*.egg
+*.egg-info
+dist
+build
+eggs
+parts
+bin
+var
+sdist
+develop-eggs
+.installed.cfg
+
+# Installer logs
+pip-log.txt
+
+# Unit test / coverage reports
+.coverage
+.tox
+
+#Translations
+*.mo
+
+#Mr Developer
+.mr.developer.cfg
+
+# Mac crap
+.DS_Store
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
+ <PropertyGroup>
+ <ProjectGuid>{07B09DF6-19B0-477A-A8CE-5D7146EEBDFD}</ProjectGuid>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+ <OutputType>Exe</OutputType>
+ <RootNamespace>BaseApiTester</RootNamespace>
+ <AssemblyName>BaseApiTester</AssemblyName>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
+ <NoStdLib>False</NoStdLib>
+ <WarningLevel>4</WarningLevel>
+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <TargetFrameworkProfile />
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Platform)' == 'x86' ">
+ <PlatformTarget>x86</PlatformTarget>
+ <RegisterForComInterop>False</RegisterForComInterop>
+ <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
+ <BaseAddress>4194304</BaseAddress>
+ <FileAlignment>4096</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+ <OutputPath>bin\Debug\</OutputPath>
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>Full</DebugType>
+ <Optimize>False</Optimize>
+ <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+ <OutputPath>bin\Release\</OutputPath>
+ <DebugSymbols>False</DebugSymbols>
+ <DebugType>None</DebugType>
+ <Optimize>True</Optimize>
+ <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
+ <DefineConstants>TRACE</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+ <Prefer32Bit>false</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+ <Prefer32Bit>false</Prefer32Bit>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data" />
+ <Reference Include="System.Data.DataSetExtensions">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Xml.Linq">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="FormattedConsoleLogger.cs" />
+ <Compile Include="Program.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="app.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="phototest.tif">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Tesseract.Net45\Tesseract.Net45.csproj">
+ <Project>{1868cac0-d64c-4092-9108-59d562321056}</Project>
+ <Name>Tesseract.Net45</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>
@@ -0,0 +1,85 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tesseract;
+
+namespace BaseApiTester
+{
+ public class FormattedConsoleLogger
+ {
+ private class Scope : DisposableBase
+ {
+ private int indentLevel;
+ private string indent;
+ private FormattedConsoleLogger container;
+
+ public Scope(FormattedConsoleLogger container, int indentLevel)
+ {
+ this.container = container;
+ this.indentLevel = indentLevel;
+ StringBuilder indent = new StringBuilder();
+ for (int i = 0; i < indentLevel; i++) {
+ indent.Append('\t');
+ }
+ this.indent = indent.ToString();
+ }
+
+ public void Log(string format, object[] args)
+ {
+ var line = String.Format(format, args);
+ Console.WriteLine(indent + line);
+ }
+
+ public Scope Begin()
+ {
+ return new Scope(container, indentLevel + 1);
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing) {
+ var scope = container.scopes.Pop();
+ if (scope != this) {
+ throw new InvalidOperationException("Format scope removed out of order.");
+ }
+ }
+ }
+ }
+
+ private Stack<Scope> scopes = new Stack<Scope>();
+
+ public IDisposable Begin(string title = "", params object[] args)
+ {
+ Log(title, args);
+ Scope scope;
+ if (scopes.Count == 0) {
+ scope = new Scope(this, 1);
+ } else {
+ scope = ActiveScope.Begin();
+ }
+ scopes.Push(scope);
+ return scope;
+ }
+
+ public void Log(string format, params object[] args)
+ {
+ if (scopes.Count > 0) {
+ ActiveScope.Log(format, args);
+ } else {
+ Console.WriteLine(String.Format(format, args));
+ }
+ }
+
+ private Scope ActiveScope
+ {
+ get
+ {
+ var top = scopes.Peek();
+ if (top == null) throw new InvalidOperationException("No current scope");
+ return top;
+ }
+ }
+ }
+}
Oops, something went wrong.

0 comments on commit 92fd41f

Please sign in to comment.