core: Fix indexing for unichars in PotentialMatch’s Jaro distance function
authorPhilip Withnall <philip@tecnocode.co.uk>
Sat, 23 Jun 2012 10:24:53 +0000 (11:24 +0100)
committerPhilip Withnall <philip@tecnocode.co.uk>
Mon, 25 Jun 2012 18:47:00 +0000 (19:47 +0100)
commit697b611adfbfffdb37a817feb5482f43bb715e1e
treea7a8ff997b5fcc95cca3d2006228edcfae33ad01
parent6dee26ca93460f1518f13c3af09cf36fff88b8f3
core: Fix indexing for unichars in PotentialMatch’s Jaro distance function

The indexing was getting out of sync between the two strings if one contained
a different number of non-ASCII characters to the other (as the indexing was
done in terms of bytes, rather than characters). This re-works the Jaro
distance function to operate on unichar arrays, and index in terms of
characters. This also means that exact matches now work over stripped non-ASCII
characters, which they didn’t before.

This adds a new test case. Yay.

Closes: https://bugzilla.gnome.org/show_bug.cgi?id=678474
NEWS
folks/potential-match.vala
tests/tracker/match-name.vala