def get_keywords_output(single_keywords, composite_keywords, taxonomy_name,
                        author_keywords=None, acronyms=None,
                        output_mode="text", output_limit=0, spires=False,
                        only_core_tags=False):
    """Return a formatted string representing the keywords in the chosen style.

    This is the main routing call, this function will
    also strip unwanted keywords before output and limits the number
    of returned keywords.

    :param single_keywords: list of single keywords
    :param composite_keywords: list of composite keywords
    :param taxonomy_name: string, taxonomy name
    :param author_keywords: dictionary of author keywords extracted
    :param acronyms: dictionary of extracted acronyms
    :param output_mode: text|html|marc
    :param output_limit: int, number of maximum keywords printed (it applies
            to single and composite keywords separately)
    :param spires: boolen meaning spires output style
    :param only_core_tags: boolean
    """
    categories = {}
    # sort the keywords, but don't limit them (that will be done later)
    single_keywords_p = _sort_kw_matches(single_keywords)

    composite_keywords_p = _sort_kw_matches(composite_keywords)

    for w in single_keywords_p:
        categories[w[0].concept] = w[0].type
    for w in single_keywords_p:
        categories[w[0].concept] = w[0].type

    categories = [{'keyword': key, 'category': value}
                  for key, value in categories.iteritems()]

    complete_output = _output_complete(single_keywords_p, composite_keywords_p,
                                       author_keywords, acronyms, spires,
                                       only_core_tags, limit=output_limit)
    functions = {
        "text": _output_text,
        "marcxml": _output_marc,
        "html": _output_html,
        "dict": _output_dict
    }

    if output_mode != "raw":
        return functions[output_mode](complete_output, categories)
    else:
        if output_limit > 0:
            return (
                _kw(_sort_kw_matches(single_keywords, output_limit)),
                _kw(_sort_kw_matches(composite_keywords, output_limit)),
                author_keywords,  # this we don't limit (?)
                _kw(_sort_kw_matches(acronyms, output_limit))
            )
        else:
            return (single_keywords_p, composite_keywords_p,
                    author_keywords, acronyms)
Return a formatted string representing the keywords in the chosen style.

    This is the main routing call, this function will
    also strip unwanted keywords before output and limits the number
    of returned keywords.

    :param single_keywords: list of single keywords
    :param composite_keywords: list of composite keywords
    :param taxonomy_name: string, taxonomy name
    :param author_keywords: dictionary of author keywords extracted
    :param acronyms: dictionary of extracted acronyms
    :param output_mode: text|html|marc
    :param output_limit: int, number of maximum keywords printed (it applies
            to single and composite keywords separately)
    :param spires: boolen meaning spires output style
    :param only_core_tags: boolean