Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old Yesterday, 09:20 AM   #1
rjwse@aol.com
Addict
rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.
 
rjwse@aol.com's Avatar
 
Posts: 333
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
rjwse@aol.com is offline   Reply With Quote
Old Yesterday, 01:44 PM   #2
lomkiri
Groupie
lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.
 
lomkiri's Avatar
 
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)
lomkiri is offline   Reply With Quote
Old Yesterday, 02:37 PM   #3
lomkiri
Groupie
lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.
 
lomkiri's Avatar
 
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
lomkiri is offline   Reply With Quote
Old Yesterday, 04:13 PM   #4
readx
Connoisseur
readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.
 
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.
readx is offline   Reply With Quote
Old Yesterday, 06:15 PM   #5
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: 21,878
Karma: 30277270
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by rjwse@aol.com View Post
. . .
I am editing to reduce total word count size of file to specification of maximum word count.
Curious: Why?

On what basis would words be excluded? Word classification maybe - i.e. articles, conjunctions, interjections, articles, prepositions etc.

BR
BetterRed is online now   Reply With Quote
Old Yesterday, 08:28 PM   #6
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: 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
theducks is offline   Reply With Quote
Old Today, 07:08 AM   #7
rjwse@aol.com
Addict
rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.
 
rjwse@aol.com's Avatar
 
Posts: 333
Karma: 2228060
Join Date: Dec 2013
Location: LaVernia, Texas
Device: kindle epub readers on android
Quote:
For me, the easiest way is to comment out the text with <!-- text -->
The comment text will not be counted.
That is the solution I was looking for! Thank you.
Quote:
Curious: Why?
For example, you have 23,000 words and the maximum is 20,000 words; you've gotta cut 3000 but it's still gotta flow, still make sense, can't leave anything essential out.
rjwse@aol.com is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 06:17 PM.


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