mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 23:34:06 +00:00
Hunspell: Strip comments while search base form of word
This commit is contained in:
parent
0e22d06f97
commit
dd0464b9d5
|
@ -524,9 +524,14 @@ QVector< wstring > suggest( wstring & word, Mutex & hunspellMutex, Hunspell & hu
|
||||||
QString suggestion = gd::toQString( decodeFromHunspell( hunspell, suggestions[ x ].c_str() ) );
|
QString suggestion = gd::toQString( decodeFromHunspell( hunspell, suggestions[ x ].c_str() ) );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Strip comments
|
||||||
|
int n = suggestion.indexOf( '#' );
|
||||||
|
if( n >= 0 )
|
||||||
|
suggestion.chop( suggestion.length() - n );
|
||||||
|
|
||||||
GD_DPRINTF( ">>>Sugg: %s\n", suggestion.toLocal8Bit().data() );
|
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 ) );
|
wstring alt = gd::toWString( cutStem.cap( 1 ) );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue