File indexing completed on 2024-04-21 04:00:55
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() = default; 0023 0024 QString SpellerPlugin::language() const 0025 { 0026 return d->language; 0027 } 0028 0029 bool SpellerPlugin::isMisspelled(const QString &word) const 0030 { 0031 return !isCorrect(word); 0032 } 0033 0034 bool SpellerPlugin::checkAndSuggest(const QString &word, QStringList &suggestions) const 0035 { 0036 bool c = isCorrect(word); 0037 if (!c) { 0038 suggestions = suggest(word); 0039 } 0040 return c; 0041 } 0042 }