quick general question - is there a good tiny libr...
# announcements
r
quick general question - is there a good tiny library for getting a human readable representation of the difference between two strings?
My search-jitsu is not producing results this morning
l
I’m interested in that too. I have to clean duplicates of a lot of data. It would be nice to have any library that can help me find similar strings
s
r
Yep! But available in multiplatform kotlin 🤷.
😥 1
l
It seems like it's yet to be done. J2K might help do it though as there's a Java impl in linked Google's repo.
e
I just recently wrote a pure-Kotlin implementation of Myers greedy algorithm to compute the difference between two sets of lines, though it can only compute small differences (<= 100 lines) reasonably fast. Feel free to copy-paste it and adapt for your needs (it has Apache 2.0 license): https://github.com/Kotlin/kotlinx-knit/blob/master/kotlinx-knit-test/src/KnitDiff.kt
👍 3
r
Huh, nice! Thanks Roman. 🙂