38 static const char kSeparator =
'|';
40 static const char kNaturalFlag =
'n';
42 static const int ISALPHA_MASK = 0x1;
43 static const int ISLOWER_MASK = 0x2;
44 static const int ISUPPER_MASK = 0x4;
45 static const int ISDIGIT_MASK = 0x8;
46 static const int ISPUNCTUATION_MASK = 0x10;
51 static const int kMeanlineThreshold = 220;
74 const char* UNICHARSET::kCleanupMaps[][2] = {
87 const char* UNICHARSET::null_script =
"NULL";
89 UNICHARSET::UNICHAR_PROPERTIES::UNICHAR_PROPERTIES() {
94 void UNICHARSET::UNICHAR_PROPERTIES::Init() {
99 ispunctuation =
false;
113 void UNICHARSET::UNICHAR_PROPERTIES::SetRangesOpen() {
115 max_bottom = UINT8_MAX;
127 void UNICHARSET::UNICHAR_PROPERTIES::SetRangesEmpty() {
128 min_bottom = UINT8_MAX;
142 bool UNICHARSET::UNICHAR_PROPERTIES::AnyRangeEmpty()
const {
143 return width == 0.0f || advance == 0.0f;
147 void UNICHARSET::UNICHAR_PROPERTIES::ExpandRangesFrom(
148 const UNICHAR_PROPERTIES& src) {
149 UpdateRange(src.min_bottom, &min_bottom, &max_bottom);
150 UpdateRange(src.max_bottom, &min_bottom, &max_bottom);
153 if (src.width_sd > width_sd) {
155 width_sd = src.width_sd;
157 if (src.bearing_sd > bearing_sd) {
158 bearing = src.bearing;
159 bearing_sd = src.bearing_sd;
161 if (src.advance_sd > advance_sd) {
162 advance = src.advance;
163 advance_sd = src.advance_sd;
168 void UNICHARSET::UNICHAR_PROPERTIES::CopyFrom(
const UNICHAR_PROPERTIES& src) {
172 fragment = saved_fragment;
180 script_table(nullptr),
181 script_table_size_used(0) {
195 if (unichars_number > size_reserved) {
196 UNICHAR_SLOT* unichars_new =
new UNICHAR_SLOT[unichars_number];
197 for (
int i = 0; i < size_used; ++i)
198 unichars_new[i] = unichars[i];
199 for (
int j = size_used; j < unichars_number; ++j) {
200 unichars_new[j].properties.script_id =
add_script(null_script);
203 unichars = unichars_new;
204 size_reserved = unichars_number;
210 std::string cleaned =
211 old_style_included_ ? unichar_repr :
CleanupString(unichar_repr);
212 return ids.
contains(cleaned.data(), cleaned.size())
214 : INVALID_UNICHAR_ID;
220 std::string cleaned(unichar_repr, length);
221 if (!old_style_included_) cleaned =
CleanupString(unichar_repr, length);
222 return ids.
contains(cleaned.data(), cleaned.size())
224 : INVALID_UNICHAR_ID;
236 if (encoding.
empty() || encoding[0] == INVALID_UNICHAR_ID)
return 0;
244 int *first_bad_position)
const {
246 return encode_string(str,
true, &encoding,
nullptr, first_bad_position);
261 int* encoded_length)
const {
266 int str_length = strlen(str);
269 while (str_pos < str_length) {
270 encode_string(str, str_pos, str_length, &working_encoding, &working_lengths,
271 &str_pos, encoding, &best_lengths);
272 if (str_pos < str_length) {
275 if (give_up_on_failure)
break;
276 int step = UNICHAR::utf8_step(str + str_pos);
281 working_encoding = *encoding;
282 working_lengths = best_lengths;
285 if (lengths !=
nullptr) *lengths = best_lengths;
286 if (encoded_length !=
nullptr) *encoded_length = str_pos;
291 if (
id == INVALID_UNICHAR_ID) {
292 return INVALID_UNICHAR;
295 return unichars[id].representation;
299 if (
id == INVALID_UNICHAR_ID) {
300 return INVALID_UNICHAR;
313 return unichars[id].representation;
323 for (
int i = 0; str[i] !=
'\0'; i +=
step) {
324 char hex[
sizeof(int) * 2 + 1];
325 step = UNICHAR::utf8_step(str + i);
328 sprintf(hex,
"%x", str[i]);
373 unichars[unichar_id].properties.normed_ids.truncate(0);
375 unichars[unichar_id].properties.normed_ids.push_back(
UNICHAR_SPACE);
376 }
else if (!
encode_string(unichars[unichar_id].properties.normed.string(),
377 true, &unichars[unichar_id].properties.normed_ids,
379 unichars[unichar_id].properties.normed_ids.truncate(0);
380 unichars[unichar_id].properties.normed_ids.push_back(unichar_id);
390 return (uni >= 0xE000 && uni <= 0xF8FF);
396 for (
int id = 0;
id < size_used; ++id) {
397 unichars[id].properties.SetRangesEmpty();
406 for (
int ch = start_index; ch < size_used; ++ch) {
408 UNICHAR_PROPERTIES properties;
409 if (src.GetStrProperties(utf8, &properties)) {
413 const char* other_case = src.
id_to_unichar(properties.other_case);
417 properties.other_case = ch;
419 const char* mirror_str = src.
id_to_unichar(properties.mirror);
423 properties.mirror = ch;
425 unichars[ch].properties.CopyFrom(properties);
435 for (
int ch = 0; ch < size_used; ++ch) {
437 UNICHAR_PROPERTIES properties;
438 if (src.GetStrProperties(utf8, &properties)) {
440 unichars[ch].properties.ExpandRangesFrom(properties);
449 for (
int ch = 0; ch < src.size_used; ++ch) {
450 const UNICHAR_PROPERTIES& src_props = src.unichars[ch].properties;
453 unichars[ch].properties.ExpandRangesFrom(src_props);
464 int initial_used = size_used;
465 for (
int ch = 0; ch < src.size_used; ++ch) {
466 const UNICHAR_PROPERTIES& src_props = src.unichars[ch].properties;
472 unichars[id].properties.ExpandRangesFrom(src_props);
475 unichars[id].properties.SetRangesEmpty();
486 int overlap = std::min(unichars[id1].properties.max_top,
487 unichars[id2].properties.max_top) -
488 std::max(unichars[id1].properties.min_top,
489 unichars[id2].properties.min_top);
504 int* best_total_length,
507 if (str_index > *best_total_length) {
509 *best_total_length = str_index;
510 *best_encoding = *encoding;
511 if (best_lengths !=
nullptr)
512 *best_lengths = *lengths;
514 if (str_index == str_length)
return;
515 int encoding_index = encoding->
size();
517 int length = ids.
minmatch(str + str_index);
518 if (length == 0 || str_index + length > str_length)
return;
520 if (ids.
contains(str + str_index, length)) {
525 encode_string(str, str_index + length, str_length, encoding, lengths,
526 best_total_length, best_encoding, best_lengths);
527 if (*best_total_length == str_length)
533 int step = UNICHAR::utf8_step(str + str_index + length);
536 }
while (length <=
UNICHAR_LEN && str_index + length <= str_length);
544 bool UNICHARSET::GetStrProperties(
const char* utf8_str,
545 UNICHAR_PROPERTIES* props)
const {
547 props->SetRangesEmpty();
548 int total_unicodes = 0;
550 if (!
encode_string(utf8_str,
true, &encoding,
nullptr,
nullptr))
552 for (
int i = 0; i < encoding.
size(); ++i) {
553 int id = encoding[i];
554 const UNICHAR_PROPERTIES& src_props = unichars[id].properties;
556 if (src_props.isalpha) props->isalpha =
true;
557 if (src_props.islower) props->islower =
true;
558 if (src_props.isupper) props->isupper =
true;
559 if (src_props.isdigit) props->isdigit =
true;
560 if (src_props.ispunctuation) props->ispunctuation =
true;
561 if (src_props.isngram) props->isngram =
true;
562 if (src_props.enabled) props->enabled =
true;
564 UpdateRange(src_props.min_bottom, &props->min_bottom, &props->max_bottom);
565 UpdateRange(src_props.max_bottom, &props->min_bottom, &props->max_bottom);
566 UpdateRange(src_props.min_top, &props->min_top, &props->max_top);
567 UpdateRange(src_props.max_top, &props->min_top, &props->max_top);
568 float bearing = props->advance + src_props.bearing;
569 if (total_unicodes == 0 || bearing < props->bearing) {
570 props->bearing = bearing;
571 props->bearing_sd = props->advance_sd + src_props.bearing_sd;
573 props->advance += src_props.advance;
574 props->advance_sd += src_props.advance_sd;
576 props->width = src_props.width;
577 props->width_sd = src_props.width_sd;
580 if (total_unicodes == 0) {
581 props->script_id = src_props.script_id;
582 props->other_case = src_props.other_case;
583 props->mirror = src_props.mirror;
584 props->direction = src_props.direction;
588 props->normed += src_props.normed;
591 if (total_unicodes > 1) {
593 props->width = props->advance - props->bearing;
594 props->width_sd = props->advance_sd + props->bearing_sd;
596 return total_unicodes > 0;
602 unsigned int properties = 0;
604 properties |= ISALPHA_MASK;
606 properties |= ISLOWER_MASK;
608 properties |= ISUPPER_MASK;
610 properties |= ISDIGIT_MASK;
612 properties |= ISPUNCTUATION_MASK;
628 std::string cleaned =
629 old_style_included_ ? unichar_repr :
CleanupString(unichar_repr);
630 if (!cleaned.empty() && !ids.
contains(cleaned.data(), cleaned.size())) {
631 const char* str = cleaned.c_str();
633 if (!old_style_included_ &&
636 if (size_used == size_reserved) {
645 fprintf(stderr,
"Utf8 buffer too big, size>%d for %s\n",
UNICHAR_LEN,
649 unichars[size_used].representation[index++] = *str++;
650 }
while (*str !=
'\0');
651 unichars[size_used].representation[index] =
'\0';
659 this->unichars[size_used].properties.fragment = frag;
661 this->unichars[size_used].properties.script_id =
664 this->unichars[size_used].properties.enabled =
true;
665 ids.
insert(unichars[size_used].representation, size_used);
671 std::string cleaned =
672 old_style_included_ ? unichar_repr :
CleanupString(unichar_repr);
673 return ids.
contains(cleaned.data(), cleaned.size());
681 std::string cleaned(unichar_repr, length);
682 if (!old_style_included_) cleaned =
CleanupString(unichar_repr, length);
683 return ids.
contains(cleaned.data(), cleaned.size());
687 const char*
const unichar_repr)
const {
688 return strcmp(this->
id_to_unichar(unichar_id), unichar_repr) == 0;
692 const int kFileBufSize = 1024;
693 char buffer[kFileBufSize + 1];
694 snprintf(buffer, kFileBufSize,
"%d\n", this->
size());
697 int min_bottom, max_bottom, min_top, max_top;
699 float width, width_sd;
701 float bearing, bearing_sd;
703 float advance, advance_sd;
707 snprintf(buffer, kFileBufSize,
"%s %x %s %d\n",
"NULL", properties,
711 snprintf(buffer, kFileBufSize,
712 "%s %x %d,%d,%d,%d,%g,%g,%g,%g,%g,%g %s %d %d %d %s\t# %s\n",
714 min_bottom, max_bottom, min_top, max_top, width, width_sd,
715 bearing, bearing_sd, advance, advance_sd,
730 : memory_(memory), fgets_ptr_(memory), mem_size_(mem_size) { }
732 char *
fgets(
char *orig_dst,
int size) {
733 const char *src_end = memory_ + mem_size_;
734 char *dst_end = orig_dst + size - 1;
736 return fgets_ptr_ < src_end ? orig_dst :
nullptr;
739 char *dst = orig_dst;
741 while (fgets_ptr_ < src_end && dst < dst_end && ch !=
'\n') {
742 ch = *dst++ = *fgets_ptr_++;
745 return (dst == orig_dst) ? nullptr : orig_dst;
750 const char *fgets_ptr_;
755 const char *memory,
int mem_size,
bool skip_fragments) {
759 bool success = load_via_fgets(fgets_cb, skip_fragments);
768 return ::fgets(dst, size, fp_);
778 bool success = load_via_fgets(fgets_cb, skip_fragments);
786 bool success = load_via_fgets(fgets_cb, skip_fragments);
791 bool UNICHARSET::load_via_fgets(
793 bool skip_fragments) {
798 if (fgets_cb->
Run(buffer,
sizeof(buffer)) ==
nullptr ||
799 sscanf(buffer,
"%d", &unicharset_size) != 1) {
802 this->
reserve(unicharset_size);
803 for (
UNICHAR_ID id = 0;
id < unicharset_size; ++id) {
805 unsigned int properties;
808 strncpy(script, null_script,
sizeof(script));
810 int max_bottom = UINT8_MAX;
812 int max_top = UINT8_MAX;
814 float width_sd = 0.0f;
815 float bearing = 0.0f;
816 float bearing_sd = 0.0f;
817 float advance = 0.0f;
818 float advance_sd = 0.0f;
826 if (fgets_cb->
Run(buffer, sizeof (buffer)) ==
nullptr ||
828 "%s %x %d,%d,%d,%d,%g,%g,%g,%g,%g,%g %63s %d %d %d %63s",
829 unichar, &properties,
830 &min_bottom, &max_bottom, &min_top, &max_top,
831 &width, &width_sd, &bearing, &bearing_sd,
832 &advance, &advance_sd, script, &other_case,
835 "%s %x %d,%d,%d,%d,%g,%g,%g,%g,%g,%g %63s %d %d %d",
836 unichar, &properties,
837 &min_bottom, &max_bottom, &min_top, &max_top,
838 &width, &width_sd, &bearing, &bearing_sd,
839 &advance, &advance_sd, script, &other_case,
841 (v = sscanf(buffer,
"%s %x %d,%d,%d,%d %63s %d %d %d",
842 unichar, &properties,
843 &min_bottom, &max_bottom, &min_top, &max_top,
844 script, &other_case, &
direction, &mirror)) != 10 &&
845 (v = sscanf(buffer,
"%s %x %d,%d,%d,%d %63s %d", unichar, &properties,
846 &min_bottom, &max_bottom, &min_top, &max_top,
847 script, &other_case)) != 8 &&
848 (v = sscanf(buffer,
"%s %x %63s %d", unichar, &properties,
849 script, &other_case)) != 4 &&
850 (v = sscanf(buffer,
"%s %x %63s",
851 unichar, &properties, script)) != 3 &&
852 (v = sscanf(buffer,
"%s %x", unichar, &properties)) != 2)) {
866 if (strcmp(unichar,
"NULL") == 0)
878 this->unichars[id].properties.enabled =
true;
879 this->
set_top_bottom(
id, min_bottom, max_bottom, min_top, max_top);
885 id, (v > 3 && other_case < unicharset_size) ? other_case :
id);
886 this->
set_mirror(
id, (v > 8 && mirror < unicharset_size) ? mirror :
id);
887 this->
set_normed(
id, (v>16) ? normed : unichar);
899 int net_case_alphas = 0;
900 int x_height_alphas = 0;
901 int cap_height_alphas = 0;
902 top_bottom_set_ =
false;
903 for (
UNICHAR_ID id = 0;
id < size_used; ++id) {
905 int max_bottom = UINT8_MAX;
907 int max_top = UINT8_MAX;
910 top_bottom_set_ =
true;
916 if (min_top < kMeanlineThreshold && max_top < kMeanlineThreshold)
918 else if (min_top > kMeanlineThreshold && max_top > kMeanlineThreshold)
924 script_has_upper_lower_ = net_case_alphas > 0;
925 script_has_xheight_ = script_has_upper_lower_ ||
943 int* script_counts =
new int[script_table_size_used];
944 memset(script_counts, 0,
sizeof(*script_counts) * script_table_size_used);
945 for (
int id = 0;
id < size_used; ++id) {
951 for (
int s = 1; s < script_table_size_used; ++s) {
952 if (script_counts[s] > script_counts[default_sid_] && s != common_sid_)
955 delete [] script_counts;
965 for (
int id = 0;
id < size_used; ++id) {
972 return rtl_count > ltr_count;
980 const char* whitelist,
981 const char* unblacklist) {
982 bool def_enabled = whitelist ==
nullptr || whitelist[0] ==
'\0';
984 for (
int ch = 0; ch < size_used; ++ch)
985 unichars[ch].properties.enabled = def_enabled;
989 encode_string(whitelist,
false, &encoding,
nullptr,
nullptr);
990 for (
int i = 0; i < encoding.
size(); ++i) {
991 if (encoding[i] != INVALID_UNICHAR_ID)
992 unichars[encoding[i]].properties.enabled =
true;
995 if (blacklist !=
nullptr && blacklist[0] !=
'\0') {
998 encode_string(blacklist,
false, &encoding,
nullptr,
nullptr);
999 for (
int i = 0; i < encoding.
size(); ++i) {
1000 if (encoding[i] != INVALID_UNICHAR_ID)
1001 unichars[encoding[i]].properties.enabled =
false;
1004 if (unblacklist !=
nullptr && unblacklist[0] !=
'\0') {
1007 encode_string(unblacklist,
false, &encoding,
nullptr,
nullptr);
1008 for (
int i = 0; i < encoding.
size(); ++i) {
1009 if (encoding[i] != INVALID_UNICHAR_ID)
1010 unichars[encoding[i]].properties.enabled =
true;
1020 for (
int id = start_id;
id < size_used; ++id) {
1023 for (
int u = 1; u < unicodes.size(); ++u) {
1024 if (unicodes[u - 1] == unicodes[u])
return true;
1031 for (
int i = 0; i < script_table_size_used; ++i) {
1032 if (strcmp(script, script_table[i]) == 0)
1035 if (script_table_size_reserved == 0) {
1036 script_table_size_reserved = 8;
1037 script_table =
new char*[script_table_size_reserved];
1038 }
else if (script_table_size_used >= script_table_size_reserved) {
1039 assert(script_table_size_used == script_table_size_reserved);
1040 script_table_size_reserved += script_table_size_reserved;
1041 char** new_script_table =
new char*[script_table_size_reserved];
1042 memcpy(new_script_table, script_table,
1043 script_table_size_used *
sizeof(
char*));
1044 delete[] script_table;
1045 script_table = new_script_table;
1047 script_table[script_table_size_used] =
new char[strlen(script) + 1];
1048 strcpy(script_table[script_table_size_used], script);
1049 return script_table_size_used++;
1056 if (total == 1)
return STRING(unichar);
1058 result += kSeparator;
1061 snprintf(buffer,
kMaxLen,
"%c%d%c%d", kSeparator, pos,
1062 natural ? kNaturalFlag : kSeparator, total);
1068 const char *ptr = string;
1069 int len = strlen(
string);
1070 if (len <
kMinLen || *ptr != kSeparator) {
1075 while ((ptr + step) < (
string + len) && *(ptr + step) != kSeparator) {
1076 step += UNICHAR::utf8_step(ptr + step);
1082 strncpy(unichar, ptr, step);
1083 unichar[step] =
'\0';
1087 bool natural =
false;
1088 char *end_ptr =
nullptr;
1089 for (
int i = 0; i < 2; i++) {
1090 if (ptr >
string + len || *ptr != kSeparator) {
1091 if (i == 1 && *ptr == kNaturalFlag)
1097 i == 0 ? pos =
static_cast<int>(strtol(ptr, &end_ptr, 10))
1098 : total = static_cast<int>(strtol(ptr, &end_ptr, 10));
1101 if (ptr !=
string + len) {
1105 fragment->
set_all(unichar, pos, total, natural);
1110 for (
int i = 0; i < script_table_size_used; ++i) {
1111 if (strcmp(script_name, script_table[i]) == 0)
1122 result.reserve(length);
1124 while ((ch = *utf8_str) !=
'\0' && length-- > 0) {
1127 while ((key = kCleanupMaps[key_index][0]) !=
nullptr) {
1129 while (key[match] !=
'\0' && key[match] == utf8_str[match]) ++match;
1130 if (key[match] ==
'\0') {
1136 if (key ==
nullptr) {
1137 result.push_back(ch);
1140 result.append(kCleanupMaps[key_index][1]);
static TESS_API const char * kSpecialUnicharCodes[SPECIAL_UNICHAR_CODES_COUNT]
void set_isalpha(UNICHAR_ID unichar_id, bool value)
void PartialSetPropertiesFromOther(int start_index, const UNICHARSET &src)
bool get_islower(UNICHAR_ID unichar_id) const
bool get_ispunctuation(UNICHAR_ID unichar_id) const
bool encode_string(const char *str, bool give_up_on_failure, GenericVector< UNICHAR_ID > *encoding, GenericVector< char > *lengths, int *encoded_length) const
bool AnyRepeatedUnicodes() const
void unichar_insert_backwards_compatible(const char *const unichar_repr)
void set_width_stats(UNICHAR_ID unichar_id, float width, float width_sd)
const char * get_normed_unichar(UNICHAR_ID unichar_id) const
bool eq(UNICHAR_ID unichar_id, const char *const unichar_repr) const
void CopyFrom(const UNICHARSET &src)
void AppendOtherUnicharset(const UNICHARSET &src)
const char * get_script_from_script_id(int id) const
char get_chartype(UNICHAR_ID unichar_id) const
static TESS_API const char * kCustomLigatures[][2]
void set_normed_ids(UNICHAR_ID unichar_id)
unsigned int get_properties(UNICHAR_ID unichar_id) const
UNICHAR_ID unichar_to_id(const char *const unichar_repr, int length) const
void set_ispunctuation(UNICHAR_ID unichar_id, bool value)
void set_black_and_whitelist(const char *blacklist, const char *whitelist, const char *unblacklist)
char * FGets(char *buffer, int buffer_size)
bool contains(const char *const unichar_repr, int length) const
UNICHAR_ID unichar_to_id(const char *const unichar_repr) const
static STRING to_string(const char *unichar, int pos, int total, bool natural)
int direction(EDGEPT *point)
_ConstTessMemberResultCallback_0_0< false, R, T1 >::base * NewPermanentTessCallback(const T1 *obj, R(T2::*member)() const)
void set_isngram(UNICHAR_ID unichar_id, bool value)
char * fgets(char *orig_dst, int size)
bool get_isalpha(UNICHAR_ID unichar_id) const
int get_script_id_from_name(const char *script_name) const
const char * get_unichar() const
LocalFilePointer(FILE *stream)
bool major_right_to_left() const
void unichar_insert(const char *const unichar_repr, OldUncleanUnichars old_style)
void set_all(const char *unichar, int pos, int total, bool natural)
Direction get_direction(UNICHAR_ID unichar_id) const
bool get_isdigit(UNICHAR_ID unichar_id) const
void set_top_bottom(UNICHAR_ID unichar_id, int min_bottom, int max_bottom, int min_top, int max_top)
const double kMinXHeightFraction
void get_top_bottom(UNICHAR_ID unichar_id, int *min_bottom, int *max_bottom, int *min_top, int *max_top) const
bool contains_unichar(const char *const unichar_repr) const
const double kMinCapHeightFraction
STRING debug_str(UNICHAR_ID id) const
bool encodable_string(const char *str, int *first_bad_position) const
void ExpandRangesFromOther(const UNICHARSET &src)
void set_other_case(UNICHAR_ID unichar_id, UNICHAR_ID other_case)
void get_bearing_stats(UNICHAR_ID unichar_id, float *bearing, float *bearing_sd) const
void set_isupper(UNICHAR_ID unichar_id, bool value)
void insert(const char *const unichar_repr, UNICHAR_ID id)
const char * id_to_unichar_ext(UNICHAR_ID id) const
static std::string CleanupString(const char *utf8_str)
int step(const char *str) const
void get_width_stats(UNICHAR_ID unichar_id, float *width, float *width_sd) const
bool SizesDistinct(UNICHAR_ID id1, UNICHAR_ID id2) const
bool get_isprivate(UNICHAR_ID unichar_id) const
void set_normed(UNICHAR_ID unichar_id, const char *normed)
UNICHAR_ID get_mirror(UNICHAR_ID unichar_id) const
const CHAR_FRAGMENT * get_fragment(UNICHAR_ID unichar_id) const
void set_islower(UNICHAR_ID unichar_id, bool value)
InMemoryFilePointer(const char *memory, int mem_size)
static STRING debug_utf8_str(const char *str)
const char * id_to_unichar(UNICHAR_ID id) const
void set_direction(UNICHAR_ID unichar_id, UNICHARSET::Direction value)
void set_isdigit(UNICHAR_ID unichar_id, bool value)
void reserve(int unichars_number)
void set_bearing_stats(UNICHAR_ID unichar_id, float bearing, float bearing_sd)
void get_advance_stats(UNICHAR_ID unichar_id, float *advance, float *advance_sd) const
UNICHAR_ID get_other_case(UNICHAR_ID unichar_id) const
void set_advance_stats(UNICHAR_ID unichar_id, float advance, float advance_sd)
bool get_isupper(UNICHAR_ID unichar_id) const
char * fgets(char *dst, int size)
bool has_special_codes() const
void set_mirror(UNICHAR_ID unichar_id, UNICHAR_ID mirror)
int minmatch(const char *const unichar_repr) const
bool load_from_inmemory_file(const char *const memory, int mem_size, bool skip_fragments)
bool load_from_file(const char *const filename, bool skip_fragments)
void set_script(UNICHAR_ID unichar_id, const char *value)
bool save_to_string(STRING *str) const
int add_script(const char *script)
int get_script(UNICHAR_ID unichar_id) const
static CHAR_FRAGMENT * parse_from_string(const char *str)
void UpdateRange(const T1 &x, T2 *lower_bound, T2 *upper_bound)