I've been adding a javascript-based table sorter to many tables in the 3.0 staff client and OPAC. It's a jquery plugin (http://tablesorter.com), and allows one to set custom parsers for dealing with specialized kinds of data. I implemented a special parser for English-language articles, so that titles could be ordered correctly while ignoring "a," "an," and "the." $.tablesorter.addParser({ id: 'articles', is: function(s) {return false; }, format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); }, type: 'text' }); I'm hoping the same can be done for other languages by implementing a system preference that contains the articles ("the|an|a") in the script above. I'm a little concerned about how well Javascript will handle non-English or non-Western characters, but I don't have the right data to test. Some searching turned up the statement, "The default sort algorithm in JavaScript is based purely on the Unicode code point." Which would indicate that as long as Unicode orders things correctly JavaScript will too. I'm not sure this is the case. I'd like to get some feedback. Does this sound workable for other languages? Can anyone run some tests with some "exotic" data? Thanks, Owen -- Web Developer Athens County Public Libraries http://www.myacpl.org
Hi, On Wed, Apr 2, 2008 at 10:24 AM, Owen Leonard <oleonard@myacpl.org> wrote:
I'm hoping the same can be done for other languages by implementing a system preference that contains the articles ("the|an|a") in the script above.
One thing to keep in mind is that even if the catalog is in just one language, say English or French, any tables derived from bibliographic data may have to deal with a lot more than just the language of the catalog - many libraries collect in more than one language. This may simply mean that the value of the system preference may end up being the same regardless of the translation, at least for Indo-European and Semitic languages. Since not all articles will necessarily have a space after them, e.g., L' in some languages, the syspref should reflect that. LC maintains a list of articles at http://www.loc.gov/marc/bibliographic/bdapp-e.html. Regards, Galen -- Galen Charlton Koha Application Developer LibLime galen.charlton@liblime.com p: 1-888-564-2457 x709
One thing to keep in mind is that even if the catalog is in just one language, say English or French, any tables derived from bibliographic data may have to deal with a lot more than just the language of the catalog
Sure, and then there's the question of whether a predominantly-English catalog should use foreign-language sorting rules that the English-speaking user may not be familiar with? If I don't know that the "La" in "La Traviata" is an article, I'm going to be looking for it under L. It can get pretty complicated. -- Owen -- Web Developer Athens County Public Libraries http://www.myacpl.org
participants (2)
-
Galen Charlton -
Owen Leonard