protected function execute(InputInterface $input, OutputInterface $output) { $kanjidic = new Kanjidic($input->getArgument("file"), false); $kanjidic->getEventDispatcher()->addListener(Events::PARSER_ENTRY, function (ParserEntryEvent $event) use($output) { $entry = $event->getEntry(); $output->write($entry->getLiteral()); }); $output->writeln("\n\nTotal dictionary entries: <info>" . count($kanjidic->getDictionary()) . "</info>"); }