<commit_before>from django import template
from isisdata.models import *
from isisdata.templatetags.app_filters import *

register = template.Library()

@register.filter
def get_page_string(citation):
    if citation.type_controlled != Citation.CHAPTER:
        return ""
    page_start_string = citation.part_details.page_begin
    page_end_string = citation.part_details.page_end
    if page_start_string and page_end_string:
        return "pp. " + str(page_start_string) + "-" + str(page_end_string)
    if page_start_string:
        return "p. " + str(page_start_string)
    if page_end_string:
        return "p. " + str(page_end_string)
    return ""

@register.filter
def join_authors(authors, postfix):
    author_names = []
    for author in authors:
        author_names.append(author.authority.name + postfix)
    return "; ".join(author_names)

@register.filter<commit_msg>[#105009800] using display name in citation list<commit_after>from django import template
from isisdata.models import *
from isisdata.templatetags.app_filters import *

register = template.Library()

@register.filter
def get_page_string(citation):
    if citation.type_controlled != Citation.CHAPTER:
        return ""
    page_start_string = citation.part_details.page_begin
    page_end_string = citation.part_details.page_end
    if page_start_string and page_end_string:
        return "pp. " + str(page_start_string) + "-" + str(page_end_string)
    if page_start_string:
        return "p. " + str(page_start_string)
    if page_end_string:
        return "p. " + str(page_end_string)
    return ""

@register.filter
def join_authors(authors, postfix):
    author_names = []
    for author in authors:
        author_names.append(contributor_as_string(author) + postfix)
    return "; ".join(author_names)

@register.filter
{'fraction_non_alphanumeric': 0.09421487603305785, 'fraction_numerical': 0.0049586776859504135, 'mean_word_length': 3.9482288828337873, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5388459', 'n_tokens_mistral': 593, 'n_tokens_neox': 568, 'n_words': 117}