<commit_before>
if (typeof annotator === 'undefined') {
    alert("Oops! it looks like you haven't built Annotator. " +
          "Either download a tagged release from GitHub, or build the " +
          "package by running `make`");
} else {
    // DBMIAnnotator with highlight and DDI plugin
    var app = new annotator.App();

    app.include(annotator.ui.dbmimain);
    app.include(annotator.storage.debug);
    app.include(annotator.identity.simple);
    app.include(annotator.authz.acl);

    app.include(annotator.storage.http, {
	prefix: 'http://' + config.store.host + ':' + config.store.port
    });


    
    var sourceURL = getURLParameter("sourceURL").trim();
    var email = getURLParameter("email");
    
    var pageUri = function () {

	source = getURLParameter("sourceURL").trim();
    	return {
            beforeAnnotationCreated: function (ann) {
		ann.rawurl = source;
    		ann.uri = source.replace(/[\/\\\-\:\.]/g, "");		
		ann.email = email;
            }
    	};
    };
    app.include(pageUri);
    
    app.start().then(function () 
		     {
			 app.ident.identity = email;
			 $(".btn-success").css("display","block");
			 $("#subcontent").load(sourceURL);
		     }).then(function(){
			 app.annotations.load({uri: sourceURL.replace(/[\/\\\-\:\.]/g, ""), email: email});
		     }).then(function(){
			 alert("Annotations for user: " + email + " are loaded");
		     });
}

function getURLParameter(name) {
    return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null
}


<commit_msg>delay 1 sec for annotation load on html document<commit_after>
if (typeof annotator === 'undefined') {
    alert("Oops! it looks like you haven't built Annotator. " +
          "Either download a tagged release from GitHub, or build the " +
          "package by running `make`");
} else {
    // DBMIAnnotator with highlight and DDI plugin
    var app = new annotator.App();

    app.include(annotator.ui.dbmimain);
    app.include(annotator.storage.debug);
    app.include(annotator.identity.simple);
    app.include(annotator.authz.acl);

    app.include(annotator.storage.http, {
	prefix: 'http://' + config.store.host + ':' + config.store.port
    });


    
    var sourceURL = getURLParameter("sourceURL").trim();
    var email = getURLParameter("email");
    
    var pageUri = function () {

	source = getURLParameter("sourceURL").trim();
    	return {
            beforeAnnotationCreated: function (ann) {
		ann.rawurl = source;
    		ann.uri = source.replace(/[\/\\\-\:\.]/g, "");		
		ann.email = email;
            }
    	};
    };
    app.include(pageUri);

    // load annotation after page contents loaded
    app.start().then(function () 
		     {
			 app.ident.identity = email;
			 $(".btn-success").css("display","block");
			 $("#subcontent").load(sourceURL);
		     }).then(function(){
			 setTimeout(function(){
			     app.annotations.load({uri: sourceURL.replace(/[\/\\\-\:\.]/g, ""), email: email});
			 }, 1000);
		     })
	.then(function(){
			 alert("Annotations for user: " + email + " are loaded");
	})
    ;
}

function getURLParameter(name) {
    return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null
}



{'fraction_non_alphanumeric': 0.19645539200961248, 'fraction_numerical': 0.0033042955842595375, 'mean_word_length': 2.8275862068965516, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5613057', 'n_tokens_mistral': 1138, 'n_tokens_neox': 1045, 'n_words': 204}