Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 11-12-2014, 08:29 PM   #691
stevenlebeau
Junior Member
stevenlebeau began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Nov 2014
Device: Kindle Paperwhite
Yeah, I just tried looking at the source. Way too complicated to figure out what's going on there. I think I'm just going to convert all my epubs to .txt and then make a command-line script in Python to do the unique word counts.
stevenlebeau is offline   Reply With Quote
Old 11-12-2014, 09:31 PM   #692
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: 20,565
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@stevenlebeau - you could shovel the results from parsing the text files into a custom column in the metadata database via the Import List PI - I don't think the calibredb ebook-meta command allows updating of custom columns.

BR
BetterRed is online now   Reply With Quote
Advert
Old 11-12-2014, 10:03 PM   #693
stevenlebeau
Junior Member
stevenlebeau began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Nov 2014
Device: Kindle Paperwhite
That could work! I'll give it a shot.
stevenlebeau is offline   Reply With Quote
Old 11-13-2014, 12:07 AM   #694
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by stevenlebeau View Post
Yeah, I just tried looking at the source. Way too complicated to figure out what's going on there. I think I'm just going to convert all my epubs to .txt and then make a command-line script in Python to do the unique word counts.
I had a look when you first asked, and it wouldn't be that hard. If you follow the count words code (in statistics.py), that extracts the text from all the contained files. The lazy coder in me would convert that to a list and then a set and get the size of the set. That would give a crude count. And as a hack, returning it as the word count, lets you see and store the number.

There's probably a more efficient way to do it than that, plus maybe you want to filter some words. Should "a" and "I" be counted? Or "the", "and" etc. Do plurals get counted separately? What about proper nouns? Numbers?

Adding it as an option and using a separate custom column is, to me anyway, the hard bit. But, it is mainly copying similar sections and changing the names to protect the innocent. Getting the GUI all looking good with decent field descriptions is probably the hardest bit.

And I'm regretting typing this. I'm giving myself a "If it's so easy, why don't you do it" feeling
davidfor is offline   Reply With Quote
Old 11-13-2014, 12:30 AM   #695
stevenlebeau
Junior Member
stevenlebeau began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Nov 2014
Device: Kindle Paperwhite
Based on what you wrote, I actually changed the lines in statistics.py to make this happen. Only thing is, calibre won't let me install it. I re-zipped and tried to install the plug-in manually, and it complained about not having a __init__.py file (which it DOES have, so I'm not sure what to do next).

I suppose I could simply change the already-installed statistics.py to do the work for me, but I haven't been able to figure out where calibre stores its' plug-ins in OS X.
stevenlebeau is offline   Reply With Quote
Advert
Old 11-13-2014, 03:40 AM   #696
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: 20,565
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by stevenlebeau View Post
Based on what you wrote, I actually changed the lines in statistics.py to make this happen. Only thing is, calibre won't let me install it. I re-zipped and tried to install the plug-in manually, and it complained about not having a __init__.py file (which it DOES have, so I'm not sure what to do next).

I suppose I could simply change the already-installed statistics.py to do the work for me, but I haven't been able to figure out where calibre stores its' plug-ins in OS X.
Maybe in the plugins subdirectory of the configuration folder, on Windows the config folder is wherever you land when you click the Preferences->Miscellaneous->Open calibre configuration button

BR
BetterRed is online now   Reply With Quote
Old 11-13-2014, 04:16 AM   #697
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by stevenlebeau View Post
Based on what you wrote, I actually changed the lines in statistics.py to make this happen. Only thing is, calibre won't let me install it. I re-zipped and tried to install the plug-in manually, and it complained about not having a __init__.py file (which it DOES have, so I'm not sure what to do next).
Did you accidentally create a zip file with folder inside it which has all the files?
Quote:
I suppose I could simply change the already-installed statistics.py to do the work for me, but I haven't been able to figure out where calibre stores its' plug-ins in OS X.
Which probably wouldn't help as the plugins are still zip files in that directory.
davidfor is offline   Reply With Quote
Old 11-13-2014, 05:54 AM   #698
stevenlebeau
Junior Member
stevenlebeau began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Nov 2014
Device: Kindle Paperwhite
Okay, I figured it all out. I did archive the root directory and not just its contents. Once I fixed that, it worked like a charm.

So basically I replaced the word count with code that set the book text to lowercase, split it into a list, and then made a set of the list and counted the length of the set.

I am actually shocked at how many different words are even in the simplest of children's books! But I have a much better idea of where I'll be starting now.

Thanks to everyone for all their help!
stevenlebeau is offline   Reply With Quote
Old 11-18-2014, 01:30 PM   #699
crumba
Junior Member
crumba began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Nov 2014
Device: Kindle Paperwhite
how do you fix (No goodreads id)%s

