<commit_before><?php

//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
  header("location: index.php");
  exit;
}

$ranking = $tikilib->get_top_pages($module_rows);

$smarty->assign('modTopPages', $ranking);
$smarty->assign('nonums', isset($module_params["nonums"]) ? $module_params["nonums"] : 'n');
$smarty->assign('module_rows', $module_rows);
?>
<commit_msg>[FIX] make top pages ranking consistent whether using module or wiki_rankings. Not sure what else still using get_top_pages  - it is duplicated code to the stuff in ranklib.<commit_after><?php

//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
  header("location: index.php");
  exit;
}

include_once ('lib/rankings/ranklib.php');
$ranking = $ranklib->wiki_ranking_top_pages($module_rows);

$smarty->assign('modTopPages', $ranking["data"]);
$smarty->assign('nonums', isset($module_params["nonums"]) ? $module_params["nonums"] : 'n');
$smarty->assign('module_rows', $module_rows);
?>

{'fraction_non_alphanumeric': 0.17311072056239016, 'fraction_numerical': 0.0, 'mean_word_length': 6.7482993197278915, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '1759931', 'n_tokens_mistral': 373, 'n_tokens_neox': 366, 'n_words': 90}