#include <unicharset.h>
Definition at line 30 of file unicharset.h.
| bool CHAR_FRAGMENT::equals |
( |
const char * |
other_unichar, |
|
|
int |
other_pos, |
|
|
int |
other_total |
|
) |
| const |
|
inline |
Definition at line 67 of file unicharset.h.
69 return (strcmp(this->unichar, other_unichar) == 0 &&
70 this->pos == other_pos && this->total == other_total);
Definition at line 72 of file unicharset.h.
bool equals(const char *other_unichar, int other_pos, int other_total) const
const char * get_unichar() const
| int CHAR_FRAGMENT::get_pos |
( |
| ) |
const |
|
inline |
| int CHAR_FRAGMENT::get_total |
( |
| ) |
const |
|
inline |
Definition at line 54 of file unicharset.h.
54 {
return this->total; }
| const char* CHAR_FRAGMENT::get_unichar |
( |
| ) |
const |
|
inline |
Definition at line 52 of file unicharset.h.
52 {
return this->unichar; }
| bool CHAR_FRAGMENT::is_beginning |
( |
| ) |
const |
|
inline |
Definition at line 87 of file unicharset.h.
87 {
return this->pos == 0; }
| bool CHAR_FRAGMENT::is_continuation_of |
( |
const CHAR_FRAGMENT * |
fragment | ) |
const |
|
inline |
Definition at line 80 of file unicharset.h.
81 return (strcmp(this->unichar, fragment->
get_unichar()) == 0 &&
83 this->pos == fragment->
get_pos() + 1);
const char * get_unichar() const
| bool CHAR_FRAGMENT::is_ending |
( |
| ) |
const |
|
inline |
Definition at line 90 of file unicharset.h.
90 {
return this->pos == this->total-1; }
| bool CHAR_FRAGMENT::is_natural |
( |
| ) |
const |
|
inline |
| CHAR_FRAGMENT * CHAR_FRAGMENT::parse_from_string |
( |
const char * |
str | ) |
|
|
static |
Definition at line 902 of file unicharset.cpp.
903 const char *ptr = string;
904 int len = strlen(
string);
905 if (len <
kMinLen || *ptr != kSeparator) {
910 while ((ptr + step) < (
string + len) && *(ptr + step) != kSeparator) {
917 strncpy(unichar, ptr, step);
918 unichar[step] =
'\0';
922 bool natural =
false;
923 char *end_ptr =
NULL;
924 for (
int i = 0; i < 2; i++) {
925 if (ptr >
string + len || *ptr != kSeparator) {
926 if (i == 1 && *ptr == kNaturalFlag)
932 i == 0 ? pos =
static_cast<int>(strtol(ptr, &end_ptr, 10))
933 : total = static_cast<int>(strtol(ptr, &end_ptr, 10));
936 if (ptr !=
string + len) {
940 fragment->
set_all(unichar, pos, total, natural);
static int utf8_step(const char *utf8_str)
void set_all(const char *unichar, int pos, int total, bool natural)
| void CHAR_FRAGMENT::set_all |
( |
const char * |
unichar, |
|
|
int |
pos, |
|
|
int |
total, |
|
|
bool |
natural |
|
) |
| |
|
inline |
Definition at line 40 of file unicharset.h.
void set_natural(bool value)
void set_unichar(const char *uch)
| void CHAR_FRAGMENT::set_natural |
( |
bool |
value | ) |
|
|
inline |
| void CHAR_FRAGMENT::set_pos |
( |
int |
p | ) |
|
|
inline |
| void CHAR_FRAGMENT::set_total |
( |
int |
t | ) |
|
|
inline |
| void CHAR_FRAGMENT::set_unichar |
( |
const char * |
uch | ) |
|
|
inline |
| STRING CHAR_FRAGMENT::to_string |
( |
const char * |
unichar, |
|
|
int |
pos, |
|
|
int |
total, |
|
|
bool |
natural |
|
) |
| |
|
static |
Definition at line 889 of file unicharset.cpp.
891 if (total == 1)
return STRING(unichar);
893 result += kSeparator;
896 snprintf(buffer,
kMaxLen,
"%c%d%c%d", kSeparator, pos,
897 natural ? kNaturalFlag : kSeparator, total);
| STRING CHAR_FRAGMENT::to_string |
( |
| ) |
const |
|
inline |
| const int CHAR_FRAGMENT::kMaxChunks = 5 |
|
static |
| const int CHAR_FRAGMENT::kMinLen = 6 |
|
static |
The documentation for this class was generated from the following files:
- /home/abuild/rpmbuild/BUILD/tesseract-ocr-3.02.02/ccutil/unicharset.h
- /home/abuild/rpmbuild/BUILD/tesseract-ocr-3.02.02/ccutil/unicharset.cpp