Skip to content

Commit 5378679

Browse files
committed
cube: Fix typos in comments
All of them were found by codespell. Signed-off-by: Stefan Weil <[email protected]>
1 parent 55fde61 commit 5378679

11 files changed

+13
-13
lines changed

cube/beam_search.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void BeamSearch::CreateChildren(SearchColumn *out_col, LangModel *lang_mod,
9393
} // lm_edges
9494
}
9595

96-
// Performs a beam seach in the specified search using the specified
96+
// Performs a beam search in the specified search using the specified
9797
// language model; returns an alternate list of possible words as a result.
9898
WordAltList * BeamSearch::Search(SearchObject *srch_obj, LangModel *lang_mod) {
9999
// verifications

cube/beam_search.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class BeamSearch {
4545
public:
4646
explicit BeamSearch(CubeRecoContext *cntxt, bool word_mode = true);
4747
~BeamSearch();
48-
// Performs a beam seach in the specified search using the specified
48+
// Performs a beam search in the specified search using the specified
4949
// language model; returns an alternate list of possible words as a result.
5050
WordAltList *Search(SearchObject *srch_obj, LangModel *lang_mod = NULL);
5151
// Returns the best node in the last column of last performed search.

cube/conv_net_classifier.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ bool ConvNetCharClassifier::Train(CharSamp *char_samp, int ClassID) {
7272

7373
/**
7474
* A secondary function needed for training. Allows the trainer to set the
75-
* value of any train-time paramter. This function is currently not
75+
* value of any train-time parameter. This function is currently not
7676
* implemented. TODO(ahmadab): implement end-2-end training
7777
*/
7878
bool ConvNetCharClassifier::SetLearnParam(char *var_name, float val) {

cube/conv_net_classifier.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class ConvNetCharClassifier : public CharClassifier {
5555
// is currently not implemented. TODO(ahmadab): implement end-2-end training
5656
virtual bool Train(CharSamp *char_samp, int ClassID);
5757
// A secondary function needed for training. Allows the trainer to set the
58-
// value of any train-time paramter. This function is currently not
58+
// value of any train-time parameter. This function is currently not
5959
// implemented. TODO(ahmadab): implement end-2-end training
6060
virtual bool SetLearnParam(char *var_name, float val);
6161
// Externally sets the Neural Net used by the classifier. Used for training

cube/cube_line_object.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ int CubeLineObject::ComputeWordBreakThreshold(int con_comp_cnt,
247247
word_break_threshold--;
248248
} while (!valid && word_break_threshold > 0);
249249

250-
// failed to find a threshold that acheives the target aspect ratio.
250+
// failed to find a threshold that achieves the target aspect ratio.
251251
// Just use the default threshold
252252
return static_cast<int>(line_pix_->h *
253253
cntxt_->Params()->MaxSpaceHeightRatio());

cube/cube_line_segmenter.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ Pixa *CubeLineSegmenter::CrackLine(Pix *cracked_line_pix,
237237
return NULL;
238238
}
239239

240-
// split a line continously until valid or fail
240+
// split a line continuously until valid or fail
241241
Pixa *CubeLineSegmenter::SplitLine(Pix *line_mask_pix, Box *line_box) {
242242
// clone the line mask
243243
Pix *line_pix = pixClone(line_mask_pix);
@@ -739,7 +739,7 @@ bool CubeLineSegmenter::LineSegment() {
739739
return true;
740740
}
741741

742-
// Estimate the paramters of the font(s) used in the page
742+
// Estimate the parameters of the font(s) used in the page
743743
bool CubeLineSegmenter::EstimateFontParams() {
744744
int hgt_hist[kHgtBins];
745745
int max_hgt;

cube/cube_search_object.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ CharSamp *CubeSearchObject::CharSample(int start_pt, int end_pt) {
212212
samp->SetLastChar(last_char ? 255 : 0);
213213
} else {
214214
// for non cursive languages, these features correspond
215-
// to whether the charsamp is at the begining or end of the word
215+
// to whether the charsamp is at the beginning or end of the word
216216
samp->SetFirstChar((start_pt == -1) ? 255 : 0);
217217
samp->SetLastChar((end_pt == (segment_cnt_ - 1)) ? 255 : 0);
218218
}

cube/cube_search_object.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class CubeSearchObject : public SearchObject {
114114
end_pt <= (start_pt + max_seg_per_char_));
115115
}
116116
// computes the space and no space costs at gaps between segments
117-
// return true on sucess
117+
// return true on success
118118
bool ComputeSpaceCosts();
119119
};
120120
}

cube/hybrid_neural_net_classifier.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ bool HybridNeuralNetCharClassifier::Train(CharSamp *char_samp, int ClassID) {
7272
}
7373

7474
// A secondary function needed for training. Allows the trainer to set the
75-
// value of any train-time paramter. This function is currently not
75+
// value of any train-time parameter. This function is currently not
7676
// implemented. TODO(ahmadab): implement end-2-end training
7777
bool HybridNeuralNetCharClassifier::SetLearnParam(char *var_name, float val) {
7878
// TODO(ahmadab): implementation of parameter initializing.
@@ -151,7 +151,7 @@ bool HybridNeuralNetCharClassifier::RunNets(CharSamp *char_samp) {
151151
return false;
152152
}
153153

154-
// go thru all the nets
154+
// go through all the nets
155155
memset(net_output_, 0, class_cnt * sizeof(*net_output_));
156156
float *inputs = net_input_;
157157
for (int net_idx = 0; net_idx < nets_.size(); net_idx++) {

cube/hybrid_neural_net_classifier.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class HybridNeuralNetCharClassifier : public CharClassifier {
4848
// is currently not implemented. TODO(ahmadab): implement end-2-end training
4949
virtual bool Train(CharSamp *char_samp, int ClassID);
5050
// A secondary function needed for training. Allows the trainer to set the
51-
// value of any train-time paramter. This function is currently not
51+
// value of any train-time parameter. This function is currently not
5252
// implemented. TODO(ahmadab): implement end-2-end training
5353
virtual bool SetLearnParam(char *var_name, float val);
5454
// Externally sets the Neural Net used by the classifier. Used for training

cube/tess_lang_model.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ int TessLangModel::NumberEdges(EDGE_REF edge_ref, LangModEdge **edge_array) {
397397
return 0;
398398
}
399399

400-
// go thru all valid transitions from the state
400+
// go through all valid transitions from the state
401401
int edge_cnt = 0;
402402

403403
EDGE_REF new_edge_ref;

0 commit comments

Comments
 (0)