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 | |
16 | SpellerPlugin::SpellerPlugin(const QString &lang) |
17 | : d(new SpellerPluginPrivate) |
18 | { |
19 | d->language = lang; |
20 | } |
21 | |
22 | SpellerPlugin::~SpellerPlugin() = default; |
23 | |
24 | QString SpellerPlugin::language() const |
25 | { |
26 | return d->language; |
27 | } |
28 | |
29 | bool SpellerPlugin::isMisspelled(const QString &word) const |
30 | { |
31 | return !isCorrect(word); |
32 | } |
33 | |
34 | bool 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 |