File indexing completed on 2022-09-27 12:25:39

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 RADICAL_H
0009 #define RADICAL_H
0010 
0011 #include <QSet>
0012 #include <QString>
0013 
0014 class Radical
0015 {
0016   public:
0017                          Radical();
0018     explicit             Radical(  const QString &irad
0019                                  , unsigned int strokes = 0
0020                                  , unsigned int index = 0 );
0021 
0022     QString              toString() const;
0023 
0024     const QSet<QString>& getKanji() const;
0025     void                 addKanji( const QSet<QString> &newKanji );
0026     unsigned int         strokes() const;
0027 
0028     static bool          compareIndices( const Radical &a, const Radical &b );
0029     static bool          compareFrequencies( const Radical &a, const Radical &b );
0030 
0031   protected:
0032     QString       string;
0033     unsigned int  strokeCount;
0034     unsigned int  idx;
0035     QSet<QString> kanji;
0036     QSet<QString> components;
0037 };
0038 
0039 #endif