<commit_before>'use strict';

var _window = typeof unsafeWindow === 'undefined' ? window : unsafeWindow;

/*
 * Rules for identifying ads on individual domains.
 *
 * example: Example URL that should trigger, used for testing.
 * match: Returns true if the current article is sponsored.
 *
 * Optional -
 * getSponsor: Returns the name of the sponsor. Null if unknown.
 * getCustomMessage: Returns a custom message to show on the warning banner.
 * shouldRootDomainTrigger: True if we expect the root domain to trigger the
 *    banner. Otherwise it is considered a false positive during testing.
 */
_window.AD_DETECTOR_RULES = {
  'ad-assets.nytimes.com': [
    {
      example: 'http://ad-assets.nytimes.com/paidpost/dell/will-millennials-ever-completely-shun-the-office.html',
      match: function() {
        return true;
      },
      shouldRootDomainTrigger: true,
      getSponsor: function() {
        var paidElts = document.getElementsByClassName('paid-head-tag');
        if (paidElts.length < 1) {
          return null;
        }
        return paidElts[0].innerHTML.replace('PAID FOR AND POSTED BY ', '');
      },
    },
  ],
  'adformatie.nl': [
    {
      example: 'https://www.adformatie.nl/advertorial/met-de-reclamefolder-app-op-stap',
      match: function() {
        return urlContains('/advertorial/');
      },
    },
  ],
  'arstechnica.com': [
    {
      example: 'http://arstechnica.com/sponsored/it-consumption-model-interactive-infographic/',
      match: function() {
        return urlContains('/sponsored/');
      },
    },<commit_msg>Add rule for androidworld.nl, courtesy of @Zegnat. Fixes #42.<commit_after>'use strict';

var _window = typeof unsafeWindow === 'undefined' ? window : unsafeWindow;

/*
 * Rules for identifying ads on individual domains.
 *
 * example: Example URL that should trigger, used for testing.
 * match: Returns true if the current article is sponsored.
 *
 * Optional -
 * getSponsor: Returns the name of the sponsor. Null if unknown.
 * getCustomMessage: Returns a custom message to show on the warning banner.
 * shouldRootDomainTrigger: True if we expect the root domain to trigger the
 *    banner. Otherwise it is considered a false positive during testing.
 */
_window.AD_DETECTOR_RULES = {
  'ad-assets.nytimes.com': [
    {
      example: 'http://ad-assets.nytimes.com/paidpost/dell/will-millennials-ever-completely-shun-the-office.html',
      match: function() {
        return true;
      },
      shouldRootDomainTrigger: true,
      getSponsor: function() {
        var paidElts = document.getElementsByClassName('paid-head-tag');
        if (paidElts.length < 1) {
          return null;
        }
        return paidElts[0].innerHTML.replace('PAID FOR AND POSTED BY ', '');
      },
    },
  ],
  'adformatie.nl': [
    {
      example: 'https://www.adformatie.nl/advertorial/met-de-reclamefolder-app-op-stap',
      match: function() {
        return urlContains('/advertorial/');
      },
    },
  ],
  'androidworld.nl': [
    {
      example: 'http://androidworld.nl/business/xs4all-klantenservice-getest-het-eindoordeel-en-kantoorbezoek/',
      match: function() {
        return selectorContains('.card-content__meta a', 'Advertorial');
      }
    }
  ],
  'arstechnica.com': [
    {
      example: 'http://arstechnica.com/sponsored/it-consumption-model-interactive-infographic/',
      match: function() {
        return urlContains('/sponsored/');
      },
    },
{'fraction_non_alphanumeric': 0.12760416666666666, 'fraction_numerical': 0.002025462962962963, 'mean_word_length': 2.8325942350332594, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '707986', 'n_tokens_mistral': 1067, 'n_tokens_neox': 1048, 'n_words': 251}