Exemplo n.º 1
0
 public function testLookByRadical()
 {
     $result = self::$kanjidic->lookByRadical(Radical::CLASSICAL, 7);
     $this->assertDicEntries($result, 1);
     $result = self::$kanjidic->lookByRadical(Radical::CLASSICAL, 30);
     $this->assertDicEntries($result, 1);
 }
 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>");
 }