Browse Source

Autorisation de la commande \titleprefixword

remotes/origin/HEAD
Louis 12 years ago
parent
commit
cf866b48b1
  1. 12
      songbook-makeindex.py
  2. 1
      sortindex.py

12
songbook-makeindex.py

@ -18,7 +18,7 @@ import sortindex
import locale
# Pattern set to ignore latex command in title prefix
keywordPattern = re.compile(r"^%(\w+)\s?(\w*)")
keywordPattern = re.compile(r"^%(\w+)\s?(.*)$")
firstLetterPattern = re.compile(r"^(?:\{?\\\w+\}?)*[^\w]*(\w)")
class index:
@ -37,9 +37,17 @@ class index:
self.keywords[key].append(word)
def compileKeywords(self):
pass
self.prefix_patterns = []
if 'prefix' in self.keywords:
for prefix in self.keywords['prefix']:
self.prefix_patterns.append(re.compile(r"^(%s)\b\s*(.*)$" % prefix))
def add(self, key, number, link):
for pattern in self.prefix_patterns:
match = pattern.match(key)
if match:
key = "%s (%s)" % (match.group(2), match.group(1))
break # Only one match per key
(first, key) = self.filter(key)
if not self.data.has_key(first):
self.data[first] = dict()

1
sortindex.py

@ -28,6 +28,7 @@ replacePattern = {
'~n' : 'ñ',
"c C" : 'Ç',
"c c" : 'ç',
"textquoteright" : "'",
}
def sortkey(value):

Loading…
Cancel
Save