Uploaded image for project: 'Picard'
  1. Picard
  2. PICARD-2194

$title function does not operate correctly

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 2.6.1
    • Scripting
    • None

      $title(UPPERCASE) = UPPERCASE which is NOT title case.

      This appears to be an algorithmic bug - see https://community.metabrainz.org/t/is-title-broken-or-am-i-misunderstanding-it/530654

      However, the entire implementation of $title seems to me to be a poor one - and may possibly have any other Unicode issues e.g. use of digraphics and modifiers. I believe that we should use the Python3 `str.title()` method and then use a regex to handle the issues of a quotation preceded by a unicode letter and followed by a unicode upper-case or Title-case (digraphic with first part uppercase) and replace the following character with a lower-case equivalent.

      I have not checked the code for other script string functions.

      There are some unit tests for $title, but I think we could also benefit from a comprehensive set of unit test functions with a range of unicode examples in various character scripts and using digraphics and modifiers etc. in order to ensure that we are doing it correctly.

            Unassigned Unassigned
            sophist Sophist
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                Version Package