![]() |
#1 |
Member
![]() Posts: 13
Karma: 10
Join Date: Jan 2010
Device: Hanlin v3
|
How to modify calibre text sort algorithm
Hello all.
Most of my books are in spanish and so I have titles with beginning exclamation and question marks (¿ and ¡). I would like to add that symbols to the list of articles to be ignored when sorting text but I'm getting an error. The items I'm adding are: u'¿\\s+'), u'¡\\s+'), The error is: calibre, version 4.9.1 Traceback (most recent call last): File "site-packages\calibre\gui2\preferences\tweaks.py", line 535, in apply_tweak File "<string>", line 93 u'¿\\s+'), ^ SyntaxError: invalid syntax The arrow points the + symbol after the s. Of course someone would think of removing such caracters from the title but we are talking about a few thousand books. Any help would be welcome. Thanks. Last edited by khonshu; 01-26-2020 at 10:35 AM. |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,031
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
did you add that single ' at the end because it is part of the article? (English only speaker here
![]() You might need to escape it (removes special meanings): \' As to removing anything from any field Metadata edit Bulk mode (2 or more items selected before entering the MDE), Search and replace tab ![]() backup your metadata.db, you goof, and a lot of data could go south. ![]() |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
You should be using just: Code:
u'¿\\s+', u'¡\\s+', |
|
![]() |
![]() |
![]() |
#4 |
Member
![]() Posts: 13
Karma: 10
Join Date: Jan 2010
Device: Hanlin v3
|
Solved, thank you! The problem was the closing parenthesis.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Author Sort Name Algorithm Tweak | phossler | Calibre | 3 | 07-05-2018 12:02 PM |
Author sort algorithm and accented characters | rpspringuel | Calibre | 8 | 05-09-2014 04:11 PM |
Author Sort Name Algorithm and multiple libraries | texasnightowl | Calibre | 11 | 06-14-2012 10:34 PM |
How can i modify calibre so that it would have a new functionality | Naderstouhy | Development | 2 | 07-08-2011 02:03 AM |