<commit_before>/*global define*/
/*jslint white:true, eqeq:true, regexp:true*/
define(function() {
	"use strict";
	
	/**
	 * Splits a Pascal-Case word into individual words separated by spaces. 
	 * @param {Object} word
	 * @returns {String}
	 */
	function splitPascalCase(word) {
		var wordRe = /($[a-z])|[A-Z][^A-Z]+/g;
		return word.match(wordRe).join(" ");
	}
	
	
	/**
	 * Splits a camelCase or PascalCase word into individual words separated by spaces. 
	 * @param {Object} word
	 * @returns {String}
	 */
	function splitCamelCase(word) {
		var output, i, l, capRe = /[A-Z]/;
		if (typeof(word) !== "string") {
			throw new Error("The \"word\" parameter must be a string.");
		}
		output = [];
		for (i = 0, l = word.length; i < l; i += 1) {
			if (i === 0) {
				output.push(word[i].toUpperCase());
			}
			else {
				if (i > 0 && capRe.test(word[i])) {
					output.push(" ");
				}
				output.push(word[i]);
			}
		}
		return output.join("");
	}
	
	/**
	 * Creates an HTML DL of the attributes of an esri.Graphic (or any object that has a property named attributes that is an object). 
	 * @param {Object} graphic An esri.Graphic (or any object that has a property named attributes that is an object).
	 * @param {Regex} [ignoreRe] Any attribute with a name matching this Regex will be omitted from the output DL.  If no RE is given, all properties will be included. 
	 * @returns {String}
	 */
	function graphicToList(graphic, ignoreRe) {
		var output, attributes = graphic.attributes, name;
		if (graphic != null && graphic.attributes != null) {
			output = ["<dl>"];
			for (name in attributes) {
				if (attributes.hasOwnProperty(name) && (ignoreRe == null || ignoreRe.exec(name) === null)) {
					output.push(["<dt>", splitPascalCase(name), "</dt>", "<dd>", attributes[name], "</dd>"].join(""));
				}
			}
			output.push("</dl>");
			output = output.join("");
		}
		return output;
	}
	
	return {
		graphicToList: graphicToList,
		splitPascalCase: splitPascalCase,
		splitCamelCase: splitCamelCase
	};
});<commit_msg>Null values are now represented with "(null)" instead of "".<commit_after>/*global define*/
/*jslint white:true, eqeq:true, regexp:true*/
define(function() {
	"use strict";
	
	/**
	 * Splits a Pascal-Case word into individual words separated by spaces. 
	 * @param {Object} word
	 * @returns {String}
	 */
	function splitPascalCase(word) {
		var wordRe = /($[a-z])|[A-Z][^A-Z]+/g;
		return word.match(wordRe).join(" ");
	}
	
	
	/**
	 * Splits a camelCase or PascalCase word into individual words separated by spaces. 
	 * @param {Object} word
	 * @returns {String}
	 */
	function splitCamelCase(word) {
		var output, i, l, capRe = /[A-Z]/;
		if (typeof(word) !== "string") {
			throw new Error("The \"word\" parameter must be a string.");
		}
		output = [];
		for (i = 0, l = word.length; i < l; i += 1) {
			if (i === 0) {
				output.push(word[i].toUpperCase());
			}
			else {
				if (i > 0 && capRe.test(word[i])) {
					output.push(" ");
				}
				output.push(word[i]);
			}
		}
		return output.join("");
	}
	
	/**
	 * Creates an HTML DL of the attributes of an esri.Graphic (or any object that has a property named attributes that is an object). 
	 * @param {Object} graphic An esri.Graphic (or any object that has a property named attributes that is an object).
	 * @param {Regex} [ignoreRe] Any attribute with a name matching this Regex will be omitted from the output DL.  If no RE is given, all properties will be included. 
	 * @returns {String}
	 */
	function graphicToList(graphic, ignoreRe) {
		var output, attributes = graphic.attributes, name;
		if (graphic != null && graphic.attributes != null) {
			output = ["<dl>"];
			for (name in attributes) {
				if (attributes.hasOwnProperty(name) && (ignoreRe == null || ignoreRe.exec(name) === null)) {
					output.push(["<dt>", splitPascalCase(name), "</dt>", "<dd>", attributes[name] || "(null)", "</dd>"].join(""));
				}
			}
			output.push("</dl>");
			output = output.join("");
		}
		return output;
	}
	
	return {
		graphicToList: graphicToList,
		splitPascalCase: splitPascalCase,
		splitCamelCase: splitCamelCase
	};
});
{'fraction_non_alphanumeric': 0.16686907942676707, 'fraction_numerical': 0.0019431624969638087, 'mean_word_length': 3.3301787592008414, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '7622546', 'n_tokens_mistral': 1543, 'n_tokens_neox': 1346, 'n_words': 420}