#include <osdetect.h>
Definition at line 93 of file osdetect.h.
◆ ScriptDetector()
Definition at line 450 of file osdetect.cpp.
454 allowed_scripts_ = allowed_scripts;
int add_script(const char *script)
◆ detect_blob()
void ScriptDetector::detect_blob |
( |
BLOB_CHOICE_LIST * |
scores | ) |
|
Definition at line 468 of file osdetect.cpp.
470 for (
int i = 0; i < 4; ++i) {
474 BLOB_CHOICE_IT choice_it;
475 choice_it.set_to_list(scores + i);
477 float prev_score = -1;
478 int script_count = 0;
480 int prev_fontinfo_id = -1;
481 const char* prev_unichar =
"";
482 const char* unichar =
"";
484 for (choice_it.mark_cycle_pt(); !choice_it.cycled_list();
485 choice_it.forward()) {
488 if (allowed_scripts_ != NULL && !allowed_scripts_->
empty()) {
491 for (s = 0; s < allowed_scripts_->
size(); ++s) {
492 if ((*allowed_scripts_)[s] == id)
break;
494 if (s == allowed_scripts_->
size())
continue;
497 if (done[
id])
continue;
502 if (prev_score < 0) {
506 prev_unichar = unichar;
512 if (strlen(prev_unichar) == 1)
513 if (unichar[0] >=
'0' && unichar[0] <=
'9')
518 if (script_count >= 2)
522 if (script_count == 1) {
527 if (prev_id == latin_id_) {
528 if (prev_fontinfo_id >= 0) {
543 if (prev_id == katakana_id_)
545 if (prev_id == hiragana_id_)
547 if (prev_id == hangul_id_)
549 if (prev_id == han_id_) {
const float kHanRatioInJapanese
float scripts_na[4][kMaxNumberOfScripts]
const float kNonAmbiguousMargin
UNICHAR_ID unichar_id() const
const int kMaxNumberOfScripts
const float kHanRatioInKorean
inT16 fontinfo_id() const
UnicityTable< FontInfo > & get_fontinfo_table()
const char * id_to_unichar(UNICHAR_ID id) const
◆ must_stop()
bool ScriptDetector::must_stop |
( |
int |
orientation | ) |
|
Definition at line 557 of file osdetect.cpp.
void update_best_script(int orientation_id)
The documentation for this class was generated from the following files: