<commit_before>/* 
* Compute the fringe and the relevance scores 
*/

var algorithm = (function(){

// Initialize the relevance scores, then insert papers from Core, toRead and Selected
function generateFringe(){
	P.all(initializeRelevanceScore);
  P.interesting(updateRelevanceScoresWhenInserting);
}

// Insert the papers that have just been selected, and removes the ones that have been deselected (if any)
function updateFringe(){
	userData.newSelectedPapers.forEach(updateRelevanceScoresWhenInserting);
	userData.newDeselectedPapers.forEach(updateRelevanceScoresWhenRemoving);
	userData.newSelectedPapers=[];
	userData.newDeselectedPapers=[];
}


function updateRelevanceScoresWhenInserting(pSource){
	// pSource is provided to the callback in forEach
	updateRelevanceScores(pSource, true);
}

function updateRelevanceScoresWhenRemoving(pSource){
	updateRelevanceScores(pSource, false);
}


/////////////////////	Private	functions 	////////////////////////////

function initializeRelevanceScore(p) {
	p.score = p.adjustedCitationCount;
	p.upvoters = 0;
}<commit_msg>Sorry, that broke the fringe...<commit_after>/* 
* Compute the fringe and the relevance scores 
*/

var algorithm = (function(){

// Initialize the relevance scores, then insert papers from Core, toRead and Selected
function generateFringe(){
	P.all(initializeRelevanceScore);
  P.interesting(updateRelevanceScoresWhenInserting);
}

// Insert the papers that have just been selected, and removes the ones that have been deselected (if any)
function updateFringe(){
	userData.newSelectedPapers.forEach(updateRelevanceScoresWhenInserting);
	userData.newDeselectedPapers.forEach(updateRelevanceScoresWhenRemoving);
	userData.newSelectedPapers=[];
	userData.newDeselectedPapers=[];
}


function updateRelevanceScoresWhenInserting(pSource){
	// pSource is provided to the callback in forEach
	updateRelevanceScores(pSource, true);
}

function updateRelevanceScoresWhenRemoving(pSource){
	updateRelevanceScores(pSource, false);
}


/////////////////////	Private	functions 	////////////////////////////

function initializeRelevanceScore(p) {
	p.score = p.adjustedCitationCount();
	p.upvoters = 0;
}
{'fraction_non_alphanumeric': 0.12846580406654343, 'fraction_numerical': 0.0009242144177449168, 'mean_word_length': 4.81989247311828, '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': '6294233', 'n_tokens_mistral': 670, 'n_tokens_neox': 609, 'n_words': 154}