getting it for 99% of my books. also getting false page numbers on the majority of my books using estimate.
crumba is offline   Reply With Quote
Old 11-24-2014, 08:06 PM   #700
93terp
Fear The Turtle!
93terp ought to be getting tired of karma fortunes by now.93terp ought to be getting tired of karma fortunes by now.93terp ought to be getting tired of karma fortunes by now.93terp ought to be getting tired of karma fortunes by now.93terp ought to be getting tired of karma fortunes by now.93terp ought to be getting tired of karma fortunes by now.93terp ought to be getting tired of karma fortunes by now.93terp ought to be getting tired of karma fortunes by now.93terp ought to be getting tired of karma fortunes by now.93terp ought to be getting tired of karma fortunes by now.93terp ought to be getting tired of karma fortunes by now.
 
93terp's Avatar
 
Posts: 866
Karma: 4035032
Join Date: Sep 2009
Location: Margaritaville
Device: KV, Kobo Forma, Kobo A1LE, KO3, K3
I'm having same issue as crumba in post #699. Any help to troubleshoot is appreciated.
93terp is offline   Reply With Quote
Old 11-26-2014, 05:33 AM   #701
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by crumba View Post
how do you fix (No goodreads id)%s

getting it for 99% of my books.
Is it wrong of me to think that "No goodreads id" tells you exactly what is wrong? The book needs to have a goodreads id in its metadata.
Quote:
also getting false page numbers on the majority of my books using estimate.
What are you comparing the page count to? You can't really compare this to a paper book as each edition would have a different page count. I use the ADE algorithm and it is a reasonably close.
davidfor is offline   Reply With Quote
Old 11-26-2014, 05:34 AM   #702
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by 93terp View Post
I'm having same issue as crumba in post #699. Any help to troubleshoot is appreciated.
crumba reported two problems. Which one are you seeing?
davidfor is offline   Reply With Quote
Old 12-24-2014, 10:30 PM   #703
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,931
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
I've found a bug. Count Pages treats words with an em dash between them as one word.

So word1—word2 is counted as one word. I'm betting it's that way for ... and en dash and so forth.

Can this be fixed? Thanks.
JSWolf is offline   Reply With Quote
Old 12-25-2014, 01:47 AM   #704
sophieturgeon
Trouble
sophieturgeon began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Dec 2014
Location: Quebec City
Device: Nook
Page count plugins

Hello, I'm new at this so please bear with me. I have installed the Count Pages plugins. I have created the custom columns. I have customized the preferences of the plugins so the columns have been selected.

Calibre is installed on the following path:
'K:\10 - Library' , which is an external hard drive.
My books are stored using the following path:
'K:\10 - Library\Calibre Library'

I run the plugins and it looks like it is working fine. I look up the Count log and I can see the appropriate and correct information. When running the plugins and clicking yes to update the columns, a '1' appears in each columns. In the count log the following information can be read (something tells me you might need to know that):
"InputFormatPlugin: EPUB Input running
on C:\Users\Turgeon\AppData\Local\Temp\calibre_onffru \a3vesk_count_pages\2759.epub
Found HTML cover titlepage.xhtml"

What am I doing wrong. Please keep in mind: I have absolutely no programming knowledge/understanding. I know just enough about computers to get myself in trouble. Your help would be greatly appreciated.

Last edited by sophieturgeon; 12-25-2014 at 01:55 AM. Reason: Additional Information
sophieturgeon is offline   Reply With Quote
Old 12-25-2014, 10:45 AM   #705
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: 29,791
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by sophieturgeon View Post
Hello, I'm new at this so please bear with me. I have installed the Count Pages plugins. I have created the custom columns. I have customized the preferences of the plugins so the columns have been selected.

Calibre is installed on the following path:
'K:\10 - Library' , which is an external hard drive.
My books are stored using the following path:
'K:\10 - Library\Calibre Library'

I run the plugins and it looks like it is working fine. I look up the Count log and I can see the appropriate and correct information. When running the plugins and clicking yes to update the columns, a '1' appears in each columns. In the count log the following information can be read (something tells me you might need to know that):
"InputFormatPlugin: EPUB Input running
on C:\Users\Turgeon\AppData\Local\Temp\calibre_onffru \a3vesk_count_pages\2759.epub
Found HTML cover titlepage.xhtml"

What am I doing wrong. Please keep in mind: I have absolutely no programming knowledge/understanding. I know just enough about computers to get myself in trouble. Your help would be greatly appreciated.
There should be one more line: Page Count: nnn.n
What page count Algorithm are you using?
theducks is offline   Reply With Quote
Reply

Tags
count, count pages, page count, pages, plugin


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Quality Check kiwidude Plugins 1184 04-17-2024 06:17 PM
[GUI Plugin] Open With kiwidude Plugins 403 04-01-2024 08:39 AM
[GUI Plugin] Quick Preferences kiwidude Plugins 62 03-16-2024 11:47 PM
[GUI Plugin] Kindle Collections (old) meme Plugins 2070 08-11-2014 12:02 AM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 04:29 AM.


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