Menu

Alphabetization of Songs Presents Errors

2008-01-20
2012-10-28
  • Mark Jacobsen

    Mark Jacobsen - 2008-01-20

    I have been using OpenSong at my church for over 6 months, and we love it! Thanks for such a great software product.

    However, I pastor an ethnic congregation, and thus much of our singing is done in three languages. I have found that when I create any new songs in a folder, if the song title has an accented letter in the first word of the title (such as "Lève-toi" or "Loué Soit Dieu"), these titles are not alphabetized in their proper places when I am searching through a folder to find a song. In the above example, instead of "Lève-toi" being found among other titles that begin with the letters "Le", it is found all the way at the end of the "L" titles, after those which begin with "Lu". Creole and French (the other two languages that I use) both have many accented words, and this makes it difficult to locate some titles easily. If a fix could be made, it would certainly be appreciated.

    Again, thanks for this great product!

     
    • Ed Palmer

      Ed Palmer - 2008-01-21

      Thanks for your kind words. I'm glad you find OpenSong helpful.

      OpenSong sorts files using the operating system's definition of sort order. Songs and sets should sort based on the operating system you are using and the language settings selected. This may not always match what you expect for various reasons.

      What operating system version are you using, and how do you have your language and country settings defined? This will provide clues to how changes might be made to get the sort working the way you want.

       
      • SvA

        SvA - 2008-01-27

        I'm not sure about what you refere to when you say "the operating system's definition of sort order", but I think the order in which files are listed in Explorer or on the command line with dir /o:n could well match this definition. The songs in OpenSong are, however, not sorted according to this. We have, for example, two songs which start with the letter Ü, which in Opensong are listed at the end of the alphabet. Windows places them just like U. Windows is correct.

         
        • Ed Palmer

          Ed Palmer - 2008-01-27

          Thanks for getting me to think about this again on a different day. Something woke up in my brain that I forgot in the last post.

          There was a hack added back in one of the early pre-V1.0 builds to make numbers at the beginning of a string sort properly even if they don't have the same number of digits. In other words, you would get

          1
          2
          ...
          10
          11

          instead of
          1
          10
          11
          ...
          2
          20
          21

          and so forth.

          There may be something about that routine which is causing the bad sort order, because on everything else it should be doing a standard lexical (case-insensitive) comparison. There is a known bug with that function in certain languages and I am waiting (patiently, over two years now) for REAL to fix that one. Might be time to stick in a direct call to the OS instead of relying on the built-ins.

          I'll put it on my list of things to look at or perhaps one of the other devos will peek at this and find the cause (it should be somewhere in StringUtils).

           
  • David Leigh

    David Leigh - 2012-04-15

    SwampCat,
    I know this is a horribly old thread, but it may be the only one that already
    touches on the issue that I'm running up against. As I've mentioned in other
    threads, I've rewritten OpenSongSearch completely and have found a handful of
    users to work with that are helping me make more capable to handle OpenSong
    installations that I could never have conceived of.

    I'm working with a particular user with nearly 11,000 songs and a folder
    structure of 44 folders with sub-folders and folder names with all sorts of
    punctuation, etc.

    The challenge I'm coming up with has to do with the Song Lookup dialog and the
    order of the folders presented in the combox box drop-down. As this is the
    interface point for adding songs to lists, OpenSongSearch counts on being able
    to know this order and up until today, I assumed that I DID. Now as I'm
    tracking down a bug with this complex folder structure, I'm realizing that I
    do NOT have the same sort order as OpenSong and none of my tools gives me the
    same sort order.

    For example, the following folders exist:

    /EenRbundels/
    /Elly en Rikkert/
    /Enige Gezangen/
    /ER/
    /Evangelische Liedbundel/
    /Eva's Lied/

    That's the order that Windows "dir /O:N" delivers them to me and that Autoit's
    _arraysort sorts them for me, but OpenSong lists them as:

    /EenRbundels/
    /Elly en Rikkert/
    /Enige Gezangen/
    /ER/
    /Eva's Lied/ <=============== switched
    /Evangelische Liedbundel/ <===== switched

    This happens in several spots in my long folder list.

    I guess my question would be how do you do your sort so that I can approximate
    the same thing (perhaps you can tell me where the code is in the SVN list and
    I can simply try to look at it and write the equivalent thing in Autoit)?
    Alternatively, if the folder structure is stored somewhere in the file system
    or registry, I could perhaps access it? I'm guessing, however, that it's
    stored in memory at OpenSong start up?

    Thanks!
    David

     
  • myvideopsalm.weebly.com

    Hi David,

    The sorting and the searching in strings should ideally take the user language
    into account, because each language has its own sorting rules.

    The following (incomplete and inexact) list could be the Swedish language
    uppercase character sorting definition:
    AÁÀÂÃĄBCĆČÇDĎÐEÉÈĚÊËĘFGĞHıIÍÌİÎÏJKLŁMNŃŇÑOÓÒÔPQRŘSŚŠŞTŤUÚÙŮÛÜVWXYÝZŹŻŽÞÆŒØÕÅÄö
    The lower case character list is different.
    This list could well be different in any other human language.

    Programming languages implement ways to handle character sorting and searching
    via locale objects. It could well be that the OpenSong comboBox list gets
    sorted differently depending on the user language (at least so it should be).
    As for whether AutoIt _arraysort can handle this, I don't know (I haven't
    found anything about it), but you may be able to build a custom sort for the
    language that your user uses.

    HTH

     
  • David Leigh

    David Leigh - 2012-04-28

    Thanks for the help. I think I finally found a solution that seems to work.

     

Log in to post a comment.