<commit_before><?php
if($sentence != null){
	$this->pageTitle = __('Example sentence : ',true) . $sentence['Sentence']['text'];

	// navigation (previous, random, next)
	$navigation->displaySentenceNavigation();
	
	echo '<div class="sentences_set">';
		// sentence menu (translate, edit, comment, etc)
		$specialOptions['belongsTo'] = $sentence['User']['username']; // TODO set up a better mechanism
		$sentences->displayMenu($sentence['Sentence']['id'], $sentence['Sentence']['lang'], $specialOptions);

		// sentence and translations
		$t = (isset($sentence['Translation'])) ? $sentence['Translation'] : array();
		$sentence['User']['canEdit'] = $specialOptions['canEdit']; // TODO set up a better mechanism
		$sentences->displayGroup($sentence['Sentence'], $t, $sentence['User']);
	echo '</div>';
	
	//$tooltip->displayAdoptTooltip(); 
	
	echo '<script type="text/javascript">
	$(document).ready(function(){
		$(".translations").html("<div class=\"loading\">'.addslashes($html->image('loading.gif')).'</div>");
		$(".translations").load("../get_translations/'.$sentence['Sentence']['id'].'");
	});
	</script>';
	
}else{
	$this->pageTitle = __('Sentence does not exist : ', true) . $this->params['pass'][0];
	
	// navigation (previous, random, next)
	$navigation->displaySentenceNavigation('random');
	
	echo '<div class="error">';
	__('There is no sentence with id ');
	echo $this->params['pass'][0];
	echo '</div>';
}
?><commit_msg>Using absolute path instead of relative for ajax load because translations were not properly loaded in "Browse" section when URL ends with a slash. <commit_after><?php
if($sentence != null){
	$this->pageTitle = __('Example sentence : ',true) . $sentence['Sentence']['text'];

	// navigation (previous, random, next)
	$navigation->displaySentenceNavigation();
	
	echo '<div class="sentences_set">';
		// sentence menu (translate, edit, comment, etc)
		$specialOptions['belongsTo'] = $sentence['User']['username']; // TODO set up a better mechanism
		$sentences->displayMenu($sentence['Sentence']['id'], $sentence['Sentence']['lang'], $specialOptions);

		// sentence and translations
		$t = (isset($sentence['Translation'])) ? $sentence['Translation'] : array();
		$sentence['User']['canEdit'] = $specialOptions['canEdit']; // TODO set up a better mechanism
		$sentences->displayGroup($sentence['Sentence'], $t, $sentence['User']);
	echo '</div>';
	
	//$tooltip->displayAdoptTooltip(); 
	
	echo '<script type="text/javascript">
	$(document).ready(function(){
		$(".translations").html("<div class=\"loading\">'.addslashes($html->image('loading.gif')).'</div>");
		$(".translations").load("http://" + self.location.hostname + "/sentences/get_translations/'.$sentence['Sentence']['id'].'");
	});
	</script>';
	
}else{
	$this->pageTitle = __('Sentence does not exist : ', true) . $this->params['pass'][0];
	
	// navigation (previous, random, next)
	$navigation->displaySentenceNavigation('random');
	
	echo '<div class="error">';
	__('There is no sentence with id ');
	echo $this->params['pass'][0];
	echo '</div>';
}
?>
{'fraction_non_alphanumeric': 0.22313237221494103, 'fraction_numerical': 0.001310615989515072, 'mean_word_length': 5.829977628635347, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 41, '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': '5258455', 'n_tokens_mistral': 953, 'n_tokens_neox': 898, 'n_words': 202}