add sortvalue to annotations to get better sort by text results

This commit is contained in:
j 2011-11-03 12:31:46 +01:00
commit 7eeb6dc107
4 changed files with 9 additions and 5 deletions

View file

@ -21,7 +21,8 @@ def plural_key(term):
def sort_string(string):
string = string.replace(u'Þ', 'Th')
string = string.replace(u'Æ', 'AE').replace(u'Ø', 'O').replace(u'Þ', 'Th')
#pad numbered titles
string = re.sub('(\d+)', lambda x: '%010d' % int(x.group(0)), string)
return unicodedata.normalize('NFKD', string)