![]() |
#1 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 332
Karma: 2228060
Join Date: Dec 2013
Location: LaVernia, Texas
Device: kindle epub readers on android
|
word count in calibre editor
I am looking for a way to do a word count in an epub file in calibre's editor such that while editing I can reduce word count via some sort of temporary exclusion. I noticed that style="visibility:hidden" leaves vertical space but word count in that style is still counted. In style="display:hidden" vertical space disappears but but word count in that style is still counted. Is there any other convenient way to temporarily exclude text to reduce word count. I am editing to reduce total word count size of file to specification of maximum word count.
Best regards, Pop |
![]() |
![]() |
![]() |
#2 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 172
Karma: 1497966
Join Date: Jul 2021
Device: N/A
|
I suppose you are using the ctrl-n in a search/replace to count the occurrences of "word" in the current file or in the text ?
In that case, you could use a particular tag or class to mark the words you want to ignore. For exemple, with the tag <small>: Pass this regex with a Negative Lookbehind: (?<!<small>)marked-word on the text: this marked-word will be counted, but this <small>marked-word</small> won't Ctrl-n will give 1 Of course, you could use a <span class="ignored"> as well, with the convenient style in the css (a snippet can be used to insert it easily) |
![]() |
![]() |
![]() |
#3 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 172
Karma: 1497966
Join Date: Jul 2021
Device: N/A
|
Edit: Ah, I think I missed the point, you probably use the "count words" of the report tool.
In that case, the solution I would imagine is to write a specific regex-function creating a table of all words, copy of the one of the report tool, but excluding all tagged words as defined above. The regex will select all the text inside the <body>, and the regex-function will create a dict {'w1': n1, 'w2': n2, ...} for all the words found but not preceded by the defined tag. It is not a trivial function to write, but it's not too hard either. You could find this sort of idea in my function searching for the number of occurrences of each tag in an epub: https://www.mobileread.com/forums/sh...4&postcount=79 |
![]() |
![]() |
![]() |
#4 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 95
Karma: 118402
Join Date: Jul 2009
Device: Cybook Gen3
|
For me, the easiest way is to comment out the text with <!-- text -->
The comment text will not be counted. |
![]() |
![]() |
![]() |
#5 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,877
Karma: 30277270
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
|
![]() |
![]() |
![]() |
#6 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,161
Karma: 60406498
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
The report tool has a summary of the words used at the botto int the counts of individual words
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word Count in Calibre? | mmobes | Calibre | 11 | 12-16-2024 10:16 PM |
Add page count, word count and reading time | ZodWallop | Kobo Reader | 4 | 08-12-2024 05:56 AM |
Word Count and Page Count? | CrossReach | Library Management | 2 | 07-19-2018 05:44 PM |
Word count in calibre | C-novice | Library Management | 2 | 03-11-2018 10:57 PM |
Possible to get a word count in Calibre? | Notjohn | Calibre | 15 | 01-23-2016 06:20 PM |