/**
  * @param string|\Closure $input
  * @param string|null $filename
  * @param string|null $title
  * @param (string|string[]|float)[][][] $jsonable
  * @param (string|string[])[] $metadata
  * @param string[] $logLevels
  * @dataProvider dictionaryProvider
  */
 public function testParse($input, string $filename = null, string $title = null, array $jsonable = null, array $metadata = null, array $logLevels = [])
 {
     $parser = new GenericDictionaryParser();
     $parser->setLogger($this);
     if ($input instanceof \Closure) {
         $archive = $input();
         $file = new \SplFileInfo($archive->filename);
         $archive->close();
         $dictionary = $parser->parse($file, $filename, $title);
     } else {
         $dictionary = $parser->parse($this->generateTempFileObject(mb_check_encoding($input, 'UTF-8') ? $this->stripIndents($input) : $input), $filename, $title);
     }
     array_walk_recursive($jsonable, (function (&$field) {
         if (is_string($field)) {
             $field = $this->stripIndents($field);
         }
     })->bindTo($this));
     $this->assertEquals($jsonable, $dictionary->getWords());
     array_walk_recursive($metadata, (function (string &$field) {
         if (is_string($field)) {
             $field = $this->stripIndents($field);
         }
     })->bindTo($this));
     $this->assertEquals($metadata, $dictionary->getMetadata());
     $this->assertEquals($logLevels, $this->logLevels);
 }
 /**
  * アーカイブ中のファイル名の符号化方式をUTF-8に矯正します。
  * @param ZipOutputFile $archive
  */
 protected function correctArchiveFilenamesEncoding(ZipOutputFile $archive)
 {
     $parser = new GenericDictionaryParser();
     foreach ($archive->getListFiles() as $filename) {
         $corrected = $parser->correctEncoding($filename);
         if ($filename !== $corrected) {
             $archive->rename($filename, $corrected);
         }
     }
 }