I went through one code on the network .
I did not understand the following logic. This code works and works very fast.
for (int i = 0; i < typo_word_vec.size(); i++)
{
float each_typo_word_len = (float)typo_word_vec[i].size();
int start_range = each_typo_word_len - floor((each_typo_word_len / lower_bound_word_size) * each_typo_word_len) - 1;
if (start_range < 1)
start_range = 1;
int end_range = each_typo_word_len + ceil((each_typo_word_len / upper_bound_word_size) * each_typo_word_len) + 1;
if (end_range > src_word_max_len)
end_range = src_word_max_len - 1;
call_get_dist(i, start_range, end_range);
}
But I do not understand what the logic of using start_rangeand is end_range. What basic algorithm or theory is used here.
source
share