mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
Full-text search: Fix retrieving of some headwords for BGL dictionaries
This commit is contained in:
parent
055ae55abd
commit
3607529454
13
bgl.cc
13
bgl.cc
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue