<commit_before>/*
var genespreadsheet = new Array();
var genes;
*/

// Map View
var genemap = GENEMAP.GeneMap({apiUrl: api_url}).width(750).height(400);
var knetmaps = KNETMAPS.KnetMaps();

/*
Functions for show and hide structures when a button is pressed
*/

/*
 * Function to escape special characters from a string for use in jquery selector
 */
function escapeJquerySelectors(exp){
	return exp.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]^`{|}~]/g, '\\$&');
}

function showSynonymTable(option,tabBoxRelated){
$('.suggestorTable:visible').fadeOut(0,function(){
		option = escapeJquerySelectors(option);
		tabBoxRelated = escapeJquerySelectors(tabBoxRelated);
		$('.synonym_right_border').attr('src','html/image/synonym_right_off.png');
		$('.synonym_left_border').attr('src','html/image/synonym_left_off.png');
		$('.buttonSynonym_on').attr('class','buttonSynonym_off');

		$('.tabBox:visible').fadeOut();
		$('#'+tabBoxRelated).fadeIn();

		//Gets the table related to the active tab
		relatedTable = $('#'+tabBoxRelated+' div.conceptTabOn').attr('rel');
		relatedTable = escapeJquerySelectors(relatedTable);
		$('#'+relatedTable).fadeIn();

		$('#'+option+'_buttonSynonym').attr('class','buttonSynonym_on');
		$('#'+option+'synonym_right_border').attr('src','html/image/synonym_right_on.png');
		$('#'+option+'synonym_left_border').attr('src','html/image/synonym_left_on.png');
	});
}

function showSynonymTab(tabFrom,tabItemFrom,tableTo){
$('.suggestorTable:visible').fadeOut(0,function(){
		tabFrom = escapeJquerySelectors(tabFrom);
		tabItemFrom = escapeJquerySelectors(tabItemFrom);
		tableTo = escapeJquerySelectors(tableTo);

		//$('#'+tabFrom+' .conceptTabOn').attr('class','conceptTabOff');
		$('#'+tabFrom+' .conceptTabOn').toggleClass('conceptTabOff conceptTabOn');
		$('#'+tableTo).fadeIn();
		//$('#'+tabItemFrom).attr('class','conceptTabOn');
		$('#'+tabItemFrom).toggleClass('conceptTabOff conceptTabOn');
	});
}

function activateButton(option){
$('.resultViewer:visible').fadeOut(0,function(){
		$('.button_off').attr('class','button_on');
		$('#'+option).fadeIn();
		$('#'+option+'_button').attr('class','button_off');

		//Collapse Suggestor view
		$('#suggestor_search').attr('src', 'html/image/expand.gif');
		$('#suggestor_search_area').slideUp(500);
	});
}
/*
Functions for Add, Remove or Replace terms from the query search box
*/
function addKeyword(keyword, from, target){
	query = $('#'+target).val();
	if(keyword.indexOf(' ') != -1 && keyword.indexOf('"') == -1)
		keyword = '"'+keyword+'"';
	newquery = query+' OR '+keyword;
	$('#'+target).val(newquery);
	//$('#'+from).parent().attr('onClick','addKeywordUndo(\''+keyword+'\',\''+from+'\',\''+target+'\')');
	//$('#'+from).attr('class','addKeywordUndo');
	$('#'+from).toggleClass('addKeywordUndo addKeyword');
	//Updates the query counter
	matchCounter();

        // Refresh the query suggester table as well by replicating its 'click' event.
        refreshQuerySuggester();
}

function addKeywordUndo(keyword, from, target){
	query = $('#'+target).val();
	if(keyword.indexOf(' ') != -1 && keyword.indexOf('"') == -1)
		keyword = '"'+keyword+'"';
	newquery = query.replace(' OR '+keyword, "");
	$('#'+target).val(newquery);
	//$('#'+from).parent().attr('onClick','addKeyword(\''+keyword+'\',\''+from+'\',\''+target+'\')');
	//$('#'+from).attr('class','addKeyword');
	$('#'+from).toggleClass('addKeywordUndo addKeyword');
	//Updates the query counter
	matchCounter();

        // Refresh the query suggester table as well by replicating its 'click' event.
        refreshQuerySuggester();
}

function excludeKeyword(keyword, from, target){
	query = $('#'+target).val();
	if(keyword.indexOf(' ') != -1 && keyword.indexOf('"') == -1)
		keyword = '"'+keyword+'"';
	newquery = query+' NOT '+keyword;
	$('#'+target).val(newquery);
	//$('#'+from).parent().attr('onClick','excludeKeywordUndo(\''+keyword+'\',\''+from+'\',\''+target+'\')');
	//$('#'+from).attr('class','excludeKeywordUndo');
	$('#'+from).toggleClass('excludeKeywordUndo excludeKeyword');
	//Updates the query counter
	matchCounter();

        // Refresh the query suggester table as well by replicating its 'click' event.
        refreshQuerySuggester();
}

function excludeKeywordUndo(keyword, from, target){
	query = $('#'+target).val();
	if(keyword.indexOf(' ') != -1 && keyword.indexOf('"') == -1)
		keyword = '"'+keyword+'"';
	newquery = query.replace(' NOT '+keyword, "");
	$('#'+target).val(newquery);
	//$('#'+from).parent().attr('onClick','excludeKeyword(\''+keyword+'\',\''+from+'\',\''+target+'\')');
	//$('#'+from).attr('class','excludeKeyword');
	$('#'+from).toggleClass('excludeKeywordUndo excludeKeyword');<commit_msg>Removed previous quoting keywords code so now properly consistent.<commit_after>/*
var genespreadsheet = new Array();
var genes;
*/

// Map View
var genemap = GENEMAP.GeneMap({apiUrl: api_url}).width(750).height(400);
var knetmaps = KNETMAPS.KnetMaps();

/*
Functions for show and hide structures when a button is pressed
*/

/*
 * Function to escape special characters from a string for use in jquery selector
 */
function escapeJquerySelectors(exp){
	return exp.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]^`{|}~]/g, '\\$&');
}

