mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
- Drop convertChainToWstrings(), it's not used anymore.
This commit is contained in:
parent
629a138f7e
commit
f07030deba
|
@ -678,38 +678,6 @@ vector< WordArticleLink > BtreeDictionary::readChain( char const * & ptr )
|
|||
return result;
|
||||
}
|
||||
|
||||
vector< wstring > BtreeDictionary::convertChainToWstrings(
|
||||
vector< WordArticleLink > const & chain )
|
||||
{
|
||||
vector< wchar_t > wcharBuffer;
|
||||
|
||||
vector< wstring > result;
|
||||
|
||||
for( unsigned x = 0; x < chain.size(); ++x )
|
||||
{
|
||||
unsigned wordSize = chain[ x ].word.size();
|
||||
|
||||
if ( wcharBuffer.size() <= wordSize )
|
||||
wcharBuffer.resize( wordSize + 1 );
|
||||
|
||||
long len = Utf8::decode( chain[ x ].word.data(), wordSize,
|
||||
&wcharBuffer.front() );
|
||||
|
||||
if ( len < 0 )
|
||||
{
|
||||
fprintf( stderr, "Failed to decode utf8 of a word %s, skipping it.\n",
|
||||
chain[ x ].word.c_str() );
|
||||
continue;
|
||||
}
|
||||
|
||||
wcharBuffer[ len ] = 0;
|
||||
|
||||
result.push_back( &wcharBuffer.front() );
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void BtreeDictionary::antialias( wstring const & str,
|
||||
vector< WordArticleLink > & chain )
|
||||
{
|
||||
|
|
|
@ -128,10 +128,6 @@ private:
|
|||
/// is updated to point to the next chain, if there's any.
|
||||
vector< WordArticleLink > readChain( char const * & );
|
||||
|
||||
/// Converts words in a chain to a vector of wide strings. The article
|
||||
/// offsets don't get used.
|
||||
vector< wstring > convertChainToWstrings( vector< WordArticleLink > const & );
|
||||
|
||||
/// Drops any alises which arose due to folding. Only case-folded aliases
|
||||
/// are left.
|
||||
void antialias( wstring const &, vector< WordArticleLink > & );
|
||||
|
|
Loading…
Reference in a new issue