<commit_before><%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>

<!-- geneLong.jsp -->
<fmt:setBundle basename="model"/>

<c:set var="seenIdentifiers" value=""/>
<%--
<c:if test="${!empty object.synonyms}">
  <fmt:message key="synonyms.external.links"/>:
  <div style="margin-left: 20px">
    <table cellpadding="4">
      <c:forEach items="${object.synonyms}" var="thisSynonym">
        <c:set var="sourceName" value="${thisSynonym.source.name}"/>
        <c:set var="linkProperty"
            value="${sourceName}.${object.organism.genus}.${object.organism.species}.url.prefix"/>
        <c:set var="searchString" value="-:${thisSynonym.value}:-"/>
        <c:if test="${!empty WEB_PROPERTIES[linkProperty] 
                      && (thisSynonym.type == 'identifier' || thisSynonym.type == 'accession'
                          || (thisSynonym.type == 'name' 
                          && thisSynonym.source.title == 'HUGO')) 
                          && ! fn:contains(seenIdentifiers, searchString)}">
          <tr>
            <td>
              <html:link href="${WEB_PROPERTIES[linkProperty]}${thisSynonym.value}"
                         title="${sourceTitle}: ${thisSynonym.value}"
                         target="view_window">
                <html:img src="model/${sourceName}_logo_small.png"/>
              </html:link>
            </td>
            <td>
              <html:link href="${WEB_PROPERTIES[linkProperty]}${thisSynonym.value}"
                         title="${sourceName}: ${thisSynonym.value}"
                         target="view_window">
                ${thisSynonym.value}
              </html:link>
            </td>
          </tr>
          <c:set var="seenIdentifiers" 
                 value="${seenIdentifiers} -:${thisSynonym.value}:-"/>
        </c:if>
      </c:forEach>
    </table>
  </div>
</c:if>
--%>
<!-- /geneLong.jsp -->
<commit_msg>Changed synonymDisplayer.jsp to link once to each external database. Fixes #599.<commit_after><%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>

<!-- synonymDisplayer.jsp -->
<fmt:setBundle basename="model"/>

<c:set var="seenIdentifiers" value=""/>

<c:if test="${!empty object.synonyms}">
  <fmt:message key="synonyms.external.links"/>:
  <div style="margin-left: 20px">
    <table cellpadding="4">
      <c:forEach items="${object.synonyms}" var="thisSynonym">
        <c:set var="sourceName" value="${thisSynonym.source.name}"/>
        <c:set var="genus" value="${object.organism.genus}"/>
        <c:set var="species" value="${object.organism.species}"/>
        <c:set var="linkProperty"
               value="${sourceName}.${genus}.${species}.url.prefix"/>

        <c:set var="href" value="${WEB_PROPERTIES[linkProperty]}${thisSynonym.value}"/>

        <c:if test="${!empty WEB_PROPERTIES[linkProperty] 
                      && (thisSynonym.type == 'identifier' 
                          || ((thisSynonym.type == 'name' || thisSynonym.type == 'accession')
                               && sourceName == 'HUGO'))
                      && (sourceName != 'FlyBase' || fn:startsWith(thisSynonym.value, 'FBgn'))
                      && !seenUrls[href]}">
          
          <jsp:useBean id="seenUrls" scope="page" class="java.util.HashMap">
            <c:set target="${seenUrls}" property="${href}" value="${href}"/>
          </jsp:useBean>
          <tr>
            <td>
              <html:link href="${href}"
                         title="${sourceName}: ${thisSynonym.value}"
                         target="view_window">
                <html:img src="model/${sourceName}_logo_small.png"/>
              </html:link>
            </td>
            <td>
              <html:link href="${href}"
                         title="${sourceName}: ${thisSynonym.value}"
                         target="view_window">
                ${thisSynonym.value}
              </html:link>
            </td>
          </tr>
          <c:set var="seenIdentifiers" 
                 value="${seenIdentifiers} -:${thisSynonym.value}:-"/>
        </c:if>
      </c:forEach>
    </table>
  </div>
</c:if>
<!-- /synonymDisplayer.jsp -->

{'fraction_non_alphanumeric': 0.19599207223078616, 'fraction_numerical': 0.001981942303457388, 'mean_word_length': 2.1324137931034484, 'pattern_counts': {'":': 0, '<': 77, '<?xml version=': 0, '>': 77, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3951222', 'n_tokens_mistral': 1467, 'n_tokens_neox': 1387, 'n_words': 198}