View Single Post
Old 11-24-2010, 09:01 AM   #7
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Quote:
Originally Posted by Man Eating Duck View Post
Out of curiosity: What will you use it for?
I do this now by converting all books to text, run them through wc and inserting the values in a custom column with sql.
I'm doing it for the optional preprocessing code under structure detection, there is code there that searches for common chapter headings and and marks them up, either for books that weren't properly marked, or for users who can't figure out xpath. Problem is I can't measure whether the markup search was successful without having an idea how long the book is, so I'm using the word count to tune the aggressiveness/when to stop.

The actual count I'm providing should do the trick for what you want, I'll let you look into auto-populating DB records or accessing it in some alternate fashion if you want to go for that, but the function will be there.


Quote:
Originally Posted by Man Eating Duck View Post
Word count is not my motivation for starting this thread, it's just something I might do to become familiar with Python and Calibre. I like tinkering with code, but I'm certainly not capable of writing production quality code right now, and don't know if I ever will be.
I realized that, just thought I'd chime in as that's what I was working on. I don't have anything constructive to add to the IDE discussion. I'm more of a tinkerer myself, you shouldn't let that stop you from contributing.
ldolse is offline   Reply With Quote