ankiService->getAllSentenceNoteIds();
$allNotes = $this->ankiService->getNotes($allIds);
$kanjiNotes = [];
foreach ($allNotes as $note) {
if (!$note instanceof SentenceNote) throw new \Exception(sprintf(
'Expected SentenceNote, got %s',
$note::class,
));
foreach ($note->getTerms() as $term) {
assert($term instanceof Term);
if (key_exists($term->getKanji(), $kanjiNotes)) continue;
$newNote = new Note();
echo $note->getFields()['SentKanji'];
echo '
';
echo var_dump($note->getHighlightedKanji());
echo '
';
//echo $term->getKanji();
//echo ' | ';
$kanjiNotes[$term->getKanji()] = $newNote;
}
}
die();
}
#[Route('/nonconforming', name: 'nonconforming')]
public function nonconforming(): Response
{
$allIds = $this->ankiService->getAllNoteIds();
$allNotes = $this->ankiService->getNotes($allIds);
$lacking = array_filter($allNotes, function ($note) {
assert($note instanceof Note);
return empty($note->getTerms());
});
return $this->render(self::tmpl('nonconforming'), [
'notes' => $lacking,
]);
}
#[Route('/note/{nid}/get', name: 'get_note')]
public function get_note(int $nid)
{
$note = $this->ankiService->getNote($nid);
//$this->ankiService->updateNote($note);
dd($note);
}
}