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
8namespace Sonnet
9{
10class SpellerPluginPrivate
11{
12public:
13 QString language;
14};
15
16SpellerPlugin::SpellerPlugin(const QString &lang)
17 : d(new SpellerPluginPrivate)
18{
19 d->language = lang;
20}
21
22SpellerPlugin::~SpellerPlugin() = default;
23
24QString SpellerPlugin::language() const
25{
26 return d->language;
27}
28
29bool SpellerPlugin::isMisspelled(const QString &word) const
30{
31 return !isCorrect(word);
32}
33
34bool SpellerPlugin::checkAndSuggest(const QString &word, QStringList &suggestions) const
35{
36 bool c = isCorrect(word);
37 if (!c) {
38 suggestions = suggest(word);
39 }
40 return c;
41}
42}
43

source code of sonnet/src/core/spellerplugin.cpp