<commit_before>'use strict';

app.directive('citeVolume', [
  'constantService', 'routerService', '$location',
  function (constants, router, $location) {
    var link = function ($scope) {
      var volume = $scope.volume;

      var authors = _.map(volume.owners, function (owner) {
        var author;

        var i = owner.lastIndexOf(', '); // could equally incorrectly be indexOf
        if (i < 0)
          author = owner;
        else {
          i += 2;
          author = owner.substr(0, i);
          do {
            while (owner.charAt(i) == ' ')
              i++;
            author += owner.charAt(i) + '.';
          } while ((i = owner.indexOf(' ', i)+1) > 0);
        }
        return author;
      });

      authors.push(authors.splice(-2, 2).join(' & '));
      $scope.authors = authors.join(', ');
      $scope.today = new Date();
      $scope.permalink = (volume.doi ? 'doi:' + volume.doi : $location.absUrl());
    };

    return {
      restrict: 'E',
      templateUrl: 'volume/cite.html',
      scope: false,
      replace: true,
      link: link<commit_msg>make doi appear as link in citation<commit_after>'use strict';

app.directive('citeVolume', [
  'constantService', 'routerService', '$location',
  function (constants, router, $location) {
    var link = function ($scope) {
      var volume = $scope.volume;

      var authors = _.map(volume.owners, function (owner) {
        var author;

        var i = owner.lastIndexOf(', '); // could equally incorrectly be indexOf
        if (i < 0)
          author = owner;
        else {
          i += 2;
          author = owner.substr(0, i);
          do {
            while (owner.charAt(i) == ' ')
              i++;
            author += owner.charAt(i) + '.';
          } while ((i = owner.indexOf(' ', i)+1) > 0);
        }
        return author;
      });

      authors.push(authors.splice(-2, 2).join(' & '));
      $scope.authors = authors.join(', ');
      $scope.today = new Date();
      $scope.permalink = (volume.doi ? 'http://dx.doi.org/' + volume.doi : $location.absUrl());
    };

    return {
      restrict: 'E',
      templateUrl: 'volume/cite.html',
      scope: false,
      replace: true,
      link: link
{'fraction_non_alphanumeric': 0.1659132007233273, 'fraction_numerical': 0.006329113924050633, 'mean_word_length': 1.9350132625994696, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '189216', 'n_tokens_mistral': 699, 'n_tokens_neox': 672, 'n_words': 163}