Full-text search: Fix retrieving of some headwords for BGL dictionaries

This commit is contained in:
Abs62 2014-05-09 01:26:03 +04:00
parent 055ae55abd
commit 3607529454

13
bgl.cc
View file

@ -439,6 +439,19 @@ namespace
string headwordStr, displayedHeadwordStr, articleStr;
loadArticle( articleAddress, headwordStr, displayedHeadwordStr, articleStr );
// Some headword normalization similar while indexing
trimWs( headwordStr );
if ( headwordStr.size() && headwordStr[ 0 ] == '/' )
headwordStr.erase(); // We will take headword from index later
if ( headwordStr.size()
&& headwordStr[ headwordStr.size() - 1 ] == '$' )
{
headwordStr = removePostfix( headwordStr );
trimWs( headwordStr );
}
headword = QString::fromUtf8( headwordStr.data(), headwordStr.size() );
wstring wstr = Utf8::decode( articleStr );