Thanks for your responses. And, apologies for the glacial pace of my reply

Your feedback was great. I've tried a bunch of things and here are the
three implementations that are either readable, performant or both:


Paul, thanks for identifying the flat out errors in my code. Including
duplicate bigrams is quite practical for string comparisons for general
use-cases but it is definitely not a correct implementation for finding the dice
coefficient :)

func KylesTweaked: Kyle, as your implementation was an improvement on my
original code it had the same issues. I've addressed those, and of the
three versions it is the fastest by a substantial margin.

func PaulHankin: Paul, your implementation is extremely readable, handles
unicode and is very performant. Thank you. It's awesome.

func TheLongWay: For some reason I became obsessed with finding the fastest
implementation I could come up with that handled unicode. Paul, you're a
tough act to follow :) I tried everything I could think of, aside from
copying the utf8 parsing code from the standard library (I wasn't that
obsessed) and eventually did find something that tends to be faster.
However, it is possibly the most cryptic code I've written.

I will post and attribute the first two implementations to wikibooks this

Thanks again.


Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
postedSep 28, '12 at 6:59a
activeSep 28, '12 at 6:59a

1 user in discussion

Joe Farro: 1 post



site design / logo © 2022 Grokbase