Hunspell: Strip comments while search base form of word

This commit is contained in:
Abs62 2018-03-23 16:08:33 +03:00
parent 0e22d06f97
commit dd0464b9d5

View file

@ -524,9 +524,14 @@ QVector< wstring > suggest( wstring & word, Mutex & hunspellMutex, Hunspell & hu
QString suggestion = gd::toQString( decodeFromHunspell( hunspell, suggestions[ x ].c_str() ) );
#endif
// Strip comments
int n = suggestion.indexOf( '#' );
if( n >= 0 )
suggestion.chop( suggestion.length() - n );
GD_DPRINTF( ">>>Sugg: %s\n", suggestion.toLocal8Bit().data() );
if ( cutStem.indexIn( suggestion ) != -1 )
if ( cutStem.indexIn( suggestion.trimmed() ) != -1 )
{
wstring alt = gd::toWString( cutStem.cap( 1 ) );