<commit_before>
{% macro companyresult(id, result, term, type) %}

  <li class="results-list__result result-list__ch" data_name="{{ result.name }}">
    <h3 class="result-title">
      <a href="/company/{{ type }}/{{ id }}?term={{ term }}">{{result.name | highlightTerm(term) | safe}}</a>
    </h3>

    {% if result.company_number %}
      <div class="meta meta--ch">{{ result.company_number }} - Incorporated on {{ result.incorporation_date | formatDate }}</div>
    {% endif %}

    <div class="meta meta--address">
      {% if result.registered_address_1 %}
        {{result.registered_address_1 | lower | highlightTerm(term) | safe}},
      {% endif %}
      {% if result.registered_address_2 %}
        {{result.registered_address_2 | lower | highlightTerm(term) | safe}},
      {% endif %}
      {% if result.registered_address_town %}
        {{result.registered_address_town | lower | highlightTerm(term) | safe}},
      {% endif %}
      {% if result.registered_address_postcode %}
        <span class="meta--address__postcode">{{result.registered_address_postcode | highlightTerm(term) | safe}}</span>
      {% endif %}
    </div>
  </li>
{% endmacro %}

{% macro contactresult(id, result, term) %}
  <li class="results-list__result result-list__contact">
    <h3 class="result-title">
      <a href="/contact/{{ id }}/view?term={{ term }}">
        {{ (result.first_name + ' ' + result.last_name) | highlightTerm(term) | safe }}
      </a>
    </h3>
    <div class="meta">{{ result.company }}</div>
    <div class="meta meta--address">
      {% if result.address_1 %}
        {{result.address_1 | lower | highlightTerm(term) | safe}},
      {% endif %}
      {% if result.address_2 %}
        {{result.address_2 | lower | highlightTerm(term) | safe}},
      {% endif %}
      {% if result.address_town %}
        {{result.address_town | lower | highlightTerm(term) | safe}},<commit_msg>Add contact role to result, if there is one. (#163)<commit_after>
{% macro companyresult(id, result, term, type) %}

  <li class="results-list__result result-list__ch" data_name="{{ result.name }}">
    <h3 class="result-title">
      <a href="/company/{{ type }}/{{ id }}?term={{ term }}">{{result.name | highlightTerm(term) | safe}}</a>
    </h3>

    {% if result.company_number %}
      <div class="meta meta--ch">{{ result.company_number }} - Incorporated on {{ result.incorporation_date | formatDate }}</div>
    {% endif %}

    <div class="meta meta--address">
      {% if result.registered_address_1 %}
        {{result.registered_address_1 | lower | highlightTerm(term) | safe}},
      {% endif %}
      {% if result.registered_address_2 %}
        {{result.registered_address_2 | lower | highlightTerm(term) | safe}},
      {% endif %}
      {% if result.registered_address_town %}
        {{result.registered_address_town | lower | highlightTerm(term) | safe}},
      {% endif %}
      {% if result.registered_address_postcode %}
        <span class="meta--address__postcode">{{result.registered_address_postcode | highlightTerm(term) | safe}}</span>
      {% endif %}
    </div>
  </li>
{% endmacro %}

{% macro contactresult(id, result, term) %}
  <li class="results-list__result result-list__contact">
    <h3 class="result-title">
      <a href="/contact/{{ id }}/view?term={{ term }}">
        {{ (result.first_name + ' ' + result.last_name) | highlightTerm(term) | safe }}
      </a>
    </h3>
    {% if (result.company and result.company != 'Undefined') %}<div class="meta">{{ result.company }}</div>{% endif %}
    {% if (result.role and result.role != 'Undefined') %}<div class="meta">{{ result.role }}</div>{% endif %}
    <div class="meta meta--address">
      {% if result.address_1 %}
        {{result.address_1 | lower | highlightTerm(term) | safe}},
      {% endif %}
      {% if result.address_2 %}
        {{result.address_2 | lower | highlightTerm(term) | safe}},
      {% endif %}
      {% if result.address_town %}
        {{result.address_town | lower | highlightTerm(term) | safe}},
{'fraction_non_alphanumeric': 0.1833582461385152, 'fraction_numerical': 0.006726457399103139, 'mean_word_length': 3.2041884816753927, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, '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': '4525593', 'n_tokens_mistral': 1337, 'n_tokens_neox': 1208, 'n_words': 256}