SpellChecker.h header

#include <ew/app/SpellChecker.h>

Namespace ew::app

SpellChecker class

class ew::app::SpellChecker

Checks whether words are spelled correctly. Implementations back this with a dictionary; learned words (such as a project's invented codex names) can be added so they are never flagged. This is the seam the editor's spell highlighter depends on, independent of the dictionary backend.

Members

ew::app::SpellChecker::SpellChecker()=default

Defaulted.

virtual ew::app::SpellChecker::~SpellChecker()=default

Defaulted.

ew::app::SpellChecker::SpellChecker(const SpellChecker &)=delete

Not copyable.

ew::app::SpellChecker::SpellChecker(SpellChecker &&)=delete

Not movable.

SpellChecker & ew::app::SpellChecker::operator=(const SpellChecker &)=delete

Not copyable.

SpellChecker & ew::app::SpellChecker::operator=(SpellChecker &&)=delete

Not movable.

virtual bool ew::app::SpellChecker::isCorrect(QStringView word) const =0

Returns true if word is spelled correctly (or cannot be judged).

virtual void ew::app::SpellChecker::addWord(QString word)=0

Learns word so it is treated as correct (e.g. an invented codex name).

virtual QStringList ew::app::SpellChecker::suggestions(QStringView, int=7) const

Returns up to maxResults replacement candidates for the misspelled word, best first, for a right-click "did you mean" menu. The base implementation offers none; a dictionary- backed checker ranks its words by edit distance (see spellingSuggestions).