<commit_before><?php
class SimpleTextNavigation implements Navigation {
	
	var $pathToContent = "";
	
	function SimpleTextNavigation($pathToContent) {
		$this->$pathToContent = $pathToContent;	
	}
	
	function build($nav) {
		$topNav = "";
		$navString = "";
		
		foreach($nav as $parent) {
			$linkid = $parent['id'];
			
			$topLink = "";
		   	$topLink .= "<a class=\"links\" href=\"".$linkid.".html\">".$parent['label']."</a>&nbsp;&nbsp;";
		   
			if($parent['childs'] != null) {
				foreach($parent['childs'] as $entry) {
					if(strpos($entry['href'], $this->$pathToContent) !== false) {
				    	$link = str_replace($this->$pathToContent, "", $entry['href']);
				    }
		    		        	
				    $link = str_replace(".xml", ".html", $link);
				    $navString .= "<a href=\"".$entry['id'].".html\">".$entry['label']."</a><br>";
				    $target = "";
				}
			}
			$topNav .= $topLink;
			$topNav .= "\n";
		}
		return $topNav;
	}
}

?><commit_msg>now able to deal with external links<commit_after><?php
class SimpleTextNavigation implements Navigation {
	
	var $pathToContent = "";
	
	function SimpleTextNavigation($pathToContent) {
		$this->$pathToContent = $pathToContent;	
	}
	
	function build($nav) {
		$topNav = "";
		$navString = "";
		
		foreach($nav as $parent) {
			$linkid = $parent['id'];
			
			$topLink = "";
		   	if(strpos($parent['href'], "http://") !== false) {
		   		$topLink .= "<a class=\"links\" href=\"".$parent['href']."\">".$parent['label']."</a>&nbsp;&nbsp;";
			} else {
   				$topLink .= "<a class=\"links\" href=\"".$linkid.".html\">".$parent['label']."</a>&nbsp;&nbsp;";
			}
			
			if($parent['childs'] != null) {
				foreach($parent['childs'] as $entry) {
					if(strpos($entry['href'], $this->$pathToContent) !== false) {
				    	$link = str_replace($this->$pathToContent, "", $entry['href']);
				    }
		    		        	
				    $link = str_replace(".xml", ".html", $link);
				    $navString .= "<a href=\"".$entry['id'].".html\">".$entry['label']."</a><br>";
				    $target = "";
				}
			}
			$topNav .= $topLink;
			$topNav .= "\n";
		}
		return $topNav;
	}
}

?>
{'fraction_non_alphanumeric': 0.24680246328754146, 'fraction_numerical': 0.0, 'mean_word_length': 2.8752293577981654, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '2399693', 'n_tokens_mistral': 873, 'n_tokens_neox': 734, 'n_words': 114}