Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for PrintVariablesToFile #256

Closed
pa-hobe opened this issue Mar 17, 2016 · 2 comments
Closed

Support for PrintVariablesToFile #256

pa-hobe opened this issue Mar 17, 2016 · 2 comments
Assignees

Comments

@pa-hobe
Copy link
Contributor

pa-hobe commented Mar 17, 2016

This is a feature request to support Tesseract's PrintVariablesToFile. The suggested code is:

  • Changes for Interop/BaseApi.cs:
--- org/Interop/BaseApi.cs  2016-03-17 15:40:49.861680100 +0100
+++ new/Interop/BaseApi.cs  2016-03-17 15:42:43.961798600 +0100
@@ -211,6 +211,9 @@
         float ChoiceIteratorGetConfidence(HandleRef handle);

         #endregion
+
+        [RuntimeDllImport(Constants.TesseractDllName, CallingConvention = CallingConvention.Cdecl, EntryPoint = "TessBaseAPIPrintVariablesToFile")]
+        int BaseApiPrintVariablesToFile(HandleRef handle, string filename); 
    }

    internal static class TessApi

  • Changes for TesseractEngine.cs:
--- org/TesseractEngine.cs  2016-03-17 15:41:43.378254300 +0100
+++ new/TesseractEngine.cs  2016-03-17 15:43:23.605952400 +0100
@@ -529,6 +529,16 @@
             return value != null;
         }

+        /// <summary>
+        /// Attempts to print the variables to the file.
+        /// </summary>
+        /// <param name="filename"></param>
+        /// <returns></returns>
+        public bool TryPrintVariablesToFile(string filename)
+        {
+            return Interop.TessApi.Native.BaseApiPrintVariablesToFile(handle, filename) != 0;
+        }
+
         #endregion Config

         #region Event Handlers

@charlesw
Copy link
Owner

Looks good, any chance of a pull request?
On 17 Mar 2016 15:49, "Heiko Oberdiek" [email protected] wrote:

This is a feature request to support Tesseract's PrintVariablesToFile. The
suggested code is:

  • Changes for Interop/BaseApi.cs:

--- org/Interop/BaseApi.cs 2016-03-17 15:40:49.861680100 +0100
+++ new/Interop/BaseApi.cs 2016-03-17 15:42:43.961798600 +0100
@@ -211,6 +211,9 @@
float ChoiceIteratorGetConfidence(HandleRef handle);

     #endregion
  •    [RuntimeDllImport(Constants.TesseractDllName, CallingConvention = CallingConvention.Cdecl, EntryPoint = "TessBaseAPIPrintVariablesToFile")]
    
  •    int BaseApiPrintVariablesToFile(HandleRef handle, string filename);
    

    }

    internal static class TessApi

    • Changes for TesseractEngine.cs:

--- org/TesseractEngine.cs 2016-03-17 15:41:43.378254300 +0100
+++ new/TesseractEngine.cs 2016-03-17 15:43:23.605952400 +0100
@@ -529,6 +529,16 @@
return value != null;
}

  •    /// <summary>
    
  •    /// Attempts to print the variables to the file.
    
  •    /// </summary>
    
  •    /// <param name="filename"></param>
    
  •    /// <returns></returns>
    
  •    public bool TryPrintVariablesToFile(string filename)
    
  •    {
    
  •        return Interop.TessApi.Native.BaseApiPrintVariablesToFile(handle, filename) != 0;
    
  •    }
    
    • #endregion Config
     #region Event Handlers
    


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#256

@charlesw
Copy link
Owner

charlesw commented May 7, 2016

Pull request #257 has now been merged into develop and will be included in the next release.

@charlesw charlesw closed this as completed May 7, 2016
@charlesw charlesw self-assigned this May 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants