Beispiel #1
0
 * Add ?output=1 to the URL to generate languag files in /tmp/lang/ with just
 * the number of terms you want.
 */
/**
 * Requires
 */
die;
require_once '../../inc/global.inc.php';
require_once 'langstats.class.php';
/**
 * Init
 */
$terms_limit = 10000 + 50;
$x_most_popular = 2000;
$output = false;
$ls = new langstats();
if ($ls === false) {
    exit($ls->error);
}
$list = $ls->get_popular_terms($x_most_popular);
if ($_GET['output'] == 1) {
    $output = true;
    $variables_origin = $ls->get_variables_origin();
}
/**
 * Display
 */
if (count($list) == 0) {
    echo 'No terms loaded so far';
}
if (count($list) > 0) {
 * This script generates a directory based on the English language variables
 * but only composed of the 10,000 (can be configured) most frequent words
 * used in Chamilo. This implies first using the langstats.php script, which
 * in turn implies configuring an additional variable in configuration.php
 * (see langstats.php for more info).
 * When running the language_builder, please make sure this parameter is
 * set to 0 in the configuration.php file, otherwise it will take *ages*.
 */
/**
 * Requires
 */
require_once '../../inc/global.inc.php';
require_once 'langstats.class.php';
global $_configuration;
$_configuration['language_measure_frequency'] = 0;
$langstats = new langstats();
$orig_lang = 'english';
/**
 * Init
 */
$words_limit = 10000;
//change this if you want more words
$terms_limit = 3000;
//change this if you think you'll need more terms
$terms = $langstats->get_popular_terms($terms_limit);
$words_counter = 0;
$i = 0;
$terms_in_limit = array();
$lang_dir = api_get_path(SYS_LANG_PATH);
$arch_dir = api_get_path(SYS_ARCHIVE_PATH);
/**