#include <osdetect.h>
Definition at line 95 of file osdetect.h.
◆ ScriptDetector()
Definition at line 453 of file osdetect.cpp.
457 allowed_scripts_ = allowed_scripts;
int add_script(const char *script)
◆ detect_blob()
void ScriptDetector::detect_blob |
( |
BLOB_CHOICE_LIST * |
scores | ) |
|
Definition at line 471 of file osdetect.cpp.
473 for (
int i = 0; i < 4; ++i) {
477 BLOB_CHOICE_IT choice_it;
478 choice_it.set_to_list(scores + i);
480 float prev_score = -1;
481 int script_count = 0;
483 int prev_fontinfo_id = -1;
484 const char* prev_unichar =
"";
485 const char* unichar =
"";
487 for (choice_it.mark_cycle_pt(); !choice_it.cycled_list();
488 choice_it.forward()) {
491 if (allowed_scripts_ !=
nullptr && !allowed_scripts_->
empty()) {
494 for (s = 0; s < allowed_scripts_->
size(); ++s) {
495 if ((*allowed_scripts_)[s] == id)
break;
497 if (s == allowed_scripts_->
size())
continue;
500 if (done[
id])
continue;
505 if (prev_score < 0) {
509 prev_unichar = unichar;
515 if (strlen(prev_unichar) == 1)
516 if (unichar[0] >=
'0' && unichar[0] <=
'9')
521 if (script_count >= 2)
525 if (script_count == 1) {
530 if (prev_id == latin_id_) {
531 if (prev_fontinfo_id >= 0) {
546 if (prev_id == katakana_id_)
548 if (prev_id == hiragana_id_)
550 if (prev_id == hangul_id_)
552 if (prev_id == han_id_) {
UnicityTable< FontInfo > & get_fontinfo_table()
float scripts_na[4][kMaxNumberOfScripts]
int16_t fontinfo_id() const
const int kMaxNumberOfScripts
const float kHanRatioInJapanese
const char * id_to_unichar(UNICHAR_ID id) const
UNICHAR_ID unichar_id() const
const float kNonAmbiguousMargin
const float kHanRatioInKorean
◆ must_stop()
bool ScriptDetector::must_stop |
( |
int |
orientation | ) |
|
Definition at line 560 of file osdetect.cpp.
void update_best_script(int orientation_id)
The documentation for this class was generated from the following files: