Skip to content

Commit

Permalink
Merge pull request #133 from stweil/master
Browse files Browse the repository at this point in the history
Fix some typos found by codespell
  • Loading branch information
zdenop committed Nov 4, 2015
2 parents 34f34ea + 053403e commit eb34cb1
Show file tree
Hide file tree
Showing 45 changed files with 85 additions and 85 deletions.
2 changes: 1 addition & 1 deletion ccstruct/rect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*
**********************************************************************/

TBOX::TBOX( //construtor
TBOX::TBOX( //constructor
const ICOORD pt1, //one corner
const ICOORD pt2 //the other corner
) {
Expand Down
2 changes: 1 addition & 1 deletion ccstruct/rect.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ class DLLSYM TBOX { // bounding box
*
**********************************************************************/

inline TBOX::TBOX( // construtor
inline TBOX::TBOX( // constructor
const FCOORD pt // floating centre
) {
bot_left = ICOORD ((inT16) floor (pt.x ()), (inT16) floor (pt.y ()));
Expand Down
2 changes: 1 addition & 1 deletion ccutil/genericvector.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ class GenericVector {
void init(int size);

// We are assuming that the object generally placed in thie
// vector are small enough that for efficiency it makes sence
// vector are small enough that for efficiency it makes sense
// to start with a larger initial size.
static const int kDefaultVectorSize = 4;
inT32 size_used_;
Expand Down
2 changes: 1 addition & 1 deletion ccutil/unicharset.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class UNICHARSET {

// Return the UTF8 representation corresponding to the given UNICHAR_ID after
// resolving any private encodings internal to Tesseract. This method is
// preferrable to id_to_unichar for outputting text that will be visible to
// preferable to id_to_unichar for outputting text that will be visible to
// external applications.
const char* const id_to_unichar_ext(UNICHAR_ID id) const;

Expand Down
2 changes: 1 addition & 1 deletion cube/char_samp.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class CharSamp : public Bmp8 {
label32_ = NULL;
}
if (label32 != NULL) {
// remove any byte order markes if any
// remove any byte order marks if any
if (label32[0] == 0xfeff) {
label32++;
}
Expand Down
2 changes: 1 addition & 1 deletion opencl/oclkernels.h
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ KERNEL(
// HistogramRect Kernel: Accumulate
// assumes 4 channels, i.e., bytes_per_pixel = 4
// assumes number of pixels is multiple of 8
// data is layed out as
// data is laid out as
// ch0 ch1 ...
// bin0 bin1 bin2... bin0...
// rpt0,1,2...256 rpt0,1,2...
Expand Down
6 changes: 3 additions & 3 deletions opencl/openclwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ int OpenclDevice::GeneratBinFromKernelSource( cl_program program, const char * c
printf("[OD] write binary[%s] failed\n", fileName);
return 0;
} //else
printf("[OD] write binary[%s] succesfully\n", fileName);
printf("[OD] write binary[%s] successfully\n", fileName);
}
}

Expand Down Expand Up @@ -1630,7 +1630,7 @@ pixDilateCL(l_int32 hsize, l_int32 vsize, l_int32 wpl, l_int32 h)
}
else if (xp > 0 || xn > 0 )
{
//Specfic Horizontal pass kernel for half width < 32
//Specific Horizontal pass kernel for half width < 32
rEnv.mpkKernel = clCreateKernel( rEnv.mpkProgram, "morphoDilateHor_32word", &status );
isEven = (xp != xn);

Expand Down Expand Up @@ -2371,7 +2371,7 @@ OpenclDevice::pixGetLinesCL(PIX *pixd,
/*************************************************************************
* HistogramRect
* Otsu Thresholding Operations
* histogramAllChannels is layed out as all channel 0, then all channel 1...
* histogramAllChannels is laid out as all channel 0, then all channel 1...
* only supports 1 or 4 channels (bytes_per_pixel)
************************************************************************/
int OpenclDevice::HistogramRectOCL(
Expand Down
2 changes: 1 addition & 1 deletion testing/runtestset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ rm -f testing/reports/$setname.times
while read page dir
do
# A pages file may be a list of files with subdirs or maybe just
# a plain list of files so accomodate both.
# a plain list of files so accommodate both.
if [ "$dir" ]
then
srcdir="$imdir/$dir"
Expand Down
4 changes: 2 additions & 2 deletions textord/alignedblob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ BLOBNBOX* AlignedBlob::FindAlignedBlob(const AlignedBlobParams& p,
// Compute skew tolerance.
int skew_tolerance = p.max_v_gap / kMaxSkewFactor;
// Calculate xmin and xmax of the search box so that it contains
// all possibly relevant boxes upto p.max_v_gap above or below accoording
// all possibly relevant boxes up to p.max_v_gap above or below accoording
// to top_to_bottom.
// Start with a notion of vertical with the current estimate.
int x2 = (p.max_v_gap * p.vertical.x() + p.vertical.y()/2) / p.vertical.y();
Expand Down Expand Up @@ -502,7 +502,7 @@ BLOBNBOX* AlignedBlob::FindAlignedBlob(const AlignedBlobParams& p,
}
if ((p.right_tab && neighbour->leader_on_right()) ||
(!p.right_tab && neighbour->leader_on_left()))
continue; // Neigbours of leaders are not allowed to be used.
continue; // Neighbours of leaders are not allowed to be used.
if (n_x <= x_at_n_y + p.r_align_tolerance &&
n_x >= x_at_n_y - p.l_align_tolerance) {
// Aligned so keep it. If it is a marked tab save it as result,
Expand Down
2 changes: 1 addition & 1 deletion textord/bbgrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ IntGrid* IntGrid::NeighbourhoodSum() const {
}

// Returns true if more than half the area of the rect is covered by grid
// cells that are over the theshold.
// cells that are over the threshold.
bool IntGrid::RectMostlyOverThreshold(const TBOX& rect, int threshold) const {
int min_x, min_y, max_x, max_y;
GridCoords(rect.left(), rect.bottom(), &min_x, &min_y);
Expand Down
6 changes: 3 additions & 3 deletions textord/bbgrid.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class IntGrid : public GridBase {
grid_[grid_y * gridwidth_ + grid_x] = value;
}
// Returns true if more than half the area of the rect is covered by grid
// cells that are over the theshold.
// cells that are over the threshold.
bool RectMostlyOverThreshold(const TBOX& rect, int threshold) const;

// Returns true if any cell value in the given rectangle is zero.
Expand Down Expand Up @@ -292,7 +292,7 @@ template<class BBC, class BBC_CLIST, class BBC_C_IT> class GridSearch {
// Return the next bbox in the search or NULL if done.
BBC* NextFullSearch();

// Start a new radius search. Will search in a spiral upto a
// Start a new radius search. Will search in a spiral up to a
// given maximum radius in grid cells from the given center in pixels.
void StartRadSearch(int x, int y, int max_radius);
// Return the next bbox in the radius search or NULL if the
Expand Down Expand Up @@ -750,7 +750,7 @@ void GridSearch<BBC, BBC_CLIST, BBC_C_IT>::StartSideSearch(int x,
int ymin, int ymax) {
// Right search records the x in x_origin_, the ymax in y_origin_
// and the size of the vertical strip to search in radius_.
// To guarantee finding overlapping objects of upto twice the
// To guarantee finding overlapping objects of up to twice the
// given size, double the height.
radius_ = ((ymax - ymin) * 2 + grid_->gridsize_ - 1) / grid_->gridsize_;
rad_index_ = 0;
Expand Down
2 changes: 1 addition & 1 deletion textord/blkocc.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ CLASS REGION_OCC
built in sorted order of min x. Overlapping REGION_OCCs are not permitted on
a single list. An overlapping region to be added causes the existing region
to be extended. This extension may result in the following REGION_OCC on the
list overlapping the ammended one. In this case the ammended REGION_OCC is
list overlapping the amended one. In this case the amended REGION_OCC is
further extended to include the range of the following one, so that the
following one can be deleted.
Expand Down
2 changes: 1 addition & 1 deletion textord/ccnontextdetect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ CCNonTextDetect::CCNonTextDetect(int gridsize,
noise_density_(NULL) {
// TODO(rays) break max_noise_count_ out into an area-proportional
// value, as now plus an additive constant for the number of text blobs
// in the 3x3 neigbourhood - maybe 9.
// in the 3x3 neighbourhood - maybe 9.
}

CCNonTextDetect::~CCNonTextDetect() {
Expand Down
4 changes: 2 additions & 2 deletions textord/colfind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ int ColumnFinder::FindBlocks(PageSegMode pageseg_mode, Pix* scaled_color,
// into thinking they are dealing with left-to-right text.
// To do this, we reflect the needed data in the y-axis and then reflect
// the blocks back after they have been created. This is a temporary
// arrangment that is confined to this function only, so the reflection
// arrangement that is confined to this function only, so the reflection
// is completely invisible in the output blocks.
// The only objects reflected are:
// The vertical separator lines that have already been found;
Expand Down Expand Up @@ -869,7 +869,7 @@ void ColumnFinder::ShrinkRangeToLongestRun(int** column_set_costs,
}
}

// Moves start in the direction of step, upto, but not including end while
// Moves start in the direction of step, up to, but not including end while
// the only incompatible regions are no more than kMaxIncompatibleColumnCount
// in size, and the compatible regions beyond are bigger.
void ColumnFinder::ExtendRangePastSmallGaps(int** column_set_costs,
Expand Down
2 changes: 1 addition & 1 deletion textord/colfind.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class ColumnFinder : public TabFind {
const bool* any_columns_possible,
int column_set_id,
int* best_start, int* best_end);
// Moves start in the direction of step, upto, but not including end while
// Moves start in the direction of step, up to, but not including end while
// the only incompatible regions are no more than kMaxIncompatibleColumnCount
// in size, and the compatible regions beyond are bigger.
void ExtendRangePastSmallGaps(int** column_set_costs,
Expand Down
4 changes: 2 additions & 2 deletions textord/colpartition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ int ColPartition::CountOverlappingBoxes(const TBOX& box) {
return overlap_count;
}

// Computes and sets the type_ and first_colum_, last_column_ and column_set_.
// Computes and sets the type_ and first_column_, last_column_ and column_set_.
// resolution refers to the ppi resolution of the image.
void ColPartition::SetPartitionType(int resolution, ColPartitionSet* columns) {
int first_spanned_col = -1;
Expand Down Expand Up @@ -2194,7 +2194,7 @@ bool ColPartition::IsInSameColumnAs(const ColPartition& part) const {
void ColPartition::SmoothSpacings(int resolution, int page_height,
ColPartition_LIST* parts) {
// The task would be trivial if we didn't have to allow for blips -
// occasional offsets in spacing caused by anomolous text, such as all
// occasional offsets in spacing caused by anomalous text, such as all
// caps, groups of descenders, joined words, Arabic etc.
// The neighbourhood stores a consecutive group of partitions so that
// blips can be detected correctly, yet conservatively enough to not
Expand Down
4 changes: 2 additions & 2 deletions textord/colpartition.h
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ class ColPartition : public ELIST2_LINK {
// one partner. This makes block creation simpler.
// If get_desperate is true, goes to more desperate merge methods
// to merge flowing text before breaking partnerships.
void RefinePartners(PolyBlockType type, bool get_desparate,
void RefinePartners(PolyBlockType type, bool get_desperate,
ColPartitionGrid* grid);

// Returns true if this column partition is in the same column as
Expand All @@ -713,7 +713,7 @@ class ColPartition : public ELIST2_LINK {
}

private:
// enum to refer to the entries in a neigbourhood of lines.
// enum to refer to the entries in a neighbourhood of lines.
// Used by SmoothSpacings to test for blips with OKSpacingBlip.
enum SpacingNeighbourhood {
PN_ABOVE2,
Expand Down
6 changes: 3 additions & 3 deletions textord/colpartitiongrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void ColPartitionGrid::HandleClick(int x, int y) {
// Merges ColPartitions in the grid that look like they belong in the same
// textline.
// For all partitions in the grid, calls the box_cb permanent callback
// to compute the search box, seaches the box, and if a candidate is found,
// to compute the search box, searches the box, and if a candidate is found,
// calls the confirm_cb to check any more rules. If the confirm_cb returns
// true, then the partitions are merged.
// Both callbacks are deleted before returning.
Expand Down Expand Up @@ -1438,7 +1438,7 @@ void ColPartitionGrid::FindMergeCandidates(const ColPartition* part,
}

// Smoothes the region type/flow type of the given part by looking at local
// neigbours and the given image mask. Searches a padded rectangle with the
// neighbours and the given image mask. Searches a padded rectangle with the
// padding truncated on one size of the part's box in turn for each side,
// using the result (if any) that has the least distance to all neighbours
// that contribute to the decision. This biases in favor of rectangular
Expand Down Expand Up @@ -1759,7 +1759,7 @@ void ColPartitionGrid::FindPartitionMargins(ColPartitionSet* columns,
part->set_right_margin(right_margin);
}

// Starting at x, and going in the specified direction, upto x_limit, finds
// Starting at x, and going in the specified direction, up to x_limit, finds
// the margin for the given y range by searching sideways,
// and ignoring not_this.
int ColPartitionGrid::FindMargin(int x, bool right_to_left, int x_limit,
Expand Down
6 changes: 3 additions & 3 deletions textord/colpartitiongrid.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ColPartitionGrid : public BBGrid<ColPartition,
// Merges ColPartitions in the grid that look like they belong in the same
// textline.
// For all partitions in the grid, calls the box_cb permanent callback
// to compute the search box, seaches the box, and if a candidate is found,
// to compute the search box, searches the box, and if a candidate is found,
// calls the confirm_cb to check any more rules. If the confirm_cb returns
// true, then the partitions are merged.
// Both callbacks are deleted before returning.
Expand Down Expand Up @@ -200,7 +200,7 @@ class ColPartitionGrid : public BBGrid<ColPartition,
bool debug, ColPartition_CLIST* candidates);

// Smoothes the region type/flow type of the given part by looking at local
// neigbours and the given image mask. Searches a padded rectangle with the
// neighbours and the given image mask. Searches a padded rectangle with the
// padding truncated on one size of the part's box in turn for each side,
// using the result (if any) that has the least distance to all neighbours
// that contribute to the decision. This biases in favor of rectangular
Expand Down Expand Up @@ -246,7 +246,7 @@ class ColPartitionGrid : public BBGrid<ColPartition,
// neighbours that vertically overlap significantly.
void FindPartitionMargins(ColPartitionSet* columns, ColPartition* part);

// Starting at x, and going in the specified direction, upto x_limit, finds
// Starting at x, and going in the specified direction, up to x_limit, finds
// the margin for the given y range by searching sideways,
// and ignoring not_this.
int FindMargin(int x, bool right_to_left, int x_limit,
Expand Down
2 changes: 1 addition & 1 deletion textord/fpchop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ C_OUTLINE *join_chopped_fragments( //join pieces
* join_segments
*
* Join the two edgestep fragments such that the second comes after
* the first and the gap beween them is closed.
* the first and the gap between them is closed.
**********************************************************************/

void join_segments( //join pieces
Expand Down
2 changes: 1 addition & 1 deletion textord/imagefind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ static void CutChunkFromParts(const TBOX& box, const TBOX& im_box,
TBOX part_box = part->bounding_box();
if (part_box.overlap(box)) {
// This part must be cut and replaced with the remains. There are
// upto 4 pieces to be made. Start with the first one and use
// up to 4 pieces to be made. Start with the first one and use
// add_before_stay_put. For each piece if it has no black pixels
// left, just don't make the box.
// Above box.
Expand Down
2 changes: 1 addition & 1 deletion textord/makerow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ BOOL8 find_best_dropout_row( //find neighbours
TO_ROW_IT *row_it, //current position
BOOL8 testing_on //correct orientation
) {
inT32 next_index; //of neigbouring row
inT32 next_index; //of neighbouring row
inT32 row_offset; //from current row
inT32 abs_dist; //absolute distance
inT8 row_inc; //increment to row_index
Expand Down
2 changes: 1 addition & 1 deletion textord/pithsync.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class FPCUTPT
inT16 pitch, //proposed pitch
inT16 pitch_error); //allowed tolerance

inT32 position() { //acces func
inT32 position() { //access func
return xpos;
}
double cost_function() {
Expand Down
2 changes: 1 addition & 1 deletion textord/pitsync1.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class FPSEGPT:public ELIST_LINK
FPSEGPT_LIST *prev_list); //previous segment
FPSEGPT(FPCUTPT *cutpt); //build from new type

inT32 position() { //acces func
inT32 position() { //access func
return xpos;
}
double cost_function() {
Expand Down
2 changes: 1 addition & 1 deletion textord/tabfind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const int kMaxTextLineBlobRatio = 5;
const int kMinTextLineBlobRatio = 3;
// Fraction of box area covered by image to make a blob image.
const double kMinImageArea = 0.5;
// Upto 30 degrees is allowed for rotations of diacritic blobs.
// Up to 30 degrees is allowed for rotations of diacritic blobs.
// Keep this value slightly larger than kCosSmallAngle in blobbox.cpp
// so that the assert there never fails.
const double kCosMaxSkewAngle = 0.866025;
Expand Down
2 changes: 1 addition & 1 deletion textord/tabfind.h
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ class TabFind : public AlignedBlob {
TabVector_LIST vectors_; //< List of rule line and tabstops.
TabVector_IT v_it_; //< Iterator for searching vectors_.
TabVector_LIST dead_vectors_; //< Separators and unpartnered tab vectors.
// List of commonly occuring width ranges with x=min and y=max.
// List of commonly occurring width ranges with x=min and y=max.
ICOORDELT_LIST column_widths_; //< List of commonly occurring width ranges.
/** Callback to test an int for being a common width. */
WidthCallback* width_cb_;
Expand Down
4 changes: 2 additions & 2 deletions textord/tablefind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ bool TableFinder::HasWideOrNoInterWordGap(ColPartition* part) const {
return true;

// return true if the maximum gap found is smaller than the minimum allowed
// max_gap in a text partition. This indicates that there is no signficant
// max_gap in a text partition. This indicates that there is no significant
// space in the partition, hence it is likely a single word.
return largest_partition_gap_found < min_gap;
}
Expand All @@ -954,7 +954,7 @@ bool TableFinder::HasWideOrNoInterWordGap(ColPartition* part) const {
// Note that this includes overlapping leaders. However, it does not
// include leaders in different columns on the page.
// Possible false-positive will include lists, such as a table of contents.
// As these arise, the agressive nature of this search may need to be
// As these arise, the aggressive nature of this search may need to be
// trimmed down.
bool TableFinder::HasLeaderAdjacent(const ColPartition& part) {
if (part.flow() == BTFT_LEADER)
Expand Down
4 changes: 2 additions & 2 deletions textord/tablerecog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ int StructuredTable::CountHorizontalIntersections(int y) {

// Counts how many text partitions are in this box.
// This is used to count partitons in cells, as that can indicate
// how "strong" a potential table row/colum (or even full table) actually is.
// how "strong" a potential table row/column (or even full table) actually is.
int StructuredTable::CountPartitions(const TBOX& box) {
ColPartitionGridSearch gsearch(text_grid_);
gsearch.SetUniqueMode(true);
Expand Down Expand Up @@ -740,7 +740,7 @@ StructuredTable* TableRecognizer::RecognizeTable(const TBOX& guess) {
table->set_line_grid(line_grid_);
table->set_max_text_height(max_text_height_);

// Try to solve ths simple case, a table with *both*
// Try to solve this simple case, a table with *both*
// vertical and horizontal lines.
if (RecognizeLinedTable(guess, table))
return table;
Expand Down
Loading

0 comments on commit eb34cb1

Please sign in to comment.