Skip to content

Commit

Permalink
Ability to direct output to a file or disable it.
Browse files Browse the repository at this point in the history
By setting `debug_file`.
  • Loading branch information
emil2k committed Nov 20, 2018
1 parent c7e7358 commit 91bb65c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ func (client *Client) SetLanguage(langs ...string) error {
return nil
}

func (client *Client) DisableOutput() error {
return client.SetVariable(DEBUG_FILE, os.DevNull)
}

// SetWhitelist sets whitelist chars.
// See official documentation for whitelist here https://github.com/tesseract-ocr/tesseract/wiki/ImproveQuality#dictionaries-word-lists-and-patterns
func (client *Client) SetWhitelist(whitelist string) error {
Expand Down
2 changes: 2 additions & 0 deletions constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ type SettableVariable string
// Followings are variables which can be used for TessBaseAPI::SetVariable.
// If anything missing (I know there are many), please add one below.
const (
// DEBUG_FILE - File to send output to.
DEBUG_FILE SettableVariable = "debug_file"
// TESSEDIT_CHAR_WHITELIST - Whitelist of chars to recognize
// There is a known issue in 4.00 with LSTM
// https://github.com/tesseract-ocr/tesseract/issues/751
Expand Down

0 comments on commit 91bb65c

Please sign in to comment.