Browse Source

Correct sorted normalization

pull/188/head
Oliverpool 9 years ago
parent
commit
b3d11140c1
  1. 5
      patacrep/content/sorted.py
  2. 10
      test/test_songbook/content.tex.control

5
patacrep/content/sorted.py

@ -4,7 +4,6 @@ This plugin provides keyword 'sorted', used to include a sorted list of songs
to a songbook.
"""
import locale
import logging
import unidecode
@ -23,9 +22,9 @@ def normalize_string(string):
Normalized means:
- no surrounding spaces;
- lower case;
- passed through locale.strxfrm().
- passed through unidecode.unidecode().
"""
return locale.strxfrm(unidecode.unidecode(string.lower().strip()))
return unidecode.unidecode(string.lower().strip())
def normalize_field(field):
"""Return a normalized field, it being a string or a list of strings."""

10
test/test_songbook/content.tex.control

@ -91,11 +91,6 @@ guitar,
\section{Test of section}
\begin{songs}{titleidx,authidx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% songs/./song.tsg
\import{@TEST_FOLDER@/content_datadir/songs/}{song.tsg}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% songs/./song.csg
@ -115,6 +110,11 @@ guitar,
\endsong
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% songs/./song.tsg
\import{@TEST_FOLDER@/content_datadir/songs/}{song.tsg}
\end{songs}
\songsection{Test of song section}

Loading…
Cancel
Save