View Single Post
Old 10-16-2010, 01:32 PM   #52
Gary_M_Mugford has a complete set of Star Wars action figures.Gary_M_Mugford has a complete set of Star Wars action figures.Gary_M_Mugford has a complete set of Star Wars action figures.
Gary_M_Mugford's Avatar
Posts: 139
Karma: 297
Join Date: Jul 2010
Location: Brampton ON
Device: Kobo, Kindle3
Originally Posted by chaley View Post
I considered making a real lexical analyzer/parser for the template language, but gave it up because of performance. I didn't want to create a 'compiled' form, and I didn't want to reparse (worse would be the lexical analysis) each time. Thus, spaces count.

Most of the more interesting custom column collection features are disabled when metadata management isn't set to automatic, which must be your case. The problem is that with manual management, calibre cannot know where the values come from, so it cannot apply combining and renaming. I could probably make the stuff work with 'on-send', but I didn't try.
The best of the initialisms versus shorten factions would be a regex that would check for spaces=0 and then use the shorten(4,~,3) versus the full regex contraction. Have NO idea whether regex can do that. But for the time-being, I've adopted the initialisms version after having tried the shorten function. I find the shorten version works for letting me know WHICH book in the series to read first, but I prefer giving up Mistborn1 for the occasional M1 rather than the occasional Tale~ers1 instead of the Tales Of the Black Widowers 1 becoming TOTBW1. More space on the woefully inadequate title browser screen on the Kindle for the actual title is a good thing.

Thanks for providing me with the initialism code. Very much appreciated.


EDIT: Guess I'm not much of a programmer. Had spaces>0 originally. The pseudocode should be if spaces=0 then shorten else regex. Not that it matters, since Charles is going above and beyond. Looking forward to next week's release, afterwhich I will be making the composite columns outlined below end enjoying the best of all worlds.

Last edited by Gary_M_Mugford; 10-20-2010 at 01:08 AM.
Gary_M_Mugford is offline   Reply With Quote