function showSynonymTable(option,tabBoxRelated){
$('.suggestorTable:visible').fadeOut(0,function(){
		option = escapeJquerySelectors(option);
		tabBoxRelated = escapeJquerySelectors(tabBoxRelated);
		$('.synonym_right_border').attr('src','html/image/synonym_right_off.png');
		$('.synonym_left_border').attr('src','html/image/synonym_left_off.png');
		$('.buttonSynonym_on').attr('class','buttonSynonym_off');

		$('.tabBox:visible').fadeOut();
		$('#'+tabBoxRelated).fadeIn();

		//Gets the table related to the active tab
		relatedTable = $('#'+tabBoxRelated+' div.conceptTabOn').attr('rel');
		relatedTable = escapeJquerySelectors(relatedTable);
		$('#'+relatedTable).fadeIn();

		$('#'+option+'_buttonSynonym').attr('class','buttonSynonym_on');
		$('#'+option+'synonym_right_border').attr('src','html/image/synonym_right_on.png');
		$('#'+option+'synonym_left_border').attr('src','html/image/synonym_left_on.png');
	});
}

function showSynonymTab(tabFrom,tabItemFrom,tableTo){
$('.suggestorTable:visible').fadeOut(0,function(){
		tabFrom = escapeJquerySelectors(tabFrom);
		tabItemFrom = escapeJquerySelectors(tabItemFrom);
		tableTo = escapeJquerySelectors(tableTo);

		//$('#'+tabFrom+' .conceptTabOn').attr('class','conceptTabOff');
		$('#'+tabFrom+' .conceptTabOn').toggleClass('conceptTabOff conceptTabOn');
		$('#'+tableTo).fadeIn();
		//$('#'+tabItemFrom).attr('class','conceptTabOn');
		$('#'+tabItemFrom).toggleClass('conceptTabOff conceptTabOn');
	});
}

function activateButton(option){
$('.resultViewer:visible').fadeOut(0,function(){
		$('.button_off').attr('class','button_on');
		$('#'+option).fadeIn();
		$('#'+option+'_button').attr('class','button_off');

		//Collapse Suggestor view
		$('#suggestor_search').attr('src', 'html/image/expand.gif');
		$('#suggestor_search_area').slideUp(500);
	});
}
/*
Functions for Add, Remove or Replace terms from the query search box
*/
function addKeyword(keyword, from, target){
	query = $('#'+target).val();
	newquery = query+' OR '+keyword;
	$('#'+target).val(newquery);
	//$('#'+from).parent().attr('onClick','addKeywordUndo(\''+keyword+'\',\''+from+'\',\''+target+'\')');
	//$('#'+from).attr('class','addKeywordUndo');
	$('#'+from).toggleClass('addKeywordUndo addKeyword');
	//Updates the query counter
	matchCounter();

        // Refresh the query suggester table as well by replicating its 'click' event.
        refreshQuerySuggester();
}

function addKeywordUndo(keyword, from, target){
	query = $('#'+target).val();
	newquery = query.replace(' OR '+keyword, "");
	$('#'+target).val(newquery);
	//$('#'+from).parent().attr('onClick','addKeyword(\''+keyword+'\',\''+from+'\',\''+target+'\')');
	//$('#'+from).attr('class','addKeyword');
	$('#'+from).toggleClass('addKeywordUndo addKeyword');
	//Updates the query counter
	matchCounter();

        // Refresh the query suggester table as well by replicating its 'click' event.
        refreshQuerySuggester();
}

function excludeKeyword(keyword, from, target){
	query = $('#'+target).val();
	newquery = query+' NOT '+keyword;
	$('#'+target).val(newquery);
	//$('#'+from).parent().attr('onClick','excludeKeywordUndo(\''+keyword+'\',\''+from+'\',\''+target+'\')');
	//$('#'+from).attr('class','excludeKeywordUndo');
	$('#'+from).toggleClass('excludeKeywordUndo excludeKeyword');
	//Updates the query counter
	matchCounter();

        // Refresh the query suggester table as well by replicating its 'click' event.
        refreshQuerySuggester();
}

function excludeKeywordUndo(keyword, from, target){
	query = $('#'+target).val();
	newquery = query.replace(' NOT '+keyword, "");
	$('#'+target).val(newquery);
	//$('#'+from).parent().attr('onClick','excludeKeyword(\''+keyword+'\',\''+from+'\',\''+target+'\')');
	//$('#'+from).attr('class','excludeKeyword');
	$('#'+from).toggleClass('excludeKeywordUndo excludeKeyword');
{'fraction_non_alphanumeric': 0.2392339200708513, 'fraction_numerical': 0.003542566146352264, 'mean_word_length': 6.135860979462875, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3630677', 'n_tokens_mistral': 3063, 'n_tokens_neox': 2989, 'n_words': 489}