From 3607529454671e5d6ac1679c8beca44b9247c0b7 Mon Sep 17 00:00:00 2001 From: Abs62 Date: Fri, 9 May 2014 01:26:03 +0400 Subject: [PATCH] Full-text search: Fix retrieving of some headwords for BGL dictionaries --- bgl.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/bgl.cc b/bgl.cc index fb593722..6855335d 100644 --- a/bgl.cc +++ b/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 );