mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
fix: epwing dictionary headword correction
such as headword "1gulp n. →" was corrected as " gulp n "
This commit is contained in:
parent
32689d71ad
commit
53c1db8eaf
|
@ -1032,6 +1032,9 @@ void EpwingBook::fixHeadword( QString & headword )
|
|||
|
||||
headword.remove( QChar( 0x30FB ) ); // Used in Japan transcription
|
||||
|
||||
//replace any unicode Number ,Symbol ,Punctuation ,Mark character to whitespace
|
||||
headword.replace( QRegularExpression( "[\\p{N}\\p{S}\\p{P}\\p{M}]" ), " " );
|
||||
|
||||
//if( isHeadwordCorrect( headword) )
|
||||
// return;
|
||||
|
||||
|
@ -1046,7 +1049,7 @@ void EpwingBook::fixHeadword( QString & headword )
|
|||
//}
|
||||
|
||||
gd::wstring folded = Folding::applyPunctOnly( gd::toWString( fixed ) );
|
||||
fixed = gd::toQString( folded );
|
||||
//fixed = gd::toQString( folded );
|
||||
|
||||
//if( isHeadwordCorrect( fixed ) )
|
||||
//{
|
||||
|
|
|
@ -596,7 +596,7 @@ bool isPunct( wchar ch )
|
|||
case 0xFF64: // HALFWIDTH IDEOGRAPHIC COMMA
|
||||
return true;
|
||||
default:
|
||||
return QChar::isPunct(ch)||QChar::isSymbol(ch);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue