<commit_before>$(function() {
	//Update "tied" elements on each change of the "fill" input
	interjector.fillNames.forEach(function(name) {
		$('#ijtr-fill-' + name).keyup(function() {
			$('#interjector .tied-' + name).text($('#ijtr-fill-' + name).val());
		});
	});
	//Deal with "a/an" selection
	$('#ijtr-option-a').click(function() {
		$('#interjector .tied-a-an').text('a');
	});
	$('#ijtr-option-an').click(function() {
		$('#interjector .tied-a-an').text('an');
	});
});

var interjector = {
	//Names of classes to update
	fillNames: [
		'linux',
		'gnu',
		'components',
		'os',
		'posix',
		'project',
		'kernel',
		'kernel-role',
		'osys',
	],
}<commit_msg>Move jQuery logic into separate functions<commit_after>$(function() {
	//Update "tied" elements on each change of the "fill" input
	interjector.fillNames.forEach(function(name) {
		interjector.registerUpdateHandler(name, function() {
			interjector.setTiedText(name, interjector.getFillText(name));
		});
	});
	//Deal with "a/an" selection
	$('#ijtr-option-a').click(function() {
		$('#interjector .tied-a-an').text('a');
	});
	$('#ijtr-option-an').click(function() {
		$('#interjector .tied-a-an').text('an');
	});
});

var interjector = {
	//Names of classes to update
	fillNames: [
		'linux',
		'gnu',
		'components',
		'os',
		'posix',
		'project',
		'kernel',
		'kernel-role',
		'osys',
	],
	//Get the element for filling in the value
	getFillElement: function(name) {
		return $('#ijtr-fill-' + name);
	},
	//Get the elements that are tied to the value
	getTiedElements: function(name) {
		return $('#interjector .tied-' + name);
	},
	//Register an event handler on update
	registerUpdateHandler: function(name, handler) {
		this.getFillElement(name).keyup(handler);
	},
	//Get the filled text
	getFillText: function(name) {
		return this.getFillElement(name).val();
	},
	//Set the text on the tied elements
	setTiedText: function(name, text) {
		this.getTiedElements(name).text(text);
	},
}
{'fraction_non_alphanumeric': 0.20478858889454915, 'fraction_numerical': 0.0, 'mean_word_length': 4.15485564304462, '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': '1594357', 'n_tokens_mistral': 749, 'n_tokens_neox': 717, 'n_words': 150}