package de.duehl.vocabulary.japanese.logic.symbol.kanji.strokes.test;

import java.util.List;

import de.duehl.basics.collections.CollectionsHelper;
import de.duehl.basics.text.NumberString;
import de.duehl.vocabulary.japanese.logic.symbol.kanji.strokes.own.KanjiStrokesDataStructureGenerator;
import de.duehl.vocabulary.japanese.logic.symbol.kanji.strokes.own.data.KanjiStrokePath;
import de.duehl.vocabulary.japanese.logic.symbol.kanji.strokes.own.data.KanjiStrokes;

public class StartKanjiStrokesDataStructureGeneratorForTestingViaKanjiStrokes {

    public static void main(String[] args) {
        KanjiStrokesDataStructureGenerator generator = new KanjiStrokesDataStructureGenerator();
        generator.generate();

        KanjiStrokes kanjiStrokes = new KanjiStrokes(generator.getKanjiStrokesByCodePoint());

        System.out.println(
                "Anzahl CodePoints : " + NumberString.taupu(kanjiStrokes.size()));
        String kanji = "漢";
        if (kanjiStrokes.knowsPathesForKanji(kanji)) {
            List<KanjiStrokePath> hanKanjiStrokes = kanjiStrokes.getPathesByKanji(kanji);
            System.out.println("Zum Kanji " + kanji + " wurden "
                    + NumberString.taupu(hanKanjiStrokes.size()) + " Pfade gefunden:");
            CollectionsHelper.printListNice(hanKanjiStrokes);
        }
        else {
            System.out.println("Zum Kanji " + kanji + " sind keine Striche hinterlegt.");
        }
    }

}
