kspell_ispelldict.cpp

00001 
00021 #include "kspell_ispelldict.h"
00022 
00023 #include <kdebug.h>
00024 
00025 #include "ispell_checker.h"
00026 
00027 using namespace KSpell2;
00028 
00029 ISpellDict::ISpellDict( const QString& lang )
00030     : Dictionary( lang )
00031 {
00032     m_checker = new ISpellChecker();
00033 
00034     if ( !m_checker->requestDictionary( lang.latin1() ) ) {
00035         kdError()<<"Language \""<< lang << "\" doesn't exist for Ispell"<<endl;
00036     }
00037 }
00038 
00039 ISpellDict::~ISpellDict()
00040 {
00041 }
00042 
00043 bool ISpellDict::check( const QString& word )
00044 {
00045     return m_checker->checkWord( word );
00046 }
00047 
00048 QStringList ISpellDict::suggest( const QString& word )
00049 {
00050     return m_checker->suggestWord( word );
00051 }
00052 
00053 bool ISpellDict::checkAndSuggest( const QString& word,
00054                                   QStringList& suggestions )
00055 {
00056     bool c = check( word );
00057     if ( c )
00058         suggestions = suggest( word );
00059     return c;
00060 }
00061 
00062 bool ISpellDict::storeReplacement( const QString& ,
00063                                    const QString& )
00064 {
00065     return false;
00066 }
00067 
00068 bool ISpellDict::addToPersonal( const QString& )
00069 {
00070     return false;
00071 }
00072 
00073 bool ISpellDict::addToSession( const QString& )
00074 {
00075     return false;
00076 }
KDE Home | KDE Accessibility Home | Description of Access Keys