File: generate_max_key_length.php

package info (click to toggle)
php-voku-portable-ascii 2.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,336 kB
  • sloc: php: 5,651; xml: 46; makefile: 18
file content (20 lines) | stat: -rw-r--r-- 568 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php

require __DIR__ . '/../vendor/autoload.php';

$languages = \voku\helper\ASCII::getAllLanguages();

$languagesKeyLengths = [];
foreach ($languages as $language) {
    $langSpecific = \voku\helper\ASCII::charsArrayWithOneLanguage($language, false, false);

    $langSpecificKeyLength = \array_map('\mb_strlen', \array_keys($langSpecific));

    if (count($langSpecificKeyLength) === 0) {
        $languagesKeyLengths[$language] = 0;
    } else {
        $languagesKeyLengths[$language] = \max($langSpecificKeyLength);
    }
}

//var_export($languagesKeyLengths);