<commit_before>const buildDom = (() =>{
	const tagRegex = new RegExp('^([\\w\\-]+)([\\.#].*)?$');
	const sigilRegex = new RegExp('^([\\.#])([\\w\\-]+)(.*)$');
	const contains = {}.hasOwnProperty;
	return function buildDom(obj) {
		if (obj instanceof Node) {return obj}
		if (Array.isArray(obj)) {return obj.map(buildDom)}
		if (typeof obj === 'string' || obj instanceof String) {return document.createTextNode(obj)}
		let {
			'': selector,
			c: children
		} = obj;
		const match = selector && tagRegex.exec(selector);
		let tag = match ? match[1] : 'div';
		selector = match ? match[2] : '';
		const ids = [], classes = [];
		while (selector) {
			const match = sigilRegex.exec(selector);
			if (!match) {throw "broken selector"}
			const [,sigil, string, rest] = match;
			if (sigil == '#') {
				ids.push(string);
			} else {
				classes.push(string);
			}
			selector = rest;
		}
		const el = document.createElement(tag);
		ids.length && (el.id = ids.join(' '));
		classes.length && (el.className = classes.join(' '));<commit_msg>fix edge case if element has default tag, but has sigils<commit_after>const buildDom = (() =>{
	const tagRegex = new RegExp('^([\\w\\-]+)([\\.#].*)?$');
	const sigilRegex = new RegExp('^([\\.#])([\\w\\-]+)(.*)$');
	const contains = {}.hasOwnProperty;
	return function buildDom(obj) {
		if (obj instanceof Node) {return obj}
		if (Array.isArray(obj)) {return obj.map(buildDom)}
		if (typeof obj === 'string' || obj instanceof String) {return document.createTextNode(obj)}
		let {
			'': selector,
			c: children
		} = obj;
		const match = selector && tagRegex.exec(selector);
		let tag = match ? match[1] : 'div';
		selector = match ? match[2] : selector||'';
		const ids = [], classes = [];
		while (selector) {
			const match = sigilRegex.exec(selector);
			if (!match) {throw "broken selector"}
			const [,sigil, string, rest] = match;
			if (sigil == '#') {
				ids.push(string);
			} else {
				classes.push(string);
			}
			selector = rest;
		}
		const el = document.createElement(tag);
		ids.length && (el.id = ids.join(' '));
		classes.length && (el.className = classes.join(' '));
{'fraction_non_alphanumeric': 0.2086669806877061, 'fraction_numerical': 0.0018841262364578427, 'mean_word_length': 3.5287846481876333, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5120191', 'n_tokens_mistral': 798, 'n_tokens_neox': 725, 'n_words': 183}