#include <osdetect.h>
Definition at line 94 of file osdetect.h.
Definition at line 448 of file osdetect.cpp.
452 allowed_scripts_ = allowed_scripts;
int add_script(const char *script)
void ScriptDetector::detect_blob |
( |
BLOB_CHOICE_LIST * |
scores | ) |
|
Definition at line 466 of file osdetect.cpp.
468 for (
int i = 0; i < 4; ++i) {
472 BLOB_CHOICE_IT choice_it;
473 choice_it.set_to_list(scores + i);
475 float prev_score = -1;
476 int script_count = 0;
478 int prev_fontinfo_id = -1;
479 const char* prev_unichar =
"";
480 const char* unichar =
"";
482 for (choice_it.mark_cycle_pt(); !choice_it.cycled_list();
483 choice_it.forward()) {
486 if (allowed_scripts_ !=
NULL && !allowed_scripts_->
empty()) {
489 for (s = 0; s < allowed_scripts_->
size(); ++s) {
490 if ((*allowed_scripts_)[s] == id)
break;
492 if (s == allowed_scripts_->
size())
continue;
495 if (done[
id])
continue;
500 if (prev_score < 0) {
504 prev_unichar = unichar;
510 if (strlen(prev_unichar) == 1)
511 if (unichar[0] >=
'0' && unichar[0] <=
'9')
516 if (script_count >= 2)
520 if (script_count == 1) {
525 if (prev_id == latin_id_) {
526 if (prev_fontinfo_id >= 0) {
541 if (prev_id == katakana_id_)
543 if (prev_id == hiragana_id_)
545 if (prev_id == hangul_id_)
547 if (prev_id == han_id_) {
float scripts_na[4][kMaxNumberOfScripts]
const int kMaxNumberOfScripts
const float kHanRatioInKorean
inT16 fontinfo_id() const
const float kNonAmbiguousMargin
const char *const id_to_unichar(UNICHAR_ID id) const
UnicityTable< FontInfo > & get_fontinfo_table()
const float kHanRatioInJapanese
UNICHAR_ID unichar_id() const
bool ScriptDetector::must_stop |
( |
int |
orientation | ) |
|
Definition at line 555 of file osdetect.cpp.
void update_best_script(int orientation_id)
The documentation for this class was generated from the following files: