#!/usr/bin/env php 
<?php 
 
/* 
 * This file is part of Chevere. 
 * 
 * (c) Rodolfo Berrios <[email protected]> 
 * 
 * For the full copyright and license information, please view the LICENSE 
 * file that was distributed with this source code. 
 */ 
 
declare(strict_types=1); 
 
use Rodber\Wordle\Wordlist; 
 
use function Chevere\Filesystem\directoryForPath; 
use function Chevere\Filesystem\fileForPath; 
 
require_once __DIR__ . '/vendor/autoload.php'; 
 
echo "? Build wordlists (3,8) for langs\n"; 
foreach(['en', 'es', 'pt'] as $lang) { 
    echo "* Processing... $lang"; 
    $file = fileForPath(__DIR__ . "/wordlist/$lang"); 
    $dir = directoryForPath(__DIR__ . "/app/lang/$lang/words"); 
    (new Wordlist($file))->split($dir); 
} 
 
 |