View Single Post
Old 07-15-2012, 09:00 PM   #366
snarkophilus
Wannabe Connoisseur
snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.
 
Posts: 241
Karma: 1009530
Join Date: Apr 2011
Location: Geelong, Australia
Device: Sony PRS-T1, Sony PRS-350, Palm TX
Hi Kiwi,

One of the books in my library gives the following error:

Spoiler:
Code:
Count Page/Word Statistics
-------------------------------
Logfile for book ID 51 (The Hitchhiker's Guide To The Galaxy)
	Found 109 pages
51
InputFormatPlugin: EPUB Input running
on C:\DOCUME~1\Simon\LOCALS~1\Temp\calibre_0.8.60_tmp_xclnhr\bw_e3g_count_pages\51.epub
Found HTML cover titlepage.xhtml
	Page count: 109.0
	Word count: 0
	Results of NLTK text analysis:
	  Number of characters: 0
	  Number of words: 0
	  Number of sentences: 1
	  Number of syllables: 0
	  Number of complex words: 0
	  Average words per sentence: 0
Traceback (most recent call last):
  File "calibre_plugins.count_pages.jobs", line 156, in do_statistics_for_book
  File "calibre_plugins.count_pages.statistics", line 290, in get_flesch_reading_ease
ZeroDivisionError: float division by zero


This is for an old eReader PRC that Calibre converted to ePub, and it looks like the conversion has gone horribly wrong. The <title> is approx 350kb and the body is:

Code:
<body class="calibre"/>
Should the plugin fail a bit more graciously here - perhaps catch the 0 word count and not update the databse?

Cheers,
Simon.
snarkophilus is offline   Reply With Quote