File indexing completed on 2024-04-28 15:34:19
0001 /* 0002 * SPDX-FileCopyrightText: 2006 Zack Rusin <zack@kde.org> 0003 * 0004 * SPDX-License-Identifier: LGPL-2.1-or-later 0005 */ 0006 #include "spellerplugin_p.h" 0007 0008 namespace Sonnet 0009 { 0010 class SpellerPluginPrivate 0011 { 0012 public: 0013 QString language; 0014 }; 0015 0016 SpellerPlugin::SpellerPlugin(const QString &lang) 0017 : d(new SpellerPluginPrivate) 0018 { 0019 d->language = lang; 0020 } 0021 0022 SpellerPlugin::~SpellerPlugin() 0023 { 0024 delete d; 0025 } 0026 0027 QString SpellerPlugin::language() const 0028 { 0029 return d->language; 0030 } 0031 0032 bool SpellerPlugin::isMisspelled(const QString &word) const 0033 { 0034 return !isCorrect(word); 0035 } 0036 0037 bool SpellerPlugin::checkAndSuggest(const QString &word, QStringList &suggestions) const 0038 { 0039 bool c = isCorrect(word); 0040 if (!c) { 0041 suggestions = suggest(word); 0042 } 0043 return c; 0044 } 0045 }