#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;
◆ detect_blob()
void ScriptDetector::detect_blob |
( |
BLOB_CHOICE_LIST * |
scores | ) |
|
Definition at line 471 of file osdetect.cpp.
472 for (
int i = 0; i < 4; ++i) {
475 BLOB_CHOICE_IT choice_it;
476 choice_it.set_to_list(scores + i);
478 float prev_score = -1;
479 int script_count = 0;
481 int prev_fontinfo_id = -1;
482 const char* prev_unichar =
"";
483 const char* unichar =
"";
485 for (choice_it.mark_cycle_pt(); !choice_it.cycled_list();
486 choice_it.forward()) {
489 if (allowed_scripts_ !=
nullptr && !allowed_scripts_->
empty()) {
492 for (s = 0; s < allowed_scripts_->
size(); ++s) {
493 if ((*allowed_scripts_)[s] ==
id)
break;
495 if (s == allowed_scripts_->
size())
continue;
498 if (done[
id])
continue;
503 if (prev_score < 0) {
507 prev_unichar = unichar;
513 if (strlen(prev_unichar) == 1)
514 if (unichar[0] >=
'0' && unichar[0] <=
'9')
519 if (script_count >= 2)
523 if (script_count == 1) {
528 if (prev_id == latin_id_) {
529 if (prev_fontinfo_id >= 0) {
544 if (prev_id == katakana_id_)
546 if (prev_id == hiragana_id_)
548 if (prev_id == hangul_id_)
550 if (prev_id == han_id_) {
◆ must_stop()
bool ScriptDetector::must_stop |
( |
int |
orientation | ) |
|
The documentation for this class was generated from the following files: