View Single Post
Old 01-06-2016, 06:44 PM   #818
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,286
Karma: 16800000
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Just FYI for anyone interested ...

Based on a very quick look, the current algorithm for calculating Wordcount appears to be taken from main calibre code (calibre.utils.wordcount, author="Ryan Ginstrom") rather than being created specifically for the 'Count Pages' plugin.

I imagine getting it changed would involve either:
  1. Convincing Kovid/Ryan Ginstrom to change it calibre-wide (good luck with that ) or
  2. Replacing a couple of lines in your own personal copy of 'Count Pages' statistics.py

    From:
    Code:
        wordcount = get_wordcount_obj(book_text)
        return wordcount.words
    To:
    Code:
        words = _my_wordcount_algorithm(book_text)
        return words
    
    def _my_wordcount_algorithm(text):
        wcount = <Your personal wordcount algorithm here>
        return wcount

ETA: Damn - not quick enough!

Last edited by jackie_w; 01-06-2016 at 06:47 PM.
jackie_w is offline   Reply With Quote