![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
A new feature proposal: report of group saved searches
Hi
This is a feature I just proposed to be implemented on the Calibre editor, to no avail. ![]() https://www.mobileread.com/forums/sh...d.php?t=284450 Using Sigil to perform a regex, we get a one line information report of this kind: Code:
Matches found 51 Code:
Replacements made 51 Code:
1. Matches found 51 2. Matches found 6215 3. Matches found 324 Code:
Matches found: 6590 I join the regex group I use on every EPUB after each ODTImport conversion. Up to now, I do it one by one for lack of precise report. |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,375
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Patches are always welcome, but I'm afraid I'm on the same page as Kovid on this. If you want individual results, use individual searches. You (should) only group searches/replaces that you've tested extensively and trust to perform correctly
Last edited by DiapDealer; 03-18-2017 at 09:12 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,914
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
![]() That does not stop you from Grouping searches. Just don't execute the group unless you are sure the group is fully safe |
|
![]() |
![]() |
![]() |
#4 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
Quote:
But, this is not enough: each book is a world of its own. Sometimes a discrete defect in the book (nobody is perfect but my mother) may hinder one of these regex. By performing a blind* group search, I will not know it, blissfully follow on and fail to implement some feature... This means that I can never be sure a group search will work 100% on a new book, even if I trust every single component of the group. That's why I avoid all group searches. So, it defeats for me the purpose of this nice feature. Note: "blind" means for me without a detailed report. Last edited by roger64; 03-18-2017 at 08:16 PM. Reason: plural |
||
![]() |
![]() |
![]() |
#5 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,318
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
My method:
With "Saved Searches" window open I "count all" for each of the sub-parts of my group. When I am satisfied - I "Replace All" with the group selected. It's only a few extra button clicks. Of course the bestest solution would be for a breakdown of the counts as you suggested, but unless/until that gets implemented this is a fairly simple method. Cheers, |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
|
![]() |
![]() |
![]() |
#7 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,914
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
I don't worry about fixing 100% of something. I will find those when I proof my work.
I worry about BREAKING anything. ![]() Some of my saved searches are really templates. The replace is fixed, but I tweak the search. Eg. I have a Baen-deDiv search (removes all those pesky ![]() |
![]() |
![]() |
![]() |
#8 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
The group search I would like to use is tuned for a specific conversion process and helps eradicate minor code defects, add typographical and other changes. Last edited by roger64; 03-18-2017 at 09:30 PM. |
|
![]() |
![]() |
![]() |
#9 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,375
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
I guess a big part of the problem is that I simply don't do blind, book-wide Replace Alls. They're too dangerous with one search, let alone stacking a bunch of them. I step through Replaces one at a time. If there's too many to make doing that feasible, then my source sucks and I need to start with something closer to what my end goal is. Life's too short to completely overhaul the source-code of entire books. Start from better source code, I say. But as I said initially ... if someone wants to submit a patch or pull-request to implement this, I wouldn't be opposed. I'm just not willing to use the limited time I have to tinker with Sigil on this idea. Maybe someone else will. |
|
![]() |
![]() |
![]() |
#10 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
|
![]() |
![]() |
![]() |
#11 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,375
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
![]() |
![]() |
![]() |
#12 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
First, please have a look at all my regex (see above). I use them for each of my books, one after another after I exported to EPUB3 an odt file using the Sigil plugin ODTImport. They are tuned to this specific workflow. I know beforehand that the book to be processed has, depending on the case, say about ten images, 100 endnotes, some tables, some superscript, some degrees, not to forget five or six regex for adding nnbsp everywhere according to French rules, one other regex is for stylesheet, and so on. So I know in advance which ones will yield a positive result, while for some others a zero can be correct. A look at the information line is enough to know if the regex has been processed. This is true for one regex. When you have 15 regex, it just takes you 15 times more to perform this task. Is that complicated? A computer can process the whole group in no time because it's all about elementary computing, but for the reasons given above, unhappily I can't rely on the cumulative result and I miss a breakdown count. ![]() Last edited by roger64; 03-19-2017 at 11:38 AM. Reason: miss |
|
![]() |
![]() |
![]() |
#13 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Here is a few of the use-cases I can think of where this would be helpful. In almost every EPUB I mass convert footnotes from <sup>##</sup> form into [##] form. It would be nice to see something like: Code:
Fix Footnote <sup>##</sup> -> [##] 102 Fix Endnote <sup>##</sup> -> [##] 100 I also have "Finereader Cleanup" group of saved searches to clean some cruft Finereader produces. Here are a few: Split Double Footnote Search: <sup>([0-9]+), ([0-9]+)</sup> Replace: <sup>\1</sup><sup>,</sup><sup>\2</sup> Fix Bold Smallcaps Search: <span style="font-weight:bold;font-variant:small-caps;"> Replace: <span class="smallcaps"> Clean Italic & Search: <span class="italics">&</span> Replace: & On the last book I worked on, if I run the entire group, it says "Replacements made: 1072". But if I run each Regex individually, and say "Count All", I would get a helpful breakdown like this: Code:
Fix Italics 403 Fix Bold 6 Fix Bold/Italics 110 Fix Smallcaps 25 Fix Bold/Smallcaps 1 Clean Italic & 0 Split Double Footnote 0 Fix Finereader 12 Table Alignment 198 Clean Bold td 0 Clean Italics td 29 Clean td 298 Clean Table Headers 2 For example, if there was 1 "Double Footnote", I know that I have to look more closely when creating footnote links back/forth OR it could have been an OCR error. Or if I get a hit on "Clean Italic &" I know that I have to go looking more closely. 99% of the time an italic ampersand is either NOT italic OR Finereader just didn't like the specific font used OR it was an actual OCR error. In the very rare case though, the ampersand might have been smack dab in the middle of a book title and the italic spaces around it were missed: Code:
<i>Hansel</i> <i>&</i> <i>Gretel</i> Code:
<i>Hansel</i> & <i>Gretel</i> Code:
<i>Hansel & Gretel</i> Having a breakdown of the number of each fix would have also been helpful way back when: "I know there are 10 articles and 10 dropcaps? 25 figures and 25 corrections? Good, now I don't have to look at it." ![]() Last edited by Tex2002ans; 03-20-2017 at 08:31 PM. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
About safety and report of group saved searches | roger64 | Editor | 7 | 03-17-2017 03:17 AM |
Saved Searches Window | Divingduck | Editor | 10 | 10-07-2014 11:21 PM |
Saved searches : suggestions | Bertrand | Editor | 0 | 05-09-2014 05:58 AM |
copy saved searches | cybmole | Calibre Companion | 4 | 04-28-2014 07:20 AM |
Where are searches saved? | travger | Calibre | 2 | 08-26-2012 01:37 PM |