OK. 
Since 'levenshtein' Ldist1 'malenstein' required 100% cpu for quite some
time, I thought something was wrong. 
But with enough patience I got:

   ts'''levenshtein'' Ldist1 ''malenstein'''
70.641344 16128


I have to figure out what is wrong with Levdist. Thanks for pointing out.


R.E. Boss


> -----Oorspronkelijk bericht-----
> Van: [email protected] [mailto:programming-
> [email protected]] Namens Viktor Cerovski
> Verzonden: woensdag 29 april 2009 2:32
> Aan: [email protected]
> Onderwerp: Re: [Jprogramming] Levenshtein distance
> 
> 
> 
> R.E.  Boss wrote:
> >
> > What happens after
> >
> > 'levenshtein' Ldist 'malenstein'
> >
> > or
> >
> > 'levenshtein' Ldist1 'malenstein'
> >
> > ?
> > [...]
> >
> 
> I paste the answer from my terminal:
> ----------------------------
> $ ~/j602/bin/jconsole
>    Ldist1=:>.&#`((>:@$:}:)~<.(>:@$:}:)<....@=&{:+$:&}:)@.(0<*&#)
>    'levenshtein' Ldist1 'malenstein'
> 4
> ----------------------------
> Since in your other post the claim was that the correct answer is 5,
> I suppose we should figure out "where the truth lies" (coincidentally
> I watched movie with this title earlier today).
> 
> Your program gives a diagram that is a 5-edit solution:
> 
> 
> >   'levenshtein' Levdist 'malenstein'
> > 5       NB. is the right answer
> >
> >   p
> > +---+-+---+-+--+-+-+-+
> > |l  |e|ven|s|ht|e|i|n|
> > +---+-+---+-+--+-+-+-+
> > |mal|e|n  |s|t |e|i|n|
> > +---+-+---+-+--+-+-+-+
> >
> 
> But there is also a 4 edits solution:
> 
> 1. insert h:  malenstein -> malenshtein
> 2. substitute l with v:   -> mavenshtein
> 3. substitute a with e:  -> mevenshtein
> 4. substitute m with l:  -> levenshtein
> 
> This solution alone of course does not prove the optimality of 4.
> 
> --
> View this message in context: http://www.nabble.com/Levenshtein-distance-
> tp23273653s24193p23288605.html
> Sent from the J Programming mailing list archive at Nabble.com.
> 
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to