Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
-
None
Description
Hi Qt devs!
I recently worked on a project where I needed string comparison via the Levenshtein Distance and displaying of the differences of string pairs based on the Longest Commom Subsequence (diff-like).
It was not too hard but also not trivial to find/write functions doing the calculation. I'm not sure if this would be in the scope of Qt, but I wondered if such a functionality would be a candidate for integration into Qt (probably directly into QString), as these algorithms seem to be univerally shareable and widely used.
I appended the code I use to calculate the Levenshtein Distance of two QStrings (which seems to be quite nicely optimized as it only caches the last column of the comparison matrix instead of calculating it as a whole first) and the Longest Commom Subsequence of two QStrings (which does the whole calculation first, but I don't know how to optimize it furtherly).
Maybe this could be of interest for you and/or other Qt users.
Cheers, Tobias