mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-12-17 23:04:06 +00:00
Dsl: Fix displayed headword selection for the case of ignore diacritic
This commit is contained in:
parent
332a95b271
commit
5d7d553bb5
12
dsl.cc
12
dsl.cc
|
@ -263,6 +263,7 @@ private:
|
|||
/// Loads the article. Does not process the DSL language.
|
||||
void loadArticle( uint32_t address,
|
||||
wstring const & requestedHeadwordFolded,
|
||||
bool ignoreDiacritics,
|
||||
wstring & tildeValue,
|
||||
wstring & displayedHeadword,
|
||||
unsigned & headwordIndex,
|
||||
|
@ -536,6 +537,7 @@ bool isDslWs( wchar ch )
|
|||
|
||||
void DslDictionary::loadArticle( uint32_t address,
|
||||
wstring const & requestedHeadwordFolded,
|
||||
bool ignoreDiacritics,
|
||||
wstring & tildeValue,
|
||||
wstring & displayedHeadword,
|
||||
unsigned & headwordIndex,
|
||||
|
@ -680,7 +682,13 @@ void DslDictionary::loadArticle( uint32_t address,
|
|||
unescapeDsl( *i );
|
||||
normalizeHeadword( *i );
|
||||
|
||||
if ( Folding::trimWhitespace( *i ) == requestedHeadwordFolded )
|
||||
bool found;
|
||||
if( ignoreDiacritics )
|
||||
found = Folding::applyDiacriticsOnly( Folding::trimWhitespace( *i ) ) == Folding::applyDiacriticsOnly( requestedHeadwordFolded );
|
||||
else
|
||||
found = Folding::trimWhitespace( *i ) == requestedHeadwordFolded;
|
||||
|
||||
if ( found )
|
||||
{
|
||||
// Found it. Now we should make a displayed headword for it.
|
||||
if ( hadFirstHeadword )
|
||||
|
@ -1707,7 +1715,7 @@ void DslArticleRequest::run()
|
|||
|
||||
try
|
||||
{
|
||||
dict.loadArticle( chain[ x ].articleOffset, wordCaseFolded, tildeValue,
|
||||
dict.loadArticle( chain[ x ].articleOffset, wordCaseFolded, ignoreDiacritics, tildeValue,
|
||||
displayedHeadword, headwordIndex, articleBody );
|
||||
|
||||
if ( !articlesIncluded.insert( std::make_pair( chain[ x ].articleOffset,
|
||||
|
|
Loading…
Reference in a new issue