# Path: patacrep/authors.py
# LOGGER = logging.getLogger(__name__)
# RE_AFTER = r"^.*\b{}\b(.*)$"
# RE_SEPARATOR = r"^(.*)\b *{} *(\b.*)?$"
# def compile_authwords(authwords):
# def split_author_names(string):
# def split_sep_author(string, separators):
# def processauthors_removeparen(authors_string):
# def processauthors_split_string(authors_string, separators):
# def processauthors_remove_after(authors_list, after):
# def processauthors_ignore_authors(authors_list, ignore):
# def processauthors_clean_authors(authors_list):
# def processauthors(authors_string, after=None, ignore=None, separators=None):
# def process_listauthors(authors_list, after=None, ignore=None, separators=None):
# 
# Path: patacrep/encoding.py
# LOGGER = logging.getLogger(__name__)
# def open_read(filename, mode='r', encoding=None):
# def detect_encoding(filename):
# 
# Path: patacrep/latex/syntax.py
# def tex2plain(string):
#     """Parse string and return its plain text version."""
#     return detex(
#         latex_yacc().parse(
#             string,
#             lexer=SimpleLexer().lexer,
#             )
#         )
# 
# Path: patacrep/utils.py
# def normalize_string(string):
#     """Return a normalized string.
# 
#     Normalized means:
#     - no surrounding spaces;
#     - lower case;
#     - passed through unidecode.unidecode().
#     """
#     return unidecode.unidecode(string.lower().strip())


import locale
import re
from patacrep import authors
from patacrep import encoding
from patacrep.latex import tex2plain
from patacrep.utils import normalize_string
        if key == 'sep':
            key = 'separators'
        if key not in self.keywords:
            self.keywords[key] = []
        self.keywords[key].append(word)

    def compile_keywords(self):
        """Turn keywords (self.keywords) into regular expressions."""
        if self.indextype == "TITLE":
            if 'prefix' in self.keywords:
                for prefix in self.keywords['prefix']:
                    self.prefix_patterns.append(re.compile(
                        r"^({prefix})(\b|\\)(\s*.*)$".format(prefix=prefix)
                        ))

        if self.indextype == "AUTHOR":
            self.authwords = authors.compile_authwords(self.keywords)

    def _raw_add(self, key, number, link):
        """Add a song to the list.

        No processing is done on data. It is added raw. See add() for a
        similar method with processing.
        """
        first = self.get_first_letter(key[0])
        if first not in self.data:
            self.data[first] = dict()
        if key not in self.data[first]:
            self.data[first][key] = {
                'sortingkey': [

# Path: patacrep/authors.py
# LOGGER = logging.getLogger(__name__)
# RE_AFTER = r"^.*\b{}\b(.*)$"
# RE_SEPARATOR = r"^(.*)\b *{} *(\b.*)?$"
# def compile_authwords(authwords):
# def split_author_names(string):
# def split_sep_author(string, separators):
# def processauthors_removeparen(authors_string):
# def processauthors_split_string(authors_string, separators):
# def processauthors_remove_after(authors_list, after):
# def processauthors_ignore_authors(authors_list, ignore):
# def processauthors_clean_authors(authors_list):
# def processauthors(authors_string, after=None, ignore=None, separators=None):
# def process_listauthors(authors_list, after=None, ignore=None, separators=None):
# 
# Path: patacrep/encoding.py
# LOGGER = logging.getLogger(__name__)
# def open_read(filename, mode='r', encoding=None):
# def detect_encoding(filename):
# 
# Path: patacrep/latex/syntax.py
# def tex2plain(string):
#     """Parse string and return its plain text version."""
#     return detex(
#         latex_yacc().parse(
#             string,
#             lexer=SimpleLexer().lexer,
#             )
#         )
# 
# Path: patacrep/utils.py
# def normalize_string(string):
#     """Return a normalized string.
# 
#     Normalized means:
#     - no surrounding spaces;
#     - lower case;
#     - passed through unidecode.unidecode().
#     """
#     return unidecode.unidecode(string.lower().strip())


# Path: patacrep/index.py
import locale
import re
from patacrep import authors
from patacrep import encoding
from patacrep.latex import tex2plain
from patacrep.utils import normalize_string

        if key == 'sep':
            key = 'separators'
        if key not in self.keywords:
            self.keywords[key] = []
        self.keywords[key].append(word)

    def compile_keywords(self):
        """Turn keywords (self.keywords) into regular expressions."""
        if self.indextype == "TITLE":
            if 'prefix' in self.keywords:
                for prefix in self.keywords['prefix']:
                    self.prefix_patterns.append(re.compile(
                        r"^({prefix})(\b|\\)(\s*.*)$".format(prefix=prefix)
                        ))

        if self.indextype == "AUTHOR":
            self.authwords = authors.compile_authwords(self.keywords)

    def _raw_add(self, key, number, link):
        """Add a song to the list.

        No processing is done on data. It is added raw. See add() for a
        similar method with processing.
        """
        first = self.get_first_letter(key[0])
        if first not in self.data:
            self.data[first] = dict()
        if key not in self.data[first]:
            self.data[first][key] = {
                'sortingkey': [

                    normalize_string(tex2plain(item))