You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
levenshteinDistance does not support unicode characters outside of the BMP range properly.
Step to reproduce: expect(levenshteinDistance('\u{1f431}', '')).toBe(1) // got 2
for any a and b - strings
such that a = aBegin + common + aEnd and b = bBegin + common + bEnd levenshteinDistance(a, b) is at most max(numChars(aBegin), numChars(bBegin)) + max(numChars(aEnd), numChars(bEnd))
The text was updated successfully, but these errors were encountered:
dubzzz
changed the title
BUG levenshteinDistance does not support unicode characters
levenshteinDistance does not support unicode characters
Feb 15, 2019
Details:
levenshteinDistance
does not support unicode characters outside of the BMP range properly.Step to reproduce:
expect(levenshteinDistance('\u{1f431}', '')).toBe(1)
// got 2Fix
I can issue a PR with the fix dubzzz@856ba36
How did I find it?
Thanks to property based testing framework fast-check.
The property was the following:
Or:
The text was updated successfully, but these errors were encountered: