<commit_before>var EventEmitter = require('events').EventEmitter,
	$ = require('jquery');
//cannot package google loader via browserify....
var loadingMain = false;
var loadingFailed = false;
var loader = function() {
	EventEmitter.call(this);
	var mod = this;
	this.init = function() {
		if (!loadingFailed && !require('google') && !loadingMain) { //not initiated yet, not currently loading, and has not failed the previous time
			loadingMain = true;
			/**
			 * It is extremely difficult to catch script loader errors (see http://www.html5rocks.com/en/tutorials/speed/script-loading/)
			 * Existing libraries either ignore several browsers (e.g. jquery 2.x), or use ugly hacks (timeouts or something)
			 * So, we use our own custom ugly hack (yes, timeouts)
			 */
			loadScript('//google.com/jsapi', function() {<commit_msg>#85: support hosting YASR via file:// protocol<commit_after>var EventEmitter = require('events').EventEmitter,
	$ = require('jquery');
//cannot package google loader via browserify....
var loadingMain = false;
var loadingFailed = false;

var loader = function() {
	EventEmitter.call(this);
	var mod = this;
	this.init = function() {
		if (!loadingFailed && !require('google') && !loadingMain) { //not initiated yet, not currently loading, and has not failed the previous time
			loadingMain = true;
			/**
			 * It is extremely difficult to catch script loader errors (see http://www.html5rocks.com/en/tutorials/speed/script-loading/)
			 * Existing libraries either ignore several browsers (e.g. jquery 2.x), or use ugly hacks (timeouts or something)
			 * So, we use our own custom ugly hack (yes, timeouts)
			 */
			 //use protocol relative req when served via http. Otherwise, just use http:// (e.g. when yasr is served via file://)
			loadScript((window.location.protocol.indexOf("http") === 0 ? '//': 'http://') + 'google.com/jsapi', function() {
{'fraction_non_alphanumeric': 0.13428874734607218, 'fraction_numerical': 0.0037154989384288748, 'mean_word_length': 3.960526315789474, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '6570334', 'n_tokens_mistral': 575, 'n_tokens_neox': 527, 'n_words': 196}