lenamonj opened a new pull request, #767:
URL: https://github.com/apache/commons-text/pull/767

   `LevenshteinDetailedDistance.getDefaultInstance().apply("aba", 
"bab").getDistance()` returns 3; 
`LevenshteinDistance.getDefaultInstance().apply("aba", "bab")` returns 2.
   
   `findDetailedResults` returns `addCount + delCount + subCount` from a 
backtrace that chooses insert or delete whenever the neighbouring cell is one 
less, without checking that the step is on a shortest path. On "aba" -> "bab" 
that walk takes three steps where the matrix supports two.
   
   The walk now takes a step only when the predecessor cell holds the current 
value less the step's cost, and the distance is read from `matrix[m][n]`. Edit 
counts sum to the distance; the counts on the existing tests are unchanged.
   
   Verified with the default `mvn` goal (1892 tests, checkstyle, PMD, SpotBugs, 
japicmp). The new test fails on master with `expected: <2> but was: <3>`.
   
   Found by an automated review loop I run; the fix and test were reviewed and 
verified by me.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to