Skip to content

Instantly share code, notes, and snippets.

@lettergram
Created March 19, 2015 00:29
Show Gist options
  • Select an option

  • Save lettergram/3946e3cb12de4c913b1b to your computer and use it in GitHub Desktop.

Select an option

Save lettergram/3946e3cb12de4c913b1b to your computer and use it in GitHub Desktop.
errorAdjustment(QString line){
QString check(line);
int space = line.size() / (2 * fontsize);
line.remove(this->end_search + space, 85);
line.remove(0, this->start_search - space/2);
QStringList term = line.split(' ', QString::SkipEmptyParts);
QStringList words = check.split(' ', QString::SkipEmptyParts);
line.clear();
for(int j = 0; j < term.size(); j++){
for(int i = 0; i < words.size(); i++){
if(words[i].contains(term[j]) && term[j].size() > (words[i].size() / 2) ){
line.append(words[i] + ' ');
break;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment