Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 09-12-2019, 11:33 AM   #1
neilrh
Member
neilrh began at the beginning.
 
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
neilrh is offline   Reply With Quote
Old 09-12-2019, 12:36 PM   #2
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by neilrh View Post
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.
Two easy ways of doing it:

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.
Tex2002ans is offline   Reply With Quote
Advert
Old 09-12-2019, 01:36 PM   #3
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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
This is a little fancier
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
<remember the following space
theducks is offline   Reply With Quote
Old 09-12-2019, 02:46 PM   #4
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by theducks View Post
I don't think #1 works with single letter words.
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.
Tex2002ans is offline   Reply With Quote
Old 09-12-2019, 02:50 PM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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
Quote:
Originally Posted by Tex2002ans View Post
It works. I tested it before responding to make sure.
I wonder if there is a setting I messed up a long time ago. I've only had it find words with wrong letters (or case in the middle).
Anyway. The OP has solutions either way
theducks is offline   Reply With Quote
Advert
Old 09-12-2019, 03:09 PM   #6
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,587
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Code:
\b(T)\b
in regex mode should catch most cases (replace with I).

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.
DiapDealer is offline   Reply With Quote
Old 09-12-2019, 03:45 PM   #7
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,587
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by DiapDealer View Post
like if there's markup dividing an actual word, for instance (not that I can think of any good reason why there should be).
Drop caps, raised caps, or fancy first letters come to mind, now. You'll want to be wary of those regardless of the method used.
DiapDealer is offline   Reply With Quote
Old 09-12-2019, 04:58 PM   #8
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by DiapDealer View Post
Code:
\b(T)\b
in regex mode should catch most cases (replace with I).
I was a little hesitant with giving the Regex \bLetter\b, although in this case it might work okay.

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:
Originally Posted by DiapDealer View Post
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).
Maths:

<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.
Tex2002ans is offline   Reply With Quote
Old 09-12-2019, 05:42 PM   #9
neilrh
Member
neilrh began at the beginning.
 
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.
neilrh is offline   Reply With Quote
Old 09-12-2019, 07:56 PM   #10
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,650
Karma: 26966376
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by DiapDealer View Post
... --like if there's markup dividing an actual word, for instance (not that I can think of any good reason why there should be).
I have seen single syllables within a word italicised/emboldened/underlined, which results in erroneous errors be reported in hunspell spellchecking. Must have a look at PageEdit's spell checker to see if it handles them any better.

Why is it done, because the writer is not a very good writer.

BR
BetterRed is offline   Reply With Quote
Old 09-12-2019, 08:05 PM   #11
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by neilrh View Post
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.
Ahh yes, forgot that "Show All Words" needs to be checked.

Here is how mine looks:

Click image for larger version

Name:	SpellcheckSingleLetter.png
Views:	129
Size:	6.3 KB
ID:	173440

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'.
Tex2002ans is offline   Reply With Quote
Old 09-12-2019, 11:32 PM   #12
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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)
theducks is offline   Reply With Quote
Old 09-13-2019, 01:49 AM   #13
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,650
Karma: 26966376
Join Date: Mar 2012
Location: Sydney Australia
Device: none
I use Show All to eye-ball hyphenated words

BR
BetterRed is offline   Reply With Quote
Old 09-13-2019, 02:27 AM   #14
Vroni
Banned
Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'
 
Posts: 168
Karma: 10010
Join Date: Oct 2018
Device: Tolino/PRS 650/Tablet
Quote:
Originally Posted by DiapDealer View Post
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).
Quote:
E<small>ND</small>
Filler to have than 5 Words
Vroni is offline   Reply With Quote
Old 09-13-2019, 05:45 AM   #15
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by Vroni View Post
Code:
E<small>ND</small>
Filler to have than 5 Words
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;
}
Hacking it together with <small>:
  • Breaks spellchecking
  • Breaks Text-to-Speech
  • Loses proper capitalization info
  • [...]

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>
Text-to-Speech: "J. P" + "enalties on" + "M" + "arket F" + "orms".

Compare to:

Code:
<h3><span class="smallcaps">J. Penalties on Market Forms</span></h3>
It's also one of the most common places I see code errors/typos introduced.

And if you want "fun" spaghetti. Things get way more interesting when you intend to display actual lowercase words as <small>caps:

Spoiler:
Code:
<h3>A. T<small>HE</small> G<small>ENERAL</small> S<small>ALES</small> T<small>AX AND THE</small> L<small>AWS OF</small> I<small>NCIDENCE</small></h3>
Compared to:

Code:
<h3><span class="smallcaps">A. The General Sales Tax and the Laws of Incidence</span></h3>


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:
Code:
<h3>D. A N<small>OTE ON</small> S<small>OME</small> C<small>RITICISMS OF</small> 100-P<small>ERCENT</small> R<small>ESERVE</small></h3>
Code:
<p class="center">F<small>IGURE</small> 57. E<small>FFECT OF</small> C<small>HANGES IN THE</small> R<small>ATE OF</small> I<small>NTEREST ON THE</small> D<small>ISCOUNTED</small> M<small>ARGINAL</small> V<small>ALUE</small> P<small>RODUCT AS</small> S<small>UPPLY OF THE</small> F<small>ACTOR</small> V<small>ARIES</small></p>
Imagine Text-to-Speech reading that one!

Last edited by Tex2002ans; 09-13-2019 at 06:16 AM.
Tex2002ans is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 09:26 AM.


MobileRead.com is a privately owned, operated and funded community.