02-13-2019, 05:02 PM | #16 | |
Wizard
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
Quote:
I won't know apriori the word or words or phrases to build the OR RegEx Find. Proofing or fixing a book, when I come across a word or phrase (typically foreign) that I want in italics (or bold or <span>-ed or whatever) everywhere in the book, I could select the text, and then run a stored search "Make Selection Italic" IF there were a way to have Find somehow use what ever is selected MS Word's Find&Replace lets you use ^c for the clipboard contents, and there's so much in Calibre, I didn't know there was something similar, or if it could be easily added Last edited by phossler; 02-13-2019 at 05:05 PM. |
|
02-13-2019, 05:18 PM | #17 | |
Well trained by Cats
Posts: 29,785
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
I have a clip Code:
<span lang="es">\1</span> I just select and click the LANG= clip on my toolbar |
|
Advert | |
|
02-13-2019, 05:27 PM | #18 |
Wizard
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
'Clips' or 'Snippets'?
I couldn't find 'Clips' and there doesn't seem to be 'Clips Toolbar' You might be thinking of Sigil ??? Even so, they're more of an ad hoc thing IIRC, not a global F&R |
02-13-2019, 05:45 PM | #19 | |
null operator (he/him)
Posts: 20,559
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
BR |
|
02-13-2019, 07:27 PM | #20 |
Well trained by Cats
Posts: 29,785
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
Advert | |
|
02-13-2019, 07:33 PM | #21 | |
Wizard
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
Quote:
jbacelar's suggestion seems to offer a way to do a global F&R It just requires some careful manual copy/pasting, and not as IMHO user friendly as having a token representing the selected text |
|
02-13-2019, 11:09 PM | #22 |
creator of calibre
Posts: 43,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Simply edit your saved search, replacing the matched word in the search definition, then run it on all files. Done in about 5 clicks.
|
02-14-2019, 09:58 AM | #23 | |
Wizard
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
Quote:
It's just that the book I'm trying to cleanup has many foreign words used many times each so I was looking for the most efficient to add <i> tags around each instance of each word If there were a token (e.g. _SELECTION_) that could be used in the saved search, then it'd only be one click: Select word/phrase, click Saved Search |
|
02-14-2019, 10:02 AM | #24 |
creator of calibre
Posts: 43,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
opena text file go through th ebook selecting the words one by one and copying them into the text file, separated by | then use that expression ina single search and replace.
|
02-14-2019, 01:57 PM | #25 | |
Wizard
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
Quote:
So for now, jbacelar's suggestion seems to offer the most flexible way to do a global F&R for <i>Things like this</i> Thanks to everyone for the ideas and suggestions |
|
02-14-2019, 06:06 PM | #26 |
null operator (he/him)
Posts: 20,559
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@phossler - IIRC one of the Sigil cleanup plugins works off word lists, I'm not sure if the replacement can include tags - might be worth a look.
BR |
02-14-2019, 09:22 PM | #27 |
Wizard
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
@BetterRed --
Thanks for the tip. I used to use Sigil, but when Kovid released his editor module, I switched and standardized on Calibre. I guess I'll bite the bullet and use jacelar's and KG's suggestion paste the word or phrase into the saved search Find box and do a replace all It's still much easier than the way I was doing it with the Find/Replace at the bottom of the screen I'll have a series of saved searches: one to put <i> around all instances of a foreign word or phrase, and others to put a <span lang= .… > around foreign text (might include italics there - hmmm, didn't think of that) Not sure what the actual rules are for marking/tagging foreign text is, but that'll be a fun research project for another day Added - actually, the document language is English, so spell check flags the foreign words. From the spell check error report, I can copy the word to the saved search and do a replace all. Removes it from spell check error since I don't like to Ignore or Add To Dictionary Doesn't work for phrases tho Last edited by phossler; 02-14-2019 at 09:37 PM. |
02-14-2019, 09:40 PM | #28 |
null operator (he/him)
Posts: 20,559
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@phossler - I don't see them as either/or, so I use both - I find some things easier in Sigil than calibre and vice-versa. And Sigil has a some useful plugins.
IIRC the Sigil devs are planning to dispense with the rigid folder structure. BR |
02-20-2019, 03:05 AM | #29 | |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Ever since Calibre added Multi-Language Spellcheck, you can easily mark the words with lang + xml:lang. Example sentence: Code:
I ate some español sofritos today. Most foreign words should pop up as misspelled. "sofritos" would stick out like a sore thumb. Use Change selected word to and replace it with something like "@sofritos@". Note: The very last word in the list is the word itself, so just click on that and make your adjustments: 2. After the end of the first pass, do a mass Search/Replace: Search: @(.+?)@ Replace: <i lang="es" xml:lang="es">\1</i> Code:
I ate some español <i lang="es" xml:lang="es">sofritos</i> today. You'll easily be able to see which Spanish words you've caught so far, and narrow the list down further: 4. Now uncheck Show only misspelled words, and do a few more passes. That should get you most of the way there. 5. To attach most "phrases" (which are made up of just individual foreign words)... search for two Spanish italics next to each other: Search: (<i lang="es" xml:lang="es">.+?)</i> <i lang="es" xml:lang="es"> Replace: \1 and it'll merge them: Code:
I ate some <i lang="es" xml:lang="es">español sofritos</i> today. Just wondering, why exactly are you marking all foreign words in italics? Are you trying to enforce a Style Guide (CMOS?) or something along those lines? Last edited by Tex2002ans; 02-20-2019 at 04:26 AM. |
|
02-20-2019, 10:00 AM | #30 |
Wizard
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
1. Some very good ideas -- thanks
2. a. Proofing APA, MLA, and ASA papers for family members using MS Word b. I thought it was the convention since that was what I was used to seeing in dead tree books from my student days. I might have over-generalized, but I was going by something like this. APA is similar c. There are no house rules or S&C in my house for most ebooks, since I mostly just try to re-format for my Kindle and for easier reading, so I just wanted to do it that way (aka No Good Reason ) Of course, for APA, etc. or other papers, I'd follow what ever the guidelines were. https://style.mla.org/styling-foreign-terms/ Spoiler:
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Difference in Manual Search and Saved Search | phossler | Editor | 4 | 10-04-2015 12:17 PM |
A wee request regarding search notification (and file selection) | sherman | Editor | 1 | 04-06-2014 10:50 AM |
Sending selection from Search & Replace to different fields? | MelBr | Calibre | 2 | 03-05-2013 01:00 PM |
Saved Search: How 2 | theducks | Library Management | 3 | 11-27-2012 02:10 PM |
Need help setting up a saved search | ficbot | Calibre | 1 | 07-10-2010 02:10 PM |