Skip to content

Commit

Permalink
compare to Paimon's length
Browse files Browse the repository at this point in the history
  • Loading branch information
tmarenko committed May 12, 2023
1 parent bab7a40 commit 303d437
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/tesseract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ unsigned int LevenshteinDistance(const std::string &s1, const std::string &s2) {
bool IsStringsSimilar(std::string s1, std::string s2, double overlap) {
std::transform(s1.begin(), s1.end(), s1.begin(), ::toupper);
std::transform(s2.begin(), s2.end(), s2.begin(), ::toupper);
double nonSimilarity = s1.length() > 0 ? (double) LevenshteinDistance(s1, s2) / s1.length() : 1;
double nonSimilarity = s1.length() > 0 ? (double) LevenshteinDistance(s1, s2) / s2.length() : 1;
return nonSimilarity <= overlap;
}

Expand Down

0 comments on commit 303d437

Please sign in to comment.