<commit_before>'use strict';

chrome.storage.sync.get({
	useTransliterator: true
}, function(items) {
	if (items.useTransliterator) {
		console.log("TODO find text that was in latin letters and transliterate it");
		console.log(Translitit);
	} else {
		console.log("Transliteration is off");
	}
});<commit_msg>transliterating every terminal text node<commit_after>'use strict';


chrome.storage.sync.get({
	useTransliterator: true
}, function(items) {
	if (items.useTransliterator) {
		window.setInterval(function(){
			var walkTheDOM = function walk(node, func) {
				func(node);
				node = node.firstChild;
				while (node) {
					walk(node, func);
					node = node.nextSibling;
				}
			};
			walkTheDOM(document.body, function(node) {
				if (node.nodeType === 1) {
					// alert(node.id); // alert if we have a type 1 node
					if (node.childElementCount === 0) {
						var previousText = node.textContent ? node.textContent.trim() : "";
						if (previousText) {
							// console.log(previousText);
							var changedText = Translitit(previousText);
							node.innerHTML = changedText;
							node.title = previousText;
						}
					}
				}
			});
		}, 2000);
	} else {
		console.log('Transliteration is off');
	}
});
{'fraction_non_alphanumeric': 0.14122448979591837, 'fraction_numerical': 0.005714285714285714, 'mean_word_length': 3.2422145328719725, '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': '94395', 'n_tokens_mistral': 492, 'n_tokens_neox': 392, 'n_words': 87}