|
|
@ -7,11 +7,11 @@ from a file generated by the latex compilation of the songbook (.sxd). |
|
|
|
|
|
|
|
import locale |
|
|
|
import re |
|
|
|
import unidecode |
|
|
|
|
|
|
|
from patacrep import authors |
|
|
|
from patacrep import encoding |
|
|
|
from patacrep.latex import tex2plain |
|
|
|
from patacrep.utils import normalize_string |
|
|
|
|
|
|
|
EOL = "\n" |
|
|
|
|
|
|
@ -67,7 +67,7 @@ class Index: |
|
|
|
def get_first_letter(key): |
|
|
|
"""Return the uppercase first letter of key.""" |
|
|
|
try: |
|
|
|
letter = FIRST_LETTER_PATTERN.match(key).group(1) |
|
|
|
letter = FIRST_LETTER_PATTERN.match(normalize_string(key)).group(1) |
|
|
|
except AttributeError: |
|
|
|
# classify as number all the non letter characters |
|
|
|
letter = "0" |
|
|
@ -108,7 +108,7 @@ class Index: |
|
|
|
if key not in self.data[first]: |
|
|
|
self.data[first][key] = { |
|
|
|
'sortingkey': [ |
|
|
|
unidecode.unidecode(tex2plain(item)).lower() |
|
|
|
normalize_string(tex2plain(item)) |
|
|
|
for item in key |
|
|
|
], |
|
|
|
'entries': [], |
|
|
|