|
a/src/aspell/rclaspell.cpp |
|
b/src/aspell/rclaspell.cpp |
|
... |
|
... |
261 |
LOGDEB2(("Aspell::buildDict: term: [%s]\n", m_input->c_str()));
|
261 |
LOGDEB2(("Aspell::buildDict: term: [%s]\n", m_input->c_str()));
|
262 |
if (!Rcl::Db::isSpellingCandidate(*m_input)) {
|
262 |
if (!Rcl::Db::isSpellingCandidate(*m_input)) {
|
263 |
LOGDEB2(("Aspell::buildDict: SKIP\n"));
|
263 |
LOGDEB2(("Aspell::buildDict: SKIP\n"));
|
264 |
continue;
|
264 |
continue;
|
265 |
}
|
265 |
}
|
266 |
#ifndef RCL_INDEX_STRIPCHARS
|
|
|
267 |
if (!o_index_stripchars) {
|
266 |
if (!o_index_stripchars) {
|
268 |
string lower;
|
267 |
string lower;
|
269 |
if (!unacmaybefold(*m_input, lower, "UTF-8", UNACOP_FOLD))
|
268 |
if (!unacmaybefold(*m_input, lower, "UTF-8", UNACOP_FOLD))
|
270 |
continue;
|
269 |
continue;
|
271 |
m_input->swap(lower);
|
270 |
m_input->swap(lower);
|
272 |
}
|
271 |
}
|
273 |
#endif
|
|
|
274 |
// Got a non-empty sort-of appropriate term, let's send it to
|
272 |
// Got a non-empty sort-of appropriate term, let's send it to
|
275 |
// aspell
|
273 |
// aspell
|
276 |
LOGDEB2(("Apell::buildDict: SEND\n"));
|
274 |
LOGDEB2(("Apell::buildDict: SEND\n"));
|
277 |
m_input->append("\n");
|
275 |
m_input->append("\n");
|
278 |
return;
|
276 |
return;
|
|
... |
|
... |
380 |
if (!ok() || !make_speller(reason))
|
378 |
if (!ok() || !make_speller(reason))
|
381 |
return false;
|
379 |
return false;
|
382 |
if (iterm.empty())
|
380 |
if (iterm.empty())
|
383 |
return true; //??
|
381 |
return true; //??
|
384 |
|
382 |
|
385 |
#ifndef RCL_INDEX_STRIPCHARS
|
|
|
386 |
if (!o_index_stripchars) {
|
383 |
if (!o_index_stripchars) {
|
387 |
string lower;
|
384 |
string lower;
|
388 |
if (!unacmaybefold(mterm, lower, "UTF-8", UNACOP_FOLD)) {
|
385 |
if (!unacmaybefold(mterm, lower, "UTF-8", UNACOP_FOLD)) {
|
389 |
LOGERR(("Aspell::check : cant lowercase input\n"));
|
386 |
LOGERR(("Aspell::check : cant lowercase input\n"));
|
390 |
return false;
|
387 |
return false;
|
391 |
}
|
388 |
}
|
392 |
mterm.swap(lower);
|
389 |
mterm.swap(lower);
|
393 |
}
|
390 |
}
|
394 |
#endif
|
|
|
395 |
|
391 |
|
396 |
int ret = aapi.aspell_speller_check(m_data->m_speller,
|
392 |
int ret = aapi.aspell_speller_check(m_data->m_speller,
|
397 |
mterm.c_str(), mterm.length());
|
393 |
mterm.c_str(), mterm.length());
|
398 |
reason.clear();
|
394 |
reason.clear();
|
399 |
switch (ret) {
|
395 |
switch (ret) {
|
|
... |
|
... |
414 |
return false;
|
410 |
return false;
|
415 |
string mterm(_term);
|
411 |
string mterm(_term);
|
416 |
if (mterm.empty())
|
412 |
if (mterm.empty())
|
417 |
return true; //??
|
413 |
return true; //??
|
418 |
|
414 |
|
419 |
#ifndef RCL_INDEX_STRIPCHARS
|
|
|
420 |
if (!o_index_stripchars) {
|
415 |
if (!o_index_stripchars) {
|
421 |
string lower;
|
416 |
string lower;
|
422 |
if (!unacmaybefold(mterm, lower, "UTF-8", UNACOP_FOLD)) {
|
417 |
if (!unacmaybefold(mterm, lower, "UTF-8", UNACOP_FOLD)) {
|
423 |
LOGERR(("Aspell::check : cant lowercase input\n"));
|
418 |
LOGERR(("Aspell::check : cant lowercase input\n"));
|
424 |
return false;
|
419 |
return false;
|
425 |
}
|
420 |
}
|
426 |
mterm.swap(lower);
|
421 |
mterm.swap(lower);
|
427 |
}
|
422 |
}
|
428 |
#endif
|
|
|
429 |
|
423 |
|
430 |
AspellCanHaveError *ret;
|
424 |
AspellCanHaveError *ret;
|
431 |
|
425 |
|
432 |
const AspellWordList *wl =
|
426 |
const AspellWordList *wl =
|
433 |
aapi.aspell_speller_suggest(m_data->m_speller,
|
427 |
aapi.aspell_speller_suggest(m_data->m_speller,
|