Spell-Checking-with-Hunspell

From Qt Wiki
Revision as of 17:49, 14 January 2015 by Maintenance script (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Spell Checking with Hunspell

Prerequisites

You have to get Hunspell from http://hunspell.sourceforge.net/ [hunspell.sourceforge.net]. I have tested the classes with version 1.2.8. It may work with a more recent version (current is 1.2.12). Dictionaries can be downloaded via the sourceforge page.

If you plan to use the spell checker in a commercial software, watch out for the copyright and license of the dictionaries!

The source code on this wiki page is released by me (Volker, being the original author) under the 2 clause BSD license [en.wikipedia.org]

You also must adapt a few files before everything works:

The project file SpellChecker.pro:
Adjust the paths to your hunspell installation

dialog.cpp:
In method Dialog::checkSpelling() adjust the paths to the dictionaries. You must provide the base name of the dictionary, excluding the suffixes .dic and .aff. The user dictionary is optional. The path is the complete path to the file, including an extension (which is optional).

Sources

SpellChecker.pro

main.cpp

dialog.ui

dialog.h

dialog.cpp

spellcheckdialog.ui

spellcheckdialog.h

spellcheckdialog.cpp

spellchecker.h

spellchecker.cpp

Categories: