If you have a cool piece of software to share, but you are not hosting it officially yet, please dump it in here. If you have code snippets that are useful, please donate!
As this method did not make it into wxWidgets itself ( http://trac.wxwidgets.org/ticket/14321 ), i'll post this little piece of code here, maybe it's useful to someone.
int LevenshteinDistance(const wxString &s1, const wxString &s2);
The Levenshtein distance between two strings is defined as the minimum number of edits needed to transform one string into the other, with the allowable edit operations being insertion, deletion, or substitution of a single character.
that`d be very nice to have, imo.
maybe consider this:
Perhaps we could add it as an inline global function in its own header (wx/algorithm/levenstein.h?) but I'd really like to avoid adding more methods to wxString itself.
Perhaps we could add it as an inline global function in its own header (wx/algorithm/levenstein.h?) but I'd really like to avoid adding more methods to wxString itself.
I personally think if it's in the library, it should be a wxString method, that's where people would look for it. Therefore i decided against doing this.
yeah, but they dont want it there. I have to agree - it`s something you wont use in your average project, or during everyday string-based work.
I also would start looking exactly here: wx/algorithm/levenstein.h, as proposed.
and: in the library as an algorithm is in any case better than not in the library at all, wouldn't you agree?