tesseract  5.0.0-alpha-619-ge9db
unicodetext.cc File Reference
#include "util/utf8/unicodetext.h"
#include <string.h>
#include <algorithm>
#include "third_party/utf/utf.h"
#include "util/utf8/unilib.h"
#include "util/utf8/unilib_utf8_utils.h"

Go to the source code of this file.

Functions

UnicodeText::const_iterator::difference_type distance (const UnicodeText::const_iterator &first, const UnicodeText::const_iterator &last)
 
bool operator== (const UnicodeText &lhs, const UnicodeText &rhs)
 
bool operator< (const UnicodeText::const_iterator &lhs, const UnicodeText::const_iterator &rhs)
 
string CodepointString (const UnicodeText &t)
 

Function Documentation

◆ CodepointString()

string CodepointString ( const UnicodeText t)

Definition at line 502 of file unicodetext.cc.

502  {
503  string s;
504  UnicodeText::const_iterator it = t.begin(), end = t.end();
505  while (it != end) tensorflow::strings::Appendf(&s, "%X ", *it++);
506  return s;
507 }

◆ distance()

Definition at line 44 of file unicodetext.cc.

45  {
46  return CodepointDistance(first.it_, last.it_);
47 }

◆ operator<()

bool operator< ( const UnicodeText::const_iterator lhs,
const UnicodeText::const_iterator rhs 
)

Definition at line 416 of file unicodetext.cc.

417  {
418  return lhs.it_ < rhs.it_;
419 }

◆ operator==()

bool operator== ( const UnicodeText lhs,
const UnicodeText rhs 
)

Definition at line 375 of file unicodetext.cc.

375  {
376  if (&lhs == &rhs) return true;
377  if (lhs.repr_.size_ != rhs.repr_.size_) return false;
378  return memcmp(lhs.repr_.data_, rhs.repr_.data_, lhs.repr_.size_) == 0;
379 }
last
LIST last(LIST var_list)
Definition: oldlist.cpp:151
UnicodeText::end
const_iterator end() const
Definition: unicodetext.cc:412
UnicodeText::const_iterator
Definition: unicodetext.h:176
UnicodeText::begin
const_iterator begin() const
Definition: unicodetext.cc:408