471 {
472 for (int i = 0; i < 4; ++i) {
474
475 BLOB_CHOICE_IT choice_it;
476 choice_it.set_to_list(scores + i);
477
478 float prev_score = -1;
479 int script_count = 0;
480 int prev_id = -1;
481 int prev_fontinfo_id = -1;
482 const char* prev_unichar = "";
483 const char* unichar = "";
484
485 for (choice_it.mark_cycle_pt(); !choice_it.cycled_list();
486 choice_it.forward()) {
489 if (allowed_scripts_ !=
nullptr && !allowed_scripts_->
empty()) {
490
491 int s = 0;
492 for (s = 0; s < allowed_scripts_->
size(); ++s) {
493 if ((*allowed_scripts_)[s] == id) break;
494 }
495 if (s == allowed_scripts_->
size())
continue;
496 }
497
498 if (done[id]) continue;
499 done[id] = true;
500
502
503 if (prev_score < 0) {
505 script_count = 1;
506 prev_id = id;
507 prev_unichar = unichar;
510 ++script_count;
511 }
512
513 if (strlen(prev_unichar) == 1)
514 if (unichar[0] >= '0' && unichar[0] <= '9')
515 break;
516
517
518
519 if (script_count >= 2)
520 break;
521 }
522
523 if (script_count == 1) {
524
526
527
528 if (prev_id == latin_id_) {
529 if (prev_fontinfo_id >= 0) {
532
533
534
535
539 }
540 }
541 }
542
543
544 if (prev_id == katakana_id_)
546 if (prev_id == hiragana_id_)
548 if (prev_id == hangul_id_)
550 if (prev_id == han_id_) {
553 }
554 }
555 }
556}
const float kNonAmbiguousMargin
const float kHanRatioInJapanese
const float kHanRatioInKorean
const int kMaxNumberOfScripts
float scripts_na[4][kMaxNumberOfScripts]
int16_t fontinfo_id() const
UNICHAR_ID unichar_id() const
const char * id_to_unichar(UNICHAR_ID id) const
UnicityTable< FontInfo > & get_fontinfo_table()