#include <osdetect.h>
Definition at line 93 of file osdetect.h.
◆ ScriptDetector()
Definition at line 447 of file osdetect.cpp.
451 allowed_scripts_ = allowed_scripts;
int add_script(const char *script)
◆ detect_blob()
void ScriptDetector::detect_blob |
( |
BLOB_CHOICE_LIST * |
scores | ) |
|
Definition at line 465 of file osdetect.cpp.
467 for (
int i = 0; i < 4; ++i) {
471 BLOB_CHOICE_IT choice_it;
472 choice_it.set_to_list(scores + i);
474 float prev_score = -1;
475 int script_count = 0;
477 int prev_fontinfo_id = -1;
478 const char* prev_unichar =
"";
479 const char* unichar =
"";
481 for (choice_it.mark_cycle_pt(); !choice_it.cycled_list();
482 choice_it.forward()) {
485 if (allowed_scripts_ != NULL && !allowed_scripts_->
empty()) {
488 for (s = 0; s < allowed_scripts_->
size(); ++s) {
489 if ((*allowed_scripts_)[s] == id)
break;
491 if (s == allowed_scripts_->
size())
continue;
494 if (done[
id])
continue;
499 if (prev_score < 0) {
503 prev_unichar = unichar;
509 if (strlen(prev_unichar) == 1)
510 if (unichar[0] >=
'0' && unichar[0] <=
'9')
515 if (script_count >= 2)
519 if (script_count == 1) {
524 if (prev_id == latin_id_) {
525 if (prev_fontinfo_id >= 0) {
540 if (prev_id == katakana_id_)
542 if (prev_id == hiragana_id_)
544 if (prev_id == hangul_id_)
546 if (prev_id == han_id_) {
const float kHanRatioInJapanese
const float kNonAmbiguousMargin
float scripts_na[4][kMaxNumberOfScripts]
UNICHAR_ID unichar_id() const
const float kHanRatioInKorean
UnicityTable< FontInfo > & get_fontinfo_table()
const int kMaxNumberOfScripts
inT16 fontinfo_id() const
const char * id_to_unichar(UNICHAR_ID id) const
◆ must_stop()
bool ScriptDetector::must_stop |
( |
int |
orientation | ) |
|
Definition at line 554 of file osdetect.cpp.
void update_best_script(int orientation_id)
The documentation for this class was generated from the following files:
- /home/stweil/src/github/tesseract-ocr/tesseract/ccmain/osdetect.h
- /home/stweil/src/github/tesseract-ocr/tesseract/ccmain/osdetect.cpp