mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-12-02 19:14:05 +00:00
Revert "fix: some zim dictionary can not parse correctly"
This reverts commit 7dae5186ab
.
This commit is contained in:
parent
81eefd4110
commit
92873418a6
17
zim.cc
17
zim.cc
|
@ -1587,31 +1587,14 @@ vector< sptr< Dictionary::Class > > makeDictionaries(
|
||||||
{
|
{
|
||||||
wstring word;
|
wstring word;
|
||||||
if( !title.empty() )
|
if( !title.empty() )
|
||||||
{
|
|
||||||
|
|
||||||
word = Utf8::decode( title );
|
word = Utf8::decode( title );
|
||||||
if( maxHeadwordsToExpand && zh.articleCount >= maxHeadwordsToExpand )
|
|
||||||
indexedWords.addSingleWord( word, n );
|
|
||||||
else
|
else
|
||||||
indexedWords.addWord( word, n );
|
|
||||||
}
|
|
||||||
if( !url.empty() )
|
|
||||||
{
|
|
||||||
word = Utf8::decode( url );
|
word = Utf8::decode( url );
|
||||||
|
|
||||||
// begin, the same process order as ZimDictionary::convert before findArticle's invocation
|
|
||||||
QString qword = QString::fromStdU32String( word );
|
|
||||||
QRegularExpression htmlRx( "\\.(s|)htm(l|)$", QRegularExpression::CaseInsensitiveOption );
|
|
||||||
qword.remove( htmlRx ).replace( "_", " " ).remove( QRegularExpression( ".*/" ) );
|
|
||||||
//end
|
|
||||||
|
|
||||||
word = qword.toStdU32String();
|
|
||||||
if( maxHeadwordsToExpand && zh.articleCount >= maxHeadwordsToExpand )
|
if( maxHeadwordsToExpand && zh.articleCount >= maxHeadwordsToExpand )
|
||||||
indexedWords.addSingleWord( word, n );
|
indexedWords.addSingleWord( word, n );
|
||||||
else
|
else
|
||||||
indexedWords.addWord( word, n );
|
indexedWords.addWord( word, n );
|
||||||
}
|
|
||||||
|
|
||||||
wordCount++;
|
wordCount++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue