<commit_before>'use strict';

var enums = require('streamhub-permalink/enums');
var EventEmitter = require('event-emitter');
var inherits = require('inherits');
var log = require('streamhub-sdk/debug')
        ('streamhub-permalink');
var uriInterpreter = require('streamhub-permalink/uri-interpreter');
var util = require('streamhub-sdk/util');
var bind = require('mout/function/bind');

/**
 * Permalink checks the page URI on construction for Livefyre permalinking parameters.
 * When parameters are found, Permalink will retrieve the specified items from the
 * servers and store them for use by other Livefyre apps. Any app confirgured to display
 * permalinked items should try to get(key) the item by type key. If the item is undefined,
 * the app should listen to Permalink for that key, i.e. Permalink.on('key', fn).
 * Implementers can specify default handlers per item key using the default(key, fn) method. Apps
 * can call Permalink.prevent(key) to prevent Permalink from automatically executing the default
 * for a given key.
 * @constructor
 * @extends {EventEmitter}
 */
var Permalink = function () {
    EventEmitter.call(this);
    var msgEvent = window.addEventListener ? 'message' : 'onmessage';
    var addEvent = window.addEventListener || window.attachEvent;

    //Check for content permalink
    var content = uriInterpreter.getContentPermalink();
    if (content) {
        if(content.contentId && content.contentId.indexOf('lb-post') >= 0)  {
            return; //Storify 2 post permalinks should never be opened in the modal
        }
        
        addEvent(msgEvent, bind(this.onPostMessage, this), false);
        //Load the code to parse, fetch, and display content<commit_msg>Added missing space<commit_after>'use strict';

var enums = require('streamhub-permalink/enums');
var EventEmitter = require('event-emitter');
var inherits = require('inherits');
var log = require('streamhub-sdk/debug')
        ('streamhub-permalink');
var uriInterpreter = require('streamhub-permalink/uri-interpreter');
var util = require('streamhub-sdk/util');
var bind = require('mout/function/bind');

/**
 * Permalink checks the page URI on construction for Livefyre permalinking parameters.
 * When parameters are found, Permalink will retrieve the specified items from the
 * servers and store them for use by other Livefyre apps. Any app confirgured to display
 * permalinked items should try to get(key) the item by type key. If the item is undefined,
 * the app should listen to Permalink for that key, i.e. Permalink.on('key', fn).
 * Implementers can specify default handlers per item key using the default(key, fn) method. Apps
 * can call Permalink.prevent(key) to prevent Permalink from automatically executing the default
 * for a given key.
 * @constructor
 * @extends {EventEmitter}
 */
var Permalink = function () {
    EventEmitter.call(this);
    var msgEvent = window.addEventListener ? 'message' : 'onmessage';
    var addEvent = window.addEventListener || window.attachEvent;

    //Check for content permalink
    var content = uriInterpreter.getContentPermalink();
    if (content) {
        if (content.contentId && content.contentId.indexOf('lb-post') >= 0)  {
            return; //Storify 2 post permalinks should never be opened in the modal
        }
        
        addEvent(msgEvent, bind(this.onPostMessage, this), false);
        //Load the code to parse, fetch, and display content
{'fraction_non_alphanumeric': 0.10136906495776289, 'fraction_numerical': 0.0011651616661811825, 'mean_word_length': 3.9481268011527377, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3693770', 'n_tokens_mistral': 953, 'n_tokens_neox': 952, 'n_words': 346}