23#include "tdespell_hspelldict.h"
26#include <tqtextcodec.h>
30HSpellDict::HSpellDict(
const TQString& lang )
33 int int_error = hspell_init( &m_speller, HSPELL_OPT_DEFAULT );
34 if ( int_error == -1 )
35 kdDebug() <<
"HSpellDict::HSpellDict: Init failed" << endl;
37 codec = TQTextCodec::codecForName(
"iso8859-8-i" );
40HSpellDict::~HSpellDict()
43 hspell_uninit( m_speller );
48 kdDebug() <<
"HSpellDict::check word = " << word <<endl;
50 TQCString wordISO = codec->fromUnicode( word );
52 int correct = hspell_check_word ( m_speller,
58 if( hspell_is_canonic_gimatria( wordISO ) != 0 )
70 hspell_trycorrect( m_speller, codec->fromUnicode( word ), &cl );
71 for( n_sugg = 0; n_sugg < corlist_n( &cl ); n_sugg++){
72 qsug.append( codec->toUnicode( corlist_str( &cl, n_sugg) ) );
79 TQStringList& suggestions )
81 bool c =
check( word );
88 const TQString& good )
91 kdDebug() <<
"HSpellDict::storeReplacement: Sorry, cannot." << endl;
98 kdDebug() <<
"HSpellDict::addToPersonal: Sorry, cannot." << endl;
105 kdDebug() <<
"HSpellDict::addToSession: Sorry, cannot." << endl;
virtual bool checkAndSuggest(const TQString &word, TQStringList &suggestions)
Checks the word and fetches suggestions for it.
virtual bool check(const TQString &word)
Checks the given word.
virtual TQStringList suggest(const TQString &word)
Fetches suggestions for the word.
virtual bool addToSession(const TQString &word)
Adds word to the words recognizable in the current session.
virtual bool addToPersonal(const TQString &word)
Adds word to the list of of personal words.
virtual bool storeReplacement(const TQString &bad, const TQString &good)
Stores user defined good replacement for the bad word.
Class is returned by from Broker.