mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-24 02:59:07 +08:00
ccutil: Fix typos in comments and strings
Most of them were found by codespell. Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
bef8cad38d
commit
539b7fbbab
@ -190,7 +190,7 @@ const void *, const void *)) {
|
||||
|
||||
// Assuming list has been sorted already, insert new_data to
|
||||
// keep the list sorted according to the same comparison function.
|
||||
// Comparision function is the same as used by sort, i.e. uses double
|
||||
// Comparison function is the same as used by sort, i.e. uses double
|
||||
// indirection. Time is O(1) to add to beginning or end.
|
||||
// Time is linear to add pre-sorted items to an empty list.
|
||||
// If unique, then don't add duplicate entries.
|
||||
@ -513,7 +513,7 @@ CLIST_LINK *CLIST_ITERATOR::extract_sublist( //from
|
||||
|
||||
temp_it.mark_cycle_pt ();
|
||||
do { //walk sublist
|
||||
if (temp_it.cycled_list ()) //cant find end pt
|
||||
if (temp_it.cycled_list ()) //can't find end pt
|
||||
BAD_SUBLIST.error ("CLIST_ITERATOR.extract_sublist", ABORT, NULL);
|
||||
|
||||
if (temp_it.at_last ()) {
|
||||
|
@ -51,11 +51,11 @@ class DLLSYM CLIST_LINK
|
||||
}
|
||||
|
||||
CLIST_LINK( //copy constructor
|
||||
const CLIST_LINK &) { //dont copy link
|
||||
const CLIST_LINK &) { //don't copy link
|
||||
data = next = NULL;
|
||||
}
|
||||
|
||||
void operator= ( //dont copy links
|
||||
void operator= ( //don't copy links
|
||||
const CLIST_LINK &) {
|
||||
data = next = NULL;
|
||||
}
|
||||
@ -89,7 +89,7 @@ class DLLSYM CLIST
|
||||
void internal_deep_clear ( //destroy all links
|
||||
void (*zapper) (void *)); //ptr to zapper functn
|
||||
|
||||
void shallow_clear(); //clear list but dont
|
||||
void shallow_clear(); //clear list but don't
|
||||
//delete data elements
|
||||
|
||||
bool empty() const { //is list empty?
|
||||
@ -117,7 +117,7 @@ class DLLSYM CLIST
|
||||
|
||||
// Assuming list has been sorted already, insert new_data to
|
||||
// keep the list sorted according to the same comparison function.
|
||||
// Comparision function is the same as used by sort, i.e. uses double
|
||||
// Comparison function is the same as used by sort, i.e. uses double
|
||||
// indirection. Time is O(1) to add to beginning or end.
|
||||
// Time is linear to add pre-sorted items to an empty list.
|
||||
// If unique, then don't add duplicate entries.
|
||||
@ -232,7 +232,7 @@ class DLLSYM CLIST_ITERATOR
|
||||
BOOL8 cycled_list(); //Completed a cycle?
|
||||
|
||||
void add_to_end( //add at end &
|
||||
void *new_data); //dont move
|
||||
void *new_data); //don't move
|
||||
|
||||
void exchange( //positions of 2 links
|
||||
CLIST_ITERATOR *other_it); //other iterator
|
||||
@ -437,7 +437,7 @@ inline void CLIST_ITERATOR::add_before_then_move( // element to add
|
||||
/***********************************************************************
|
||||
* CLIST_ITERATOR::add_before_stay_put
|
||||
*
|
||||
* Add a new element to the list before the current element but dont move the
|
||||
* Add a new element to the list before the current element but don't move the
|
||||
* iterator to the new element.
|
||||
**********************************************************************/
|
||||
|
||||
@ -485,7 +485,7 @@ inline void CLIST_ITERATOR::add_before_stay_put( // element to add
|
||||
/***********************************************************************
|
||||
* CLIST_ITERATOR::add_list_after
|
||||
*
|
||||
* Insert another list to this list after the current element but dont move the
|
||||
* Insert another list to this list after the current element but don't move the
|
||||
* iterator.
|
||||
**********************************************************************/
|
||||
|
||||
@ -836,7 +836,7 @@ Replace <parm> with "<parm>". <parm> may be an arbitrary number of tokens
|
||||
|
||||
CLASSNAME is assumed to be the name of a class to be used in a CONS list
|
||||
|
||||
NOTE: Because we dont use virtual functions in the list code, the list code
|
||||
NOTE: Because we don't use virtual functions in the list code, the list code
|
||||
will NOT work correctly for classes derived from this.
|
||||
|
||||
The macro generates:
|
||||
@ -885,7 +885,7 @@ public: \
|
||||
CLASSNAME##_CLIST():CLIST() {} \
|
||||
/* constructor */ \
|
||||
\
|
||||
CLASSNAME##_CLIST( /* dont construct */ \
|
||||
CLASSNAME##_CLIST( /* don't construct */ \
|
||||
const CLASSNAME##_CLIST&) /*by initial assign*/ \
|
||||
{ DONT_CONSTRUCT_LIST_BY_COPY.error( QUOTE_IT( CLASSNAME##_CLIST ), \
|
||||
ABORT, NULL ); } \
|
||||
@ -963,7 +963,7 @@ CLISTIZEH_C( CLASSNAME )
|
||||
* A function which can delete a CLASSNAME element. This is passed to the \
|
||||
* generic deep_clear list member function so that when a list is cleared the \
|
||||
* elements on the list are properly destroyed from the base class, even \
|
||||
* though we dont use a virtual destructor function. \
|
||||
* though we don't use a virtual destructor function. \
|
||||
**********************************************************************/ \
|
||||
\
|
||||
DLLSYM void CLASSNAME##_c1_zapper( /*delete a link*/ \
|
||||
|
@ -117,7 +117,7 @@ inT32 ELIST::length() const { // count elements
|
||||
* ELIST::sort
|
||||
*
|
||||
* Sort elements on list
|
||||
* NB If you dont like the const declarations in the comparator, coerce yours:
|
||||
* NB If you don't like the const declarations in the comparator, coerce yours:
|
||||
* ( int (*)(const void *, const void *)
|
||||
**********************************************************************/
|
||||
|
||||
@ -161,7 +161,7 @@ const void *, const void *)) {
|
||||
|
||||
// Assuming list has been sorted already, insert new_link to
|
||||
// keep the list sorted according to the same comparison function.
|
||||
// Comparision function is the same as used by sort, i.e. uses double
|
||||
// Comparison function is the same as used by sort, i.e. uses double
|
||||
// indirection. Time is O(1) to add to beginning or end.
|
||||
// Time is linear to add pre-sorted items to an empty list.
|
||||
// If unique is set to true and comparator() returns 0 (an entry with the
|
||||
@ -455,7 +455,7 @@ ELIST_LINK *ELIST_ITERATOR::extract_sublist( //from
|
||||
|
||||
temp_it.mark_cycle_pt ();
|
||||
do { //walk sublist
|
||||
if (temp_it.cycled_list ()) //cant find end pt
|
||||
if (temp_it.cycled_list ()) //can't find end pt
|
||||
BAD_SUBLIST.error ("ELIST_ITERATOR.extract_sublist", ABORT, NULL);
|
||||
|
||||
if (temp_it.at_last ()) {
|
||||
|
@ -67,7 +67,7 @@ The implementation of lists is very careful about space and speed overheads.
|
||||
This is why many embedded lists are provided. The same concerns mean that
|
||||
in-line type coercion is done, rather than use virtual functions. This is
|
||||
cumbersome in that each data type to be listed requires its own iterator and
|
||||
list class - though macros can gererate these. It also prevents heterogenous
|
||||
list class - though macros can gererate these. It also prevents heterogeneous
|
||||
lists.
|
||||
**********************************************************************/
|
||||
|
||||
@ -98,7 +98,7 @@ class DLLSYM ELIST_LINK
|
||||
next = NULL;
|
||||
}
|
||||
|
||||
void operator= ( //dont copy links
|
||||
void operator= ( //don't copy links
|
||||
const ELIST_LINK &) {
|
||||
next = NULL;
|
||||
}
|
||||
@ -158,7 +158,7 @@ class DLLSYM ELIST
|
||||
|
||||
// Assuming list has been sorted already, insert new_link to
|
||||
// keep the list sorted according to the same comparison function.
|
||||
// Comparision function is the same as used by sort, i.e. uses double
|
||||
// Comparison function is the same as used by sort, i.e. uses double
|
||||
// indirection. Time is O(1) to add to beginning or end.
|
||||
// Time is linear to add pre-sorted items to an empty list.
|
||||
// If unique is set to true and comparator() returns 0 (an entry with the
|
||||
@ -274,7 +274,7 @@ class DLLSYM ELIST_ITERATOR
|
||||
bool cycled_list(); //Completed a cycle?
|
||||
|
||||
void add_to_end( //add at end &
|
||||
ELIST_LINK *new_link); //dont move
|
||||
ELIST_LINK *new_link); //don't move
|
||||
|
||||
void exchange( //positions of 2 links
|
||||
ELIST_ITERATOR *other_it); //other iterator
|
||||
@ -470,7 +470,7 @@ inline void ELIST_ITERATOR::add_before_then_move( // element to add
|
||||
/***********************************************************************
|
||||
* ELIST_ITERATOR::add_before_stay_put
|
||||
*
|
||||
* Add a new element to the list before the current element but dont move the
|
||||
* Add a new element to the list before the current element but don't move the
|
||||
* iterator to the new element.
|
||||
**********************************************************************/
|
||||
|
||||
@ -515,7 +515,7 @@ inline void ELIST_ITERATOR::add_before_stay_put( // element to add
|
||||
/***********************************************************************
|
||||
* ELIST_ITERATOR::add_list_after
|
||||
*
|
||||
* Insert another list to this list after the current element but dont move the
|
||||
* Insert another list to this list after the current element but don't move the
|
||||
* iterator.
|
||||
**********************************************************************/
|
||||
|
||||
@ -868,7 +868,7 @@ Replace <parm> with "<parm>". <parm> may be an arbitrary number of tokens
|
||||
CLASSNAME is assumed to be the name of a class which has a baseclass of
|
||||
ELIST_LINK.
|
||||
|
||||
NOTE: Because we dont use virtual functions in the list code, the list code
|
||||
NOTE: Because we don't use virtual functions in the list code, the list code
|
||||
will NOT work correctly for classes derived from this.
|
||||
|
||||
The macros generate:
|
||||
@ -999,7 +999,7 @@ ELISTIZEH_C( CLASSNAME )
|
||||
* A function which can delete a CLASSNAME element. This is passed to the \
|
||||
* generic clear list member function so that when a list is cleared the \
|
||||
* elements on the list are properly destroyed from the base class, even \
|
||||
* though we dont use a virtual destructor function. \
|
||||
* though we don't use a virtual destructor function. \
|
||||
**********************************************************************/ \
|
||||
\
|
||||
DLLSYM void CLASSNAME##_zapper(ELIST_LINK* link) { \
|
||||
|
@ -118,7 +118,7 @@ inT32 ELIST2::length() const { // count elements
|
||||
* ELIST2::sort
|
||||
*
|
||||
* Sort elements on list
|
||||
* NB If you dont like the const declarations in the comparator, coerce yours:
|
||||
* NB If you don't like the const declarations in the comparator, coerce yours:
|
||||
* ( int (*)(const void *, const void *)
|
||||
**********************************************************************/
|
||||
|
||||
@ -162,7 +162,7 @@ const void *, const void *)) {
|
||||
|
||||
// Assuming list has been sorted already, insert new_link to
|
||||
// keep the list sorted according to the same comparison function.
|
||||
// Comparision function is the same as used by sort, i.e. uses double
|
||||
// Comparison function is the same as used by sort, i.e. uses double
|
||||
// indirection. Time is O(1) to add to beginning or end.
|
||||
// Time is linear to add pre-sorted items to an empty list.
|
||||
void ELIST2::add_sorted(int comparator(const void*, const void*),
|
||||
@ -475,7 +475,7 @@ ELIST2_LINK *ELIST2_ITERATOR::extract_sublist( //fr
|
||||
|
||||
temp_it.mark_cycle_pt ();
|
||||
do { //walk sublist
|
||||
if (temp_it.cycled_list ()) //cant find end pt
|
||||
if (temp_it.cycled_list ()) //can't find end pt
|
||||
BAD_SUBLIST.error ("ELIST2_ITERATOR.extract_sublist", ABORT, NULL);
|
||||
|
||||
if (temp_it.at_last ()) {
|
||||
|
@ -69,11 +69,11 @@ class DLLSYM ELIST2_LINK
|
||||
}
|
||||
|
||||
ELIST2_LINK( //copy constructor
|
||||
const ELIST2_LINK &) { //dont copy link
|
||||
const ELIST2_LINK &) { //don't copy link
|
||||
prev = next = NULL;
|
||||
}
|
||||
|
||||
void operator= ( //dont copy links
|
||||
void operator= ( //don't copy links
|
||||
const ELIST2_LINK &) {
|
||||
prev = next = NULL;
|
||||
}
|
||||
@ -133,7 +133,7 @@ class DLLSYM ELIST2
|
||||
|
||||
// Assuming list has been sorted already, insert new_link to
|
||||
// keep the list sorted according to the same comparison function.
|
||||
// Comparision function is the same as used by sort, i.e. uses double
|
||||
// Comparison function is the same as used by sort, i.e. uses double
|
||||
// indirection. Time is O(1) to add to beginning or end.
|
||||
// Time is linear to add pre-sorted items to an empty list.
|
||||
void add_sorted(int comparator(const void*, const void*),
|
||||
@ -241,7 +241,7 @@ class DLLSYM ELIST2_ITERATOR
|
||||
BOOL8 cycled_list(); //Completed a cycle?
|
||||
|
||||
void add_to_end( //add at end &
|
||||
ELIST2_LINK *new_link); //dont move
|
||||
ELIST2_LINK *new_link); //don't move
|
||||
|
||||
void exchange( //positions of 2 links
|
||||
ELIST2_ITERATOR *other_it); //other iterator
|
||||
@ -450,7 +450,7 @@ inline void ELIST2_ITERATOR::add_before_then_move( // element to add
|
||||
/***********************************************************************
|
||||
* ELIST2_ITERATOR::add_before_stay_put
|
||||
*
|
||||
* Add a new element to the list before the current element but dont move the
|
||||
* Add a new element to the list before the current element but don't move the
|
||||
* iterator to the new element.
|
||||
**********************************************************************/
|
||||
|
||||
@ -500,7 +500,7 @@ inline void ELIST2_ITERATOR::add_before_stay_put( // element to add
|
||||
/***********************************************************************
|
||||
* ELIST2_ITERATOR::add_list_after
|
||||
*
|
||||
* Insert another list to this list after the current element but dont move the
|
||||
* Insert another list to this list after the current element but don't move the
|
||||
* iterator.
|
||||
**********************************************************************/
|
||||
|
||||
@ -883,7 +883,7 @@ Replace <parm> with "<parm>". <parm> may be an arbitrary number of tokens
|
||||
CLASSNAME is assumed to be the name of a class which has a baseclass of
|
||||
ELIST2_LINK.
|
||||
|
||||
NOTE: Because we dont use virtual functions in the list code, the list code
|
||||
NOTE: Because we don't use virtual functions in the list code, the list code
|
||||
will NOT work correctly for classes derived from this.
|
||||
|
||||
The macro generates:
|
||||
@ -927,7 +927,7 @@ public: \
|
||||
CLASSNAME##_LIST():ELIST2() {} \
|
||||
/* constructor */ \
|
||||
\
|
||||
CLASSNAME##_LIST( /* dont construct */ \
|
||||
CLASSNAME##_LIST( /* don't construct */ \
|
||||
const CLASSNAME##_LIST&) /*by initial assign*/\
|
||||
{ DONT_CONSTRUCT_LIST_BY_COPY.error( QUOTE_IT( CLASSNAME##_LIST ), \
|
||||
ABORT, NULL ); } \
|
||||
@ -1015,7 +1015,7 @@ ELIST2IZEH_C( CLASSNAME )
|
||||
* A function which can delete a CLASSNAME element. This is passed to the \
|
||||
* generic clear list member function so that when a list is cleared the \
|
||||
* elements on the list are properly destroyed from the base class, even \
|
||||
* though we dont use a virtual destructor function. \
|
||||
* though we don't use a virtual destructor function. \
|
||||
**********************************************************************/ \
|
||||
\
|
||||
DLLSYM void CLASSNAME##_zapper( /*delete a link*/ \
|
||||
|
@ -53,7 +53,7 @@ enum TessErrorLogCode {
|
||||
#define LOC_DOC_BLK_REJ 22
|
||||
#define LOC_WRITE_RESULTS 23
|
||||
#define LOC_ADAPTIVE 24
|
||||
/* DONT DEFINE ANY LOCATION > 31 !!! */
|
||||
/* DON'T DEFINE ANY LOCATION > 31 !!! */
|
||||
|
||||
/* Sub locatation determines whether pass2 was in normal mode or fix xht mode*/
|
||||
#define SUBLOC_NORM 0
|
||||
|
@ -949,7 +949,7 @@ bool GenericVector<T>::SerializeClasses(tesseract::TFile* fp) const {
|
||||
|
||||
// Reads a vector of classes from the given file. Assumes the existence of
|
||||
// bool T::Deserialize(bool swap, FILE* fp) that returns false in case of
|
||||
// error. Alse needs T::T() and T::T(constT&), as init_to_size is used in
|
||||
// error. Also needs T::T() and T::T(constT&), as init_to_size is used in
|
||||
// this function. Returns false in case of error.
|
||||
// If swap is true, assumes a big/little-endian swap is needed.
|
||||
template <typename T>
|
||||
|
@ -38,6 +38,6 @@ const ERRCODE NULL_PREV = "Previous element on the list is NULL";
|
||||
const ERRCODE EMPTY_LIST = "List is empty";
|
||||
const ERRCODE BAD_PARAMETER = "List parameter error";
|
||||
const ERRCODE STILL_LINKED =
|
||||
"Attemting to add an element with non NULL links, to a list";
|
||||
"Attempting to add an element with non NULL links, to a list";
|
||||
#endif
|
||||
#endif
|
||||
|
@ -21,7 +21,7 @@
|
||||
* the HP OCR interface.
|
||||
* The code is designed to be used with either a C or C++ compiler.
|
||||
* The structures are designed to allow them to be used with any
|
||||
* structure alignment upto 8.
|
||||
* structure alignment up to 8.
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef CCUTIL_OCRCLASS_H_
|
||||
|
@ -45,7 +45,7 @@ const int kMaxDoubleSize = 15;
|
||||
*
|
||||
* The collection of MACROS provide different implementations depending
|
||||
* on whether the string keeps track of its strlen or not so that this
|
||||
* feature can be added in later when consumers dont modifify the string
|
||||
* feature can be added in later when consumers don't modify the string
|
||||
**********************************************************************/
|
||||
|
||||
// Smallest string to allocate by default
|
||||
@ -339,7 +339,7 @@ STRING& STRING::operator=(const STRING& str) {
|
||||
const STRING_HEADER* str_header = str.GetHeader();
|
||||
int str_used = str_header->used_;
|
||||
|
||||
GetHeader()->used_ = 0; // clear since ensure doesnt need to copy data
|
||||
GetHeader()->used_ = 0; // clear since ensure doesn't need to copy data
|
||||
char* this_cstr = ensure_cstr(str_used);
|
||||
STRING_HEADER* this_header = GetHeader();
|
||||
|
||||
@ -398,7 +398,7 @@ STRING & STRING::operator=(const char* cstr) {
|
||||
if (cstr) {
|
||||
int len = strlen(cstr) + 1;
|
||||
|
||||
this_header->used_ = 0; // dont bother copying data if need to realloc
|
||||
this_header->used_ = 0; // don't bother copying data if need to realloc
|
||||
char* this_cstr = ensure_cstr(len);
|
||||
this_header = GetHeader(); // for realloc
|
||||
memcpy(this_cstr, cstr, len);
|
||||
@ -416,7 +416,7 @@ STRING & STRING::operator=(const char* cstr) {
|
||||
|
||||
void STRING::assign(const char *cstr, int len) {
|
||||
STRING_HEADER* this_header = GetHeader();
|
||||
this_header->used_ = 0; // dont bother copying data if need to realloc
|
||||
this_header->used_ = 0; // don't bother copying data if need to realloc
|
||||
char* this_cstr = ensure_cstr(len + 1); // +1 for '\0'
|
||||
|
||||
this_header = GetHeader(); // for realloc
|
||||
|
@ -51,7 +51,7 @@ bool TessdataManager::Init(const char *data_file_name, int debug_level) {
|
||||
sizeof(actual_tessdata_num_entries_));
|
||||
}
|
||||
if (actual_tessdata_num_entries_ > TESSDATA_NUM_ENTRIES) {
|
||||
// For forward compatability, truncate to the number we can handle.
|
||||
// For forward compatibility, truncate to the number we can handle.
|
||||
actual_tessdata_num_entries_ = TESSDATA_NUM_ENTRIES;
|
||||
}
|
||||
fread(offset_table_, sizeof(inT64),
|
||||
|
@ -282,7 +282,7 @@ class TessdataManager {
|
||||
* same or smaller than TESSDATA_NUM_ENTRIES, but can never be larger,
|
||||
* since then it would be impossible to interpret the type of tessdata at
|
||||
* indices same and higher than TESSDATA_NUM_ENTRIES.
|
||||
* This parameter is used to allow for backward compatiblity
|
||||
* This parameter is used to allow for backward compatibility
|
||||
* when new tessdata types are introduced.
|
||||
*/
|
||||
inT32 actual_tessdata_num_entries_;
|
||||
|
Loading…
Reference in New Issue
Block a user