File indexing completed on 2022-11-29 18:12:55

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 #include "kanji.h"
0009 
0010 Kanji::Kanji()
0011 : strokeCount( 0 )
0012 {
0013 }
0014 
0015 Kanji::Kanji( const QString &kanji, const QSet<QString> &radicals )
0016 : QString( kanji.at( 0 ) )
0017 , strokeCount( 0 )
0018 {
0019   components = radicals;
0020 }
0021 
0022 void Kanji::addRadical( const QString &it )
0023 {
0024   components += it;
0025 }
0026 
0027 void Kanji::setStrokes( unsigned int strokes )
0028 {
0029   strokeCount = strokes;
0030 }
0031 
0032 const QSet<QString>& Kanji::getRadicals() const
0033 {
0034   return components;
0035 }
0036 
0037 unsigned int Kanji::strokes() const
0038 {
0039   return strokeCount;
0040 }
0041 
0042 bool Kanji::operator<( const Kanji &other ) const
0043 {
0044   return this->strokeCount < other.strokeCount;
0045 }