<commit_before><commit_msg>Easy way to create html<commit_after>/*jslint browser: true */

var SOG = SOG || {};
SOG.utils = SOG.utils || {};

SOG.utils.html = function (type, attributes) {
	'use strict';

	var n = document.createElement(type),
		as = attributes || {};
	// Append to parent
	if (as.to) {
		as.to.appendChild(n);
		delete as.to;
	}
	// Text
	if (as.text) {
		n.innerHTML = as.text;
		delete as.text;
	}
	// Href
	if (type === 'a' && !as.href) { n.setAttribute('href', '#'); }
	// Other attributes
	Object.keys(as).forEach(function (a) { n.setAttribute(a, as[a]); });

	return n;
};
{'fraction_non_alphanumeric': 0.20302013422818793, 'fraction_numerical': 0.0, 'mean_word_length': 3.3576642335766422, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4847100', 'n_tokens_mistral': 234, 'n_tokens_neox': 228, 'n_words': 52}