Re: [Banshee-List] Matching search results against special characters



2008/2/25 Andrew Conkling <andrew conkling gmail com>:
> Bug #458941 mentions matching special characters. The bug is about the Czech
> digraph "ch" (represented as a single character).
>
> Andre Klapper was wondering about the functionality in general for use in
> other projects (namely Evolution.)
>
> I'm (now) wondering about the functionality since it doesn't seem to have
> ported to trunk yet. I'm thinking about hacking on it (and fixing this bug
> as well).
>
> Where is it in the source tree for stable?

Search in stable was implemented as a C# loop iterating over all the
TrackInfo objects in a Source (eg Library, Playlist, etc) and doing
string comparisons - the code is here:
http://svn.gnome.org/viewvc/banshee/branches/banshee/stable/src/Core/Banshee/PlayerInterface.cs?revision=3124&view=markup
- see OnSimpleSearch and DoesTrackMatchSearch.  What allows it to
ignore accents etc is the use of
CultureInfo.CurrentCulture.CompareInfo.Compare in
src/Core/Banshee.Base/StringUtils.cs.

However, in trunk search has been completely rewritten.  It is parsed
and turned into SQL using src/Libraries/Hyena/Hyena.Query.  So, we
don't have the advantages of the CultureInfo library.  What we really
need is a custom sqlite function for doing both case-insensitive
matching (currently only works for ASCII chars) and for accent-less
matching.  Should probably google some more since it's quite likely
others have solved this for sqlite already.  If not, I would suggest
either looking into making a C/C++ function for sqlite, or see if it
can be done efficiently enough in C# -
http://anonsvn.mono-project.com/viewcvs/trunk/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/
- SQLiteFunction.cs

Good luck,

Gabriel


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]