File indexing completed on 2024-09-15 03:28:21
0001 /* 0002 This file is part of Kiten, a KDE Japanese Reference Tool 0003 SPDX-FileCopyrightText: 2006 Joseph Kerian <jkerian@gmail.com> 0004 0005 SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 0008 #ifndef RADICALFILE_H 0009 #define RADICALFILE_H 0010 0011 #include <QHash> 0012 #include <QMultiMap> 0013 #include <QSet> 0014 #include <QString> 0015 0016 #include "kanji.h" 0017 #include "radical.h" 0018 #include "radicalbutton.h" 0019 0020 class RadicalFile 0021 { 0022 public: 0023 explicit RadicalFile(QString &radkfile, const QString &kanjidic = QString()); 0024 0025 QSet<Kanji> kanjiContainingRadicals(QSet<QString> &radicalList) const; 0026 bool loadRadicalFile(QString &radkfile); 0027 bool loadKanjidic(const QString &kanjidic); 0028 QMultiMap<int, Radical> *mapRadicalsByStrokes(int max_strokes = 0) const; 0029 QSet<QString> radicalsInKanji(QSet<Kanji> &kanjiList) const; 0030 0031 private: 0032 QHash<QString, Kanji> m_kanji; 0033 QHash<QString, Radical> m_radicals; 0034 }; 0035 0036 #endif