1 /* 2 * SPDX-FileCopyrightText: 2006 Zack Rusin <zack@kde.org> 3 * 4 * SPDX-License-Identifier: LGPL-2.1-or-later 5 */ 6 #include "spellerplugin_p.h" 7 8 namespace Sonnet 9 { 10 class SpellerPluginPrivate 11 { 12 public: 13 QString language; 14 }; 15 SpellerPlugin(const QString & lang)16SpellerPlugin::SpellerPlugin(const QString &lang) 17 : d(new SpellerPluginPrivate) 18 { 19 d->language = lang; 20 } 21 ~SpellerPlugin()22SpellerPlugin::~SpellerPlugin() 23 { 24 delete d; 25 } 26 language() const27QString SpellerPlugin::language() const 28 { 29 return d->language; 30 } 31 isMisspelled(const QString & word) const32bool SpellerPlugin::isMisspelled(const QString &word) const 33 { 34 return !isCorrect(word); 35 } 36 checkAndSuggest(const QString & word,QStringList & suggestions) const37bool SpellerPlugin::checkAndSuggest(const QString &word, QStringList &suggestions) const 38 { 39 bool c = isCorrect(word); 40 if (!c) { 41 suggestions = suggest(word); 42 } 43 return c; 44 } 45 } 46