<commit_before>function ddg_spice_mass_on_time (api_result) {
    if (api_result.error) return;

    var details = api_result['query-details'];

    var generate_header = function (query_details) {
	var type = "";
	//Convert the query type to plural and capitalize
	if (query_details.type == "mass") {
	  type = "Masses";
	} else if (query_details.type == "parish") {
	  type = "Parishes";
	} else {
	  type = query_details.type.charAt(0).toUpperCase() + query_details.type.slice(1) + "s";
	}

	//Add the location string
	return type + " near " + query_details.address;
    };

    //Parishes return different info than events, so a different template is in order for those
    var pick_item_template = function (query_details) {
	if (query_details.type == "parish") {
	  return "mass_on_time_church";
	} else {
	  return "mass_on_time";
	}
    };

    //Return if service couldn't find the address given
    if (details.location.lat == 0 && details.location.lng == 0) return;

    //Filter results with no address
    var results = [];
    for(var i=api_result.results.length-1; i>=0; i--) {
      var result=api_result.results[i];
      if (result.address != null && result.address !== "") {
	results.push(result);
      }
    }

    if (results.length < 1) return;

    Spice.render({
	data              : api_result,
	header1           : generate_header(details),
	source_name       : "Mass On Time",
	spice_name        : 'mass_on_time',
	source_url        : 'http://massontime.com/nearest/' + details.type +
	  "/25?lat=" + details.location.lat + "&lng=" + details.location.lng,
	template_frame   : 'list',
	template_options : {
            items: results,
            show: 3,
            max:  10,
            template_item: pick_item_template(details)
	},
	force_no_fold     : true,
	force_big_header  : true,
	force_favicon_url : 'http://massontime.com/favicon.ico'
    });
}

  /*
   ###  Handlebars Helpers ###
   */

//Event types are returns as integers. This converts them to their string reps.
Handlebars.registerHelper( "format_eventtypeid", function (eventtypeid) {
	switch (eventtypeid) {
	case 1:
	    return "Adoration";
	case 2:
	    return "Confession";
	case 3:
	    return "Devotion";
	case 5:
	    return "Holy Day Mass";
	case 6:
	    return "Holy Day Mass (Vigil)";
	case 7:
	    return "Weekday Mass";
	case 8:
	    return "Weekend Mass";
	default:
	    return "Service";
	};
});

Handlebars.registerHelper( "backup_link", function (webaddress, parish_id) {
	if (webaddress === "http://" || webaddress === "") {
	  return "http://massontime.com/parish/" + parish_id;
	} else {
	  return webaddress;
	}<commit_msg>MassOnTime: Replaced link to parish website with link to MassOnTime. (There is a link to the parish website on MassOnTime)<commit_after>function ddg_spice_mass_on_time (api_result) {
    if (api_result.error) return;

    var details = api_result['query-details'];

    var generate_header = function (query_details) {
	var type = "";
	//Convert the query type to plural and capitalize
	if (query_details.type == "mass") {
	  type = "Masses";
	} else if (query_details.type == "parish") {
	  type = "Parishes";
	} else {
	  type = query_details.type.charAt(0).toUpperCase() + query_details.type.slice(1) + "s";
	}

	//Add the location string
	return type + " near " + query_details.address;
    };

    //Parishes return different info than events, so a different template is in order for those
    var pick_item_template = function (query_details) {
	if (query_details.type == "parish") {
	  return "mass_on_time_church";
	} else {
	  return "mass_on_time";
	}
    };

    //Return if service couldn't find the address given
    if (details.location.lat == 0 && details.location.lng == 0) return;

    //Filter results with no address
    var results = [];
    for(var i=api_result.results.length-1; i>=0; i--) {
      var result=api_result.results[i];
      if (result.address != null && result.address !== "") {
	results.push(result);
      }
    }

    if (results.length < 1) return;

    Spice.render({
	data              : api_result,
	header1           : generate_header(details),
	source_name       : "Mass On Time",
	spice_name        : 'mass_on_time',
	source_url        : 'http://massontime.com/nearest/' + details.type +
	  "/25?lat=" + details.location.lat + "&lng=" + details.location.lng,
	template_frame   : 'list',
	template_options : {
            items: results,
            show: 3,
            max:  10,
            template_item: pick_item_template(details)
	},
	force_no_fold     : true,
	force_big_header  : true,
	force_favicon_url : 'http://massontime.com/favicon.ico'
    });
}

  /*
   ###  Handlebars Helpers ###
   */

//Event types are returns as integers. This converts them to their string reps.
Handlebars.registerHelper( "format_eventtypeid", function (eventtypeid) {
	switch (eventtypeid) {
	case 1:
	    return "Adoration";
	case 2:
	    return "Confession";
	case 3:
	    return "Devotion";
	case 5:
	    return "Holy Day Mass";
	case 6:
	    return "Holy Day Mass (Vigil)";
	case 7:
	    return "Weekday Mass";
	case 8:
	    return "Weekend Mass";
	default:
	    return "Service";
	};
});

Handlebars.registerHelper( "backup_link", function (webaddress, parish_id) {
        return "http://massontime.com/parish/" + parish_id;
{'fraction_non_alphanumeric': 0.13152440173355945, 'fraction_numerical': 0.007537214999057848, 'mean_word_length': 2.958240119313945, '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': '6426172', 'n_tokens_mistral': 1821, 'n_tokens_neox': 1727, 'n_words': 450}