Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 10-27-2023, 07:14 PM   #1
mike the leg
Junior Member
mike the leg began at the beginning.
 
Posts: 5
Karma: 10
Join Date: May 2021
Device: kindle
Question Title Case not working on "the" "a" "in" etc

Does anyonne else have the problem that
Edit metadata in bulk -> apply function after replace -> Title Case
does not put a capital on various works like "in" "the" "a" etc

For example
"a witch in the time of the lords"
should become
"A Witch In The Time Of The Lords"
but actual becomes
"a Witch in the Time of the Lords"

Somewhere in Calibre there must be a list of words that are not to be give a capital letter.
Anyone know where and can they be remove?
mike the leg is offline   Reply With Quote
Old 10-27-2023, 08:09 PM   #2
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: 31,047
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Moderator Notice
Moved out of development. Please comply with the stickie there
theducks is offline   Reply With Quote
Advert
Old 10-27-2023, 08:10 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: 31,047
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Check the Language setting for that book
theducks is offline   Reply With Quote
Old 10-27-2023, 09:43 PM   #4
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: 21,718
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by mike the leg View Post
Does anyonne else have the problem that
Edit metadata in bulk -> apply function after replace -> Title Case
does not put a capital on various works like "in" "the" "a" etc

For example
"a witch in the time of the lords"
should become
"A Witch In The Time Of The Lords"
but actual becomes
"a Witch in the Time of the Lords"

Somewhere in Calibre there must be a list of words that are not to be give a capital letter.
Anyone know where and can they be remove?
RU sure it doesn't become "A Witch in the Time of the Lords"

Which conforms to the major Style Guides see Title case - Wikipedia

Example: Killers of the Flower Moon (2023) - IMDb

BR
BetterRed is offline   Reply With Quote
Old 10-28-2023, 04:33 AM   #5
Quoth
Still reading
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 14,010
Karma: 105092227
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
Normally a, is, the, in, of and similar are not capitalised unless at the start. That's what Title Case means. There are edge cases that vary between Style Guides (and languages vary). But certainly absolutely every word Capitalised is not Title Case in English.
Quoth is offline   Reply With Quote
Advert
Old 10-29-2023, 06:02 PM   #6
Ma'am-I-Am
Preferred pronouns: We/Us
Ma'am-I-Am ought to be getting tired of karma fortunes by now.Ma'am-I-Am ought to be getting tired of karma fortunes by now.Ma'am-I-Am ought to be getting tired of karma fortunes by now.Ma'am-I-Am ought to be getting tired of karma fortunes by now.Ma'am-I-Am ought to be getting tired of karma fortunes by now.Ma'am-I-Am ought to be getting tired of karma fortunes by now.Ma'am-I-Am ought to be getting tired of karma fortunes by now.Ma'am-I-Am ought to be getting tired of karma fortunes by now.Ma'am-I-Am ought to be getting tired of karma fortunes by now.Ma'am-I-Am ought to be getting tired of karma fortunes by now.Ma'am-I-Am ought to be getting tired of karma fortunes by now.
 
Ma'am-I-Am's Avatar
 
Posts: 209
Karma: 533346
Join Date: Jun 2014
Location: <--- Over There, USA
Device: Kindle PW 2
When you change the case, choose Capitalize. It's the wrong thing to do (says my inner librarian), but you do you.
Ma'am-I-Am is offline   Reply With Quote
Old 10-29-2023, 09:38 PM   #7
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: 21,718
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Ma'am-I-Am View Post
When you change the case, choose Capitalize. It's the wrong thing to do (says my inner librarian), but you do you.
Are you sure about that.

On a vanilla calibre 6.29 install on Windows 10; Capitalise case changes "a witch in the time of the lords" to "A witch in the time of the lords", which some tools refer to as Sentence case.

BR
BetterRed is offline   Reply With Quote
Old 10-30-2023, 09:18 AM   #8
Quoth
Still reading
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 14,010
Karma: 105092227
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
Quote:
Originally Posted by BetterRed View Post
Are you sure about that.

On a vanilla calibre 6.29 install on Windows 10; Capitalise case changes "a witch in the time of the lords" to "A witch in the time of the lords", which some tools refer to as Sentence case.

BR
I agree. Calibre's Capitalise is simply "sentence case", i.e. capitalise first letter of title.
Quoth is offline   Reply With Quote
Old 10-30-2023, 10:06 AM   #9
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,443
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
One can do what I think the OP wants, all words capitalized, using template mode in search & replace. (Personally I think capitalizing every word is wrong, but the OP is in charge of the OP's library.)

If the titles don't contain non-alphabetic characters other than space then this GPM template does the job.
Code:
program:
	new_title = list_re_group($title, ' ', '.', '(.*)', 'program: capitalize($)')
With this template, "a witch in the time of the lords" becomes "A Witch In The Time Of The Lords".

If the titles do contain non-alphabetic characters such as colons and you want strings like foo:bar to become Foo:Bar then this python template gets close.
Code:
python:
def evaluate(book, context):
	import re
	nt = []
	for w in re.split(r'([() :-]+)', book.get('title')):
		nt.append(w.capitalize())
	return ''.join(nt)
You must list the characters on line 5 that can precede words to be capitalized. This example uses r'([() :-]+)', parens, space, colon, dash. The problem children are quotes. Sometimes one wants the capitalization after the quote (quoted words in titles, as in "What Does "Foobar" Mean") and sometimes not (possessives, as in "John's Great Escape").

The first template probably gets most of the way there. I wouldn't try to get too fancy, instead correcting any "mistakes" by hand.

The search/replace looks like this, with the desired template in the template box.
Attached Thumbnails
Click image for larger version

Name:	Clipboard01.jpg
Views:	88
Size:	124.2 KB
ID:	204481  
chaley is offline   Reply With Quote
Old 11-06-2023, 09:27 AM   #10
mike the leg
Junior Member
mike the leg began at the beginning.
 
Posts: 5
Karma: 10
Join Date: May 2021
Device: kindle
OK Chaley, thankyou, that looks like it should do what I want.
iIt is a bit beyond my programming capabilities so I will copy some books into a small library and give it a try.
mike the leg is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pressing "Restore Defaults" under "Book Details" wipes all "Look & Feel" settings. MarjaE Library Management 1 03-30-2021 11:46 AM
A warning for Linux users: slow "Add Books", "Unknown" title and Author rolgiati Library Management 8 07-24-2013 04:36 PM


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


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