opt: headword parse modification

This commit is contained in:
Xiao Yi Fang 2024-07-23 08:51:11 +08:00
parent 2fff75aad9
commit 8e61aed9d5

View file

@ -1684,7 +1684,7 @@ static void handleIdxSynFile( string const & fileName,
string headword( word, wordLen );
if ( strstr( headword, "&#" ) ) {
if ( headword.find_first_of( "&#" ) != string::npos ) {
// Decode some html-coded symbols in headword
headword = Html::unescapeUtf8( headword );
wordLen = headword.length();
@ -1735,11 +1735,11 @@ static void handleIdxSynFile( string const & fileName,
// synonyms which really start from slash and contain dollar signs, or
// end with dollar and contain slashes.
if ( headword.front() == '/' ) {
if ( strchr( headword, '$' ) )
if ( headword.find_first_of( '$' ) !=string::npos )
continue; // Skip this entry
}
else if ( headword.end() == '$' ) {
if ( strchr( headword, '/' ) )
if ( headword.find_first_of( '/' ) != string::npos )
continue; // Skip this entry
}