mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Case folding should happen after diacritics removal not before
This commit is contained in:
parent
558b477328
commit
5b10767860
@ -268,11 +268,12 @@ private:
|
|||||||
}
|
}
|
||||||
if (is_token) {
|
if (is_token) {
|
||||||
icu::UnicodeString token(str, token_start_pos, token_end_pos - token_start_pos);
|
icu::UnicodeString token(str, token_start_pos, token_end_pos - token_start_pos);
|
||||||
token.foldCase(U_FOLD_CASE_DEFAULT);
|
token.foldCase();
|
||||||
if ((rc = send_token(token, token_start_pos, token_end_pos, stemmer)) != SQLITE_OK) return rc;
|
if ((rc = send_token(token, token_start_pos, token_end_pos, stemmer)) != SQLITE_OK) return rc;
|
||||||
if (!for_query && remove_diacritics) {
|
if (!for_query && remove_diacritics) {
|
||||||
icu::UnicodeString tt(token);
|
icu::UnicodeString tt(str, token_start_pos, token_end_pos - token_start_pos);
|
||||||
diacritics_remover->transliterate(tt);
|
diacritics_remover->transliterate(tt);
|
||||||
|
tt.foldCase();
|
||||||
if (tt != token) {
|
if (tt != token) {
|
||||||
if ((rc = send_token(tt, token_start_pos, token_end_pos, stemmer, FTS5_TOKEN_COLOCATED)) != SQLITE_OK) return rc;
|
if ((rc = send_token(tt, token_start_pos, token_end_pos, stemmer, FTS5_TOKEN_COLOCATED)) != SQLITE_OK) return rc;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user