@ -1,5 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script generates a directory based on the English language variables
* but only composed of the 10,000 (can be configured) most frequent words
@ -9,9 +10,7 @@
* 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;
@ -33,7 +32,9 @@ $arch_dir = api_get_path(SYS_ARCHIVE_PATH);
* Code run
*/
foreach ($terms as $row) {
if ($words_counter > 10000) { break; }
if ($words_counter > 10000) {
break;
}
$words = str_word_count(get_lang($row['term_name'], null, $orig_lang));
$words_counter += $words;
$terms_in_limit[$row['term_name']] = $i;
@ -59,7 +60,9 @@ $words_found = 0;
$global_var = array(); //keep the combination of all vars
$terms_in_limit = array_flip($terms_in_limit);
foreach ($list_files as $file) {
if (substr($file, 0, 1) == '.') {continue; }
if (substr($file, 0, 1) == '.') {
continue;
}
//echo "'".substr($file,0,-8)."',< br / > "; //print in a PHP array format
$vars = file($lang_dir.'/'.$orig_lang.'/'.$file);
$local_var = array();
@ -90,7 +93,9 @@ foreach ($list_files as $file) {
$global_var += $local_var;
};
$terms_diff = count($global_var) - count($terms_in_limit);
echo count($global_var)." terms found in English files (summing up to $words_found words). Some terms ($terms_diff in this case) might have appeared in two different files< br / > ";
echo count(
$global_var
)." terms found in English files (summing up to $words_found words). Some terms ($terms_diff in this case) might have appeared in two different files< br / > ";
/**
* Display results
*/