Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Spellchecker Issues

<< < (8/8)

MortenMacFly:

--- Quote from: White-Tiger on January 29, 2016, 04:06:20 pm ---why do you think it's a hunspell issue?

--- End quote ---
Well to be more precise: We actually have two issues here:
1.) (hunspell): If the dictionaries are in a path with non-ASCII characters hunspell is unable to pick up any dictionary.
2.) The Russian words are broken due to the way we handle to find word boundaries in OnlineSpellChecker.cpp. Here (search for the comment "//find recheck range end:") we check for whitespace in a way that it does not work for e.g. Russian (see SpellCheckHelper::IsWhiteSpace(ch)).

The latter we can do something about it... the first one we can't. Both lead to Russian SpellChecking being broken, unfortunately.

White-Tiger:
1) is also a C::B issue.. see: http://forums.codeblocks.org/index.php/topic,20195.msg139323.html#msg139323
Hunspell has means to support such paths.. C::B is simply not using them.
One could argue that they could have supported wchar_t* directly.. though their way is a bit less platform dependent

So something like this in HunspellInterface.cpp:61-63

--- Code: (cpp) ---    wxCharBuffer affixFileCharBuffer = ConvertToUnicode(_T("\\\\?\\") + strAffixFile);
    wxCharBuffer dictionaryFileCharBuffer = ConvertToUnicode(_T("\\\\?\\") + strDictionaryFile);
    m_pHunspell = new Hunspell(affixFileCharBuffer, dictionaryFileCharBuffer);
--- End code ---
would work for Windows (this is what I'm using locally, and as far as I can tell, it seems to work)

MortenMacFly:

--- Quote from: White-Tiger on January 30, 2016, 01:33:37 am ---So something like this in HunspellInterface.cpp:61-63

--- Code: (cpp) ---    wxCharBuffer affixFileCharBuffer = ConvertToUnicode(_T("\\\\?\\") + strAffixFile);
    wxCharBuffer dictionaryFileCharBuffer = ConvertToUnicode(_T("\\\\?\\") + strDictionaryFile);
    m_pHunspell = new Hunspell(affixFileCharBuffer, dictionaryFileCharBuffer);
--- End code ---
would work for Windows (this is what I'm using locally, and as far as I can tell, it seems to work)

--- End quote ---
I've applied a cross-platform compatible version of this - for me that really seems to work. Nice catch!

So now whats missing is umlauts and Unicode... at least we are getting closer...

Navigation

[0] Message Index

[*] Previous page

Go to full version