09-12-2019, 11:33 AM | #1 |
Member
Posts: 10
Karma: 10
Join Date: Sep 2019
Device: none
|
Replacing a single letter
Hello,
I'm using Sigil to edit a book which has many single T's instead of I's. example : (T will not) instead of the correct (I will not). Can anyone help me as to what to I need to enter in the find box to select a single T rather than t as part of a word. Thank you Neil |
09-12-2019, 12:36 PM | #2 | |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
1. Tools > Spellcheck > Spellcheck. Use the "Search" box up top to search for T, and use the "Change Selected Word To" box on the right side to change it to I. 2. Search > Find & Replace. Search for "SPACE + T + SPACE". Replace with "SPACE + I + SPACE". Then do another search for many other edge cases. I would personally go with #1, because it's easy, and because you'll probably spot lots of other "T" typos as well. |
|
Advert | |
|
09-12-2019, 01:36 PM | #3 |
Well trained by Cats
Posts: 29,922
Karma: 55705602
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Tex
I don't think #1 works with single letter words. Code:
([“"\s]*)T\s tests for either of 2 types of quotes or space, then a single T followed by a space the capture allows replacement (I never got use of look behind down pat ) Code:
\1I |
09-12-2019, 02:46 PM | #4 |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
It works. I tested it before responding to make sure. It'll also be more robust than trying to do multiple sets of Find/Replace/Regex... because looking just for spaces around the letter would miss more obscure edge cases like:
—T— <sup>T</sup> [...] where the spellcheck would catch it. Last edited by Tex2002ans; 09-12-2019 at 02:48 PM. |
09-12-2019, 02:50 PM | #5 |
Well trained by Cats
Posts: 29,922
Karma: 55705602
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
Advert | |
|
09-12-2019, 03:09 PM | #6 |
Grand Sorcerer
Posts: 27,587
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Code:
\b(T)\b Nothing's going to be perfect--like if there's markup dividing an actual word, for instance (not that I can think of any good reason why there should be). But it should catch things like: "T want to know." or There but for the grace of god go T. But it will fail, if say, there's some dialog that attempts to simulate someone stuttering. Like: "I want T-T-T-T-To know!" Last edited by DiapDealer; 09-12-2019 at 03:13 PM. |
09-12-2019, 03:45 PM | #7 |
Grand Sorcerer
Posts: 27,587
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
09-12-2019, 04:58 PM | #8 | ||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
I've gotten burned too many times on words like "can't", where the apostrophe counts as the word boundary, so the single 't' gets caught up. And then I only notice much too late after I Replace All and moved on. :P Quote:
<i>x</i>-axis sin<i>x</i> x<sup>2</sup>y<sup>3</sup> The <i>k</i>th number. or emphasis on part of word: <i>non</i>existent That's just the few cases off the top of my head. :P Last edited by Tex2002ans; 09-12-2019 at 05:03 PM. |
||
09-12-2019, 05:42 PM | #9 |
Member
Posts: 10
Karma: 10
Join Date: Sep 2019
Device: none
|
Big thanks to everyone. I couldn't get spellcheck to pick up the single T, the only way I could get it to work was by showing all words and then scrolling down until I found it.
Search > Find & Replace, the count was 33 for([“"\s]*)T\s and 35 for \b(T)\b. Sorted, and appreciate all the help. |
09-12-2019, 07:56 PM | #10 | |
null operator (he/him)
Posts: 20,650
Karma: 26966376
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Why is it done, because the writer is not a very good writer. BR |
|
09-12-2019, 08:05 PM | #11 | |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Here is how mine looks: 1. Check the box for "Show All Words". 2. Type T into the search box. 3. Click the word you want to replace. In this case, the capital letter 'T'. 4. In the "Change Selected Word To" box, type what you want to replace. In this case, 'I'. |
|
09-12-2019, 11:32 PM | #12 |
Well trained by Cats
Posts: 29,922
Karma: 55705602
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
That is why I did not see it. I almost never tick that box (my list is usually pretty long, since I use it on SF/Fantasy a lot)
|
09-13-2019, 01:49 AM | #13 |
null operator (he/him)
Posts: 20,650
Karma: 26966376
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
I use Show All to eye-ball hyphenated words
BR |
09-13-2019, 02:27 AM | #14 |
Banned
Posts: 168
Karma: 10010
Join Date: Oct 2018
Device: Tolino/PRS 650/Tablet
|
|
09-13-2019, 05:45 AM | #15 |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
No, there's never a valid reason to do <small> abominations to try to emulate smallcaps. The cons heavily outweigh any "pros".
Always use: Code:
<span class="smallcaps">The End</span> span.smallcaps { font-variant: small-caps; }
Here's one of the latest books I had to cleanup: Code:
<h3>J. P<small>ENALTIES ON</small> M<small>ARKET</small> F<small>ORMS</small></h3> Compare to: Code:
<h3><span class="smallcaps">J. Penalties on Market Forms</span></h3> And if you want "fun" spaghetti. Things get way more interesting when you intend to display actual lowercase words as <small>caps: Spoiler:
Throw in a few spaces, hyphens, numbers, and punctuation, and now we have a real ballgame! Here's a few others straight from the book: Spoiler:
Last edited by Tex2002ans; 09-13-2019 at 06:16 AM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Replacing //.+// with <i>.+</i> | The_Goblin | Editor | 5 | 08-05-2019 12:09 AM |
Replacing with regex | 1v4n0 | Sigil | 11 | 01-17-2015 02:07 PM |
Replacing code without replacing text? | ElMiko | Sigil | 6 | 11-30-2011 08:14 PM |
Replacing my Hanlin V3 | maddz | Which one should I buy? | 0 | 11-25-2010 04:14 AM |
Replacing ¬ | PieOPah | Workshop | 5 | 12-17-2008 04:25 PM |