Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 04-12-2020, 02:33 AM   #1
raghiid
Connoisseur
raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.
 
Posts: 63
Karma: 666666
Join Date: Feb 2019
Device: Kindle Paperwhite
Search & Replace not working properly

I use calibre's search & replace feature to enable ligatures in the book (fi, fl) and they work great, but sometimes, within a book there are some fi's and fl's that are not replaced by their ligature glyph, as if calibre skipped over them. What's wrong here?

I'm using calibre 3.48 (last version supported by my mac) and convert to azw3 and I use the "hyphenate this" plugin.
Attached Thumbnails
Click image for larger version

Name:	screenshot_2020_04_12T09_28_08+0300 2.png
Views:	129
Size:	110.9 KB
ID:	178311  
raghiid is offline   Reply With Quote
Old 04-12-2020, 03:02 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,339
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
if you use hyphenate this then there will be hyphens between some chanracters. Your search expression needs to take that into account.
kovidgoyal is offline   Reply With Quote
Advert
Old 04-12-2020, 03:27 AM   #3
raghiid
Connoisseur
raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.
 
Posts: 63
Karma: 666666
Join Date: Feb 2019
Device: Kindle Paperwhite
Quote:
Originally Posted by kovidgoyal View Post
if you use hyphenate this then there will be hyphens between some chanracters. Your search expression needs to take that into account.
How do I do this? Right now, all I have calibre replace are the fi & fl glyphs.
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2020-04-12 at 10.25.21 AM.png
Views:	122
Size:	145.0 KB
ID:	178314  
raghiid is offline   Reply With Quote
Old 04-12-2020, 03:35 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,339
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Your search expression needs to include an optional soft hyphen character. Or alternately use the polish books tool first, to remove the soft hyphens, do your search replace and then put them back using polish books or hyphenate this if you prefer.
kovidgoyal is offline   Reply With Quote
Old 04-12-2020, 04:01 AM   #5
raghiid
Connoisseur
raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.
 
Posts: 63
Karma: 666666
Join Date: Feb 2019
Device: Kindle Paperwhite
Quote:
Originally Posted by kovidgoyal View Post
Your search expression needs to include an optional soft hyphen character.
How do I do this part? Since I don't want any extra steps like the Polish Book feature.
I appreciate your help man!
raghiid is offline   Reply With Quote
Advert
Old 04-12-2020, 08:28 AM   #6
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by raghiid View Post
How do I do this part? Since I don't want any extra steps like the Polish Book feature.
The Hyphenate This! plugin is inserting a soft hyphen character in every location in each word where the hyphenation rules say a word can be split. That means for a search to match a word, it needs a soft hyphen character in each spot. And, you should make it optional in case you have done some editing and accidentally removed it.

Personally, it makes a lot more sense to remove the hyphenation and only run Hyphenate This! on the book after you have finished editing the book. It should be one of the last steps in your book processing.
davidfor is offline   Reply With Quote
Old 04-12-2020, 08:48 AM   #7
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,339
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Code:
f\u00ad?i
kovidgoyal is offline   Reply With Quote
Old 04-12-2020, 10:01 AM   #8
raghiid
Connoisseur
raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.
 
Posts: 63
Karma: 666666
Join Date: Feb 2019
Device: Kindle Paperwhite
Quote:
Originally Posted by davidfor View Post
The Hyphenate This! plugin is inserting a soft hyphen character in every location in each word where the hyphenation rules say a word can be split. That means for a search to match a word, it needs a soft hyphen character in each spot. And, you should make it optional in case you have done some editing and accidentally removed it.

Personally, it makes a lot more sense to remove the hyphenation and only run Hyphenate This! on the book after you have finished editing the book. It should be one of the last steps in your book processing.
Oddly, I've found that if I hyphenate before converting to azw3, the page count that calibre inserts does not show up in the book.
raghiid is offline   Reply With Quote
Old 04-12-2020, 10:29 AM   #9
raghiid
Connoisseur
raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.
 
Posts: 63
Karma: 666666
Join Date: Feb 2019
Device: Kindle Paperwhite
Quote:
Originally Posted by kovidgoyal View Post
Code:
f\u00ad?i
Kovid my friend, you are spoon feeding me snippets of the solution in three posts! And I still don't get it.
raghiid is offline   Reply With Quote
Old 04-13-2020, 01:39 AM   #10
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by raghiid View Post
Oddly, I've found that if I hyphenate before converting to azw3, the page count that calibre inserts does not show up in the book.
That seems to support my recommendation to do the hyphenation last Get the book right, convert to AZW3 and then run the Hyhpenate This! plugin on the AZW3 version only. Though I don't know if that can be done as I don't use the plugin. I remember trying it and found it caused more problems than it solved.

As to Kovid's short reply, that was the search string to find all an occurrence of "f" followed by a soft-hyphen (using the unicode value for the character) and then an "i". Put that into the the find field, change the mode to "Regex" and press the find button. That will find the problem.

If what you want to do is remove all the occurrences of "fl" and "fi" with a soft-hyphen in the middle, you could use the search:

Code:
(f)\u00ad([il])
With replace:

Code:
\1\2
And again in Regex mode. Either do a find and then replace, or use "Replace all" to do it in one go.

Of course, if the Hyphenate This! plugin is putting a hyphen between these characters it could be a bug in that plugin. Maybe you should ask the plugin's author about this.
davidfor is offline   Reply With Quote
Old 04-13-2020, 03:59 AM   #11
raghiid
Connoisseur
raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.raghiid ought to be getting tired of karma fortunes by now.
 
Posts: 63
Karma: 666666
Join Date: Feb 2019
Device: Kindle Paperwhite
Really appreciate you taking the time to respond.
Unfortunately, I still haven't figured it out. Some ligatures are working, and some aren't, I will have to live with that.

Thanks!
raghiid is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Regex in search problems (NOT Search&Replace; the search bar) lairdb Calibre 3 03-15-2017 07:10 PM
regexp search/replace not working as expected on individual authors in source field masp Library Management 9 08-08-2015 10:33 PM
Search and Replace No Longer Working ssolitar Editor 2 05-04-2014 05:33 PM
Simple Search & Replace not working!? MontyJ Conversion 1 07-14-2012 07:13 PM
Search and replace not working helmerer Conversion 4 02-25-2011 03:48 AM


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


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