digitalmars.D.learn - Fuzzy Levenshtein variant of std.conv.to
- "Per =?UTF-8?B?Tm9yZGzDtnci?= <per.nordlow gmail.com> (8/8) Apr 28 2015 At
- "Per =?UTF-8?B?Tm9yZGzDtnci?= <per.nordlow gmail.com> (3/3) Apr 28 2015 On Tuesday, 28 April 2015 at 16:20:24 UTC, Per Nordlöw wrote:
- "Per =?UTF-8?B?Tm9yZGzDtnci?= <per.nordlow gmail.com> (2/5) Apr 29 2015 I solved it.
- Jakob Ovrum (7/13) Apr 29 2015 I started working on this yesterday before you solved it, and
At https://github.com/nordlow/justd/blob/master/conv_ex.d I'm trying to figure out how to best implement a fuzzy variant of std.conv.to when converting a string to an enum. I'm almost there but I'm uncertain how to best pick the index of the smallest element in `distances` and then convert it to the corresponding enumerator for when `U` is an enum. Help please.
Apr 28 2015
On Tuesday, 28 April 2015 at 16:20:24 UTC, Per Nordlöw wrote: I update my Github repo. I had forgotten to push my latest changes.
Apr 28 2015
On Tuesday, 28 April 2015 at 23:09:27 UTC, Per Nordlöw wrote:On Tuesday, 28 April 2015 at 16:20:24 UTC, Per Nordlöw wrote: I update my Github repo. I had forgotten to push my latest changes.I solved it.
Apr 29 2015
On Wednesday, 29 April 2015 at 14:46:04 UTC, Per Nordlöw wrote:On Tuesday, 28 April 2015 at 23:09:27 UTC, Per Nordlöw wrote:I started working on this yesterday before you solved it, and ended up finishing a solution. It was a fun excercise, thanks. https://gist.github.com/JakobOvrum/515737710619a9d97273 It uses a loop instead of a range composition because of the early return when the Levenshtein distance is 0; that would be clumsy to express with ranges.On Tuesday, 28 April 2015 at 16:20:24 UTC, Per Nordlöw wrote: I update my Github repo. I had forgotten to push my latest changes.I solved it.
Apr 29 2015