#include <permute.h>
Definition at line 113 of file permute.h.
| tesseract::PermuterState::PermuterState |
( |
| ) |
|
Definition at line 231 of file permute.cpp.
233 char_choices_ =
NULL;
234 adjust_factor_ = 1.0f;
235 allow_collision_ =
false;
| void tesseract::PermuterState::AddPreference |
( |
int |
start_pos, |
|
|
char * |
pos_str, |
|
|
float |
weight |
|
) |
| |
Definition at line 266 of file permute.cpp.
268 ASSERT_HOST(start_pos + strlen(pos_str) - 1 < word_length_);
270 tprintf(
"Copy over %s -> %s @ %d ", pos_str, perm_state_, start_pos);
273 if (!allow_collision_) {
274 int len = strlen(pos_str);
275 for (
int i = 0; i < len; ++i)
278 strncpy(&perm_state_[start_pos], pos_str, strlen(pos_str));
279 adjust_factor_ *= weight;
280 if (debug_)
tprintf(
"==> %s %f\n", perm_state_, adjust_factor_);
DLLSYM void tprintf(const char *format,...)
bool position_marked(int pos)
| void tesseract::PermuterState::AddPreference |
( |
int |
char_pos, |
|
|
BLOB_CHOICE * |
blob_choice, |
|
|
float |
weight |
|
) |
| |
Definition at line 284 of file permute.cpp.
292 tprintf(
"Set UID %d -> %s @ %d ",
293 blob_choice->
unichar_id(), perm_state_, char_pos);
297 perm_state_[char_pos] = pos +
'0';
298 adjust_factor_ *= weight;
299 if (debug_)
tprintf(
"==> %s %f\n", perm_state_, adjust_factor_);
int find_choice_by_uid(BLOB_CHOICE_LIST *blob_list, UNICHAR_ID target_uid)
UNICHAR_ID unichar_id() const
DLLSYM void tprintf(const char *format,...)
bool position_marked(int pos)
| WERD_CHOICE * tesseract::PermuterState::GetPermutedWord |
( |
float * |
certainties, |
|
|
float * |
adjust_factor |
|
) |
| |
Definition at line 303 of file permute.cpp.
307 unicharset_, *char_choices_, 0, perm_state_, certainties);
308 float rating = word_choice->
rating() * adjust_factor_;
310 *adjust_factor = adjust_factor_;
void set_rating(float new_val)
WERD_CHOICE * get_choice_from_posstr(const UNICHARSET *unicharset, const BLOB_CHOICE_LIST_VECTOR &char_choices, int start_pos, const char *pos_str, float *certainties)
Definition at line 240 of file permute.cpp.
245 unicharset_ = &unicharset;
246 char_choices_ = &char_choices;
247 word_length_ = char_choices.
length();
248 for (
int i = 0; i < word_length_; ++i)
249 perm_state_[i] = kPosFree;
250 perm_state_[word_length_] =
'\0';
252 for (
int i = 0; i < word_length_; ++i) {
255 perm_state_[i] =
'1';
257 adjust_factor_ = default_bias;
258 allow_collision_ =
false;
UNICHAR_ID get_top_choice_uid(BLOB_CHOICE_LIST *blob_list)
const CHAR_FRAGMENT * get_fragment(UNICHAR_ID unichar_id) const
| bool tesseract::PermuterState::position_marked |
( |
int |
pos | ) |
|
|
inline |
Definition at line 131 of file permute.h.
131 {
return perm_state_[pos] != kPosFree; }
| void tesseract::PermuterState::set_adjust_factor |
( |
float |
factor | ) |
|
|
inline |
Definition at line 129 of file permute.h.
129 { adjust_factor_ = factor; }
| void tesseract::PermuterState::set_allow_collision |
( |
bool |
flag | ) |
|
|
inline |
Definition at line 128 of file permute.h.
128 { allow_collision_ = flag; }
| void tesseract::PermuterState::set_debug |
( |
bool |
debug | ) |
|
|
inline |
The documentation for this class was generated from the following files:
- /home/abuild/rpmbuild/BUILD/tesseract-ocr-3.02.02/dict/permute.h
- /home/abuild/rpmbuild/BUILD/tesseract-ocr-3.02.02/dict/permute.cpp