protected function execute(InputInterface $input, OutputInterface $output)
 {
     $packageId = $input->getArgument('package');
     $listPackages = (new NltkCorporaIndexDownloader())->getPackages();
     $packageFound = false;
     foreach ($listPackages as $package) {
         if ($packageId == $package->getId()) {
             $packageFound = true;
             $download = DPF::download($package);
             break;
         }
     }
     if (!$packageFound) {
         $output->writeln("Package {$packageId} was not found, try textconsole nltk:list, to see the available packages");
     } else {
         $output->writeln("Package {$package->getId()} - {$package->getName()} was installed into {$download->getInstallDir()}");
     }
 }
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $listPackages = (new NltkCorporaIndexDownloader())->getPackages();
     // create a new progress bar (50 units)
     $progress = new ProgressBar($output, count($listPackages));
     $progress->setFormat(' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%');
     // start and displays the progress bar
     $progress->start();
     foreach ($listPackages as $package) {
         // ... do some work
         $progress->setMessage("Downloading {$package->getName()}");
         $download = DPF::download($package);
         $progress->setMessage("Package {$package->getId()} - {$package->getName()} was installed into {$download->getInstallDir()}");
         // advance the progress bar 1 unit
         $progress->advance();
     }
     // ensure that the progress bar is at 100%
     $progress->finish();
 }