Word Count: Difference between revisions
→Websites: add a counter |
→Websites: added "ype or paste in your text; " |
||
(17 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
Here are a number of useful tools to help both readers and book coordinators get accurate word counts. |
|||
LibriVox member ''peegee'' has written a script for web browsers which may make the BC's job of compiling word counts for the Magic Window a little easier. |
|||
== |
== Websites == |
||
Below are various websites that provide an interface to count the number of words in copy-pasted text. No word limits to what you can paste in, but partial word count of highlighted portions of text is either not available, or requires scrolling to find. All identify the top 10 keywords in the text, check spelling, and to accomodate writers, give a character count useful for typing responses in Twitter, Facebook, etc. |
|||
The script runs against the HTML ebooks on [http://www.gutenberg.org/wiki/Main_Page Project Gutenberg]. |
|||
# you click the paragraph where you want to start the count, |
|||
# it asks you the target number of words, |
|||
# it quickly goes through every paragraph from that point onwards and counts the words and the running total |
|||
# it stops when it reaches the target, or the end of the chapter if before |
|||
# the page is temporarily changed to display the word counts right there at the end of each paragraph |
|||
# you can repeat this as many times as you like, each time you click a paragraph the temporary page changes are removed |
|||
* [https://chrome.google.com/webstore/detail/word-counter-plus/] Word Counter Plus, extension installs in Edge, Chrome, Brave and other browsers upon Get. Counts words and characters in highlighted segment, in a hover over window. |
|||
== Screenshots == |
|||
* [https://wordcounter.net/ wordcounter.net] counts highlighted segments, but word count is displayed at bottom. |
|||
Here are a few screenshots to illustrate the process: |
|||
* [https://wordcounter.io/ wordcounter.io] type or paste in your text; highlighted portions not counted |
|||
* [https://thewordcounter.com/ thewordcounter.com] type or paste in your text; highlighted portions not counted |
|||
* [https://easywordcount.com/ easywordcount.com] type or paste in your text; highlighted portions not counted |
|||
* [https://wordstotime.com/ wordstotime.com] gives an estimated reading time (depending on your speaking speed -- slow, medium, fast) as well as word count. |
|||
== Document Editors == |
|||
<gallery> |
|||
Image:Wordcount1.png|The first prompt |
|||
Image:Wordcount2.png|Choose target number |
|||
Image:Wordcount3.png|The count displayed |
|||
</gallery> |
|||
Most document editors (Microsoft Word, Google Docs, LibreOffice, etc) and some basic text editors have a built-in word counting feature. Copy and paste your text into a document, select the text you want to count. |
|||
== Installing the Script == |
|||
The method of installation depends on the browser (Firefox and Chrome may need to be re-started after installation, Opera does not): |
|||
* Microsoft Word |
|||
=== Firefox === |
|||
** '''Review → Word Count''' |
|||
# [https://addons.mozilla.org/en-US/firefox/addon/748 Greasemonkey] You will first need the GreaseMonkey add-on for Firefox which is available from this link. |
|||
** MS Word will also automatically display the word count on the bottom status bar, unless this feature has been disabled. To re-enable it, right-click on the bottom status bar and tick the Word Count option. Just highlight the words you want counted, either part or all of the text. Wait a moment and the word count will display (lower left corner) This is a powerful program, great for dividing up whole books into sections, visually dividing long chapters into approximately equal segments, etc. Video tutorial to be added soon. |
|||
# [http://userscripts-mirror.org/scripts/show/69969 Firefox Install] Once you have GreaseMonkey installed, go here and click on the '''Install''' button |
|||
* LibreOffice Writer |
|||
** '''Tools → Word Count''' |
|||
** A running word count is displayed on the bottom status bar. The status bar cannot be modified but the entire bar may be toggled hidden or displayed by selecting '''View → Status Bar''' |
|||
* Google Docs |
|||
** '''Tools → Word count''' |
|||
** Keyboard shortcut: '''Ctrl + Shift + C''' |
|||
== Web Browser Bookmarklets == |
|||
=== Google Chrome === |
|||
#[https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en TamperMonkey] First you'll need to install TamperMonkey from the Chrome store. |
|||
#[http://userscripts-mirror.org/scripts/show/70234 WordCount] Then, you'll be able to install the word count extension from here. |
|||
These bookmarklets can be used with most modern web browsers. The code for these scripts can be found by following the links below, or you can find them as Tampermonkey/Greasemonkey scripts on [https://greasyfork.org GreasyFork.org]. |
|||
=== Opera === |
|||
# To enable User JavaScript, use Tools > Preferences > Advanced > Content > JavaScript options, and select the directory where you will put your User JavaScript files (probably best if its a new folder with nothing else in it). |
|||
# [http://userscripts-mirror.org/scripts/show/70234 the script] then go to the script |
|||
# click the Install button to get the script in a new tab in Opera. |
|||
# from the Opera menu click ''File > Save As'' to save it into the folder you chose in the first step (probably best to just keep the suggested file-name - whatever name you choose it MUST end in .user.js ) |
|||
=== Gutencount (word counter) === |
|||
== Limitations == |
|||
The script only works on the Gutenberg online HTML books, not the ''text'' or ''zipped HTML'', or other formats. |
|||
<u>Get the script here</u>: [https://vox.quartertone.net/#gc Gutencount on vox.quartertone.net].<br/> |
|||
== Support == |
|||
Also available as a [https://www.tampermonkey.net Tampermonkey]/Greasemonkey script, which can be found here: [https://greasyfork.org/en/scripts/463785-gutencount Gutencount on GreasyFork.org]<br/> |
|||
If you have any problems installing or using this script you can either post a message in [http://forum.librivox.org/viewtopic.php?t=24437 this forum thread] or send a Private Message to ''peegee''. |
|||
(The Tampermonkey version will not activate on non-Gutenberg sites) |
|||
Here are some [https://www.youtube.com/playlist?list=PLWMFM-KiRM4MXGQsT0nArfrxTZKuUDlgG tutorial videos] on how to use this script. |
|||
== Other Alternatives == |
|||
This is a "universal" word counter bookmarklet. With a single click, you can get an accurate word count for the body of a Gutenberg book. |
|||
=== Web Browser Bookmarklets === |
|||
* If you select some text, it will count the words in the selection. |
|||
==== Gutencount (word counter) ==== |
|||
* On a normal webpage, it will count all the text on the page |
|||
This is a "universal" word counter bookmarklet. The code below will, with a single click, return the word count for the body of a Gutenberg book. |
|||
* In a Guterberg ebook page it will count the ebook text, excluding the Gutenberg disclaimer and legalese. |
|||
:This will work whether you are on the main page, the HTML page (or as-submitted), or on the plain text page. |
|||
:* Slight discrepancies may be present due to extra text (Transcriber's notes, Book summary, subtitles, etc) in some formats that are not present in the others. |
|||
* '''''BONUS''''': On the Gutenberg search results page, it will append the word count to all search results! (So, if you're looking for a short short story, you don't have to go counting every book that comes up in search.) |
* '''''BONUS''''': On the Gutenberg search results page, it will append the word count to all search results! (So, if you're looking for a short short story, you don't have to go counting every book that comes up in search.) |
||
* BONUS: On a normal webpage, it will count all the text on the page. |
|||
* BONUS: If any text is highlighted, it will count the words in the selection. |
|||
* '''NEW(2023-04-14)''': When in the HTML page of on ebook, click on the chapter heading to get a word count for that chapter. |
|||
* Update(2023-04-11): Word/character count will now be displayed in a fixed box in the upper right corner of the window, instead of a pop-up alert. Double click to dismiss. |
* Update(2023-04-11): Word/character count will now be displayed in a fixed box in the upper right corner of the window, instead of a pop-up alert. Double click to dismiss. |
||
* '''NEW(2023-04-14)''': When in the HTML page of an ebook, click on the chapter heading to get a word count for that chapter. |
|||
=== Chapter Counter (beta) === |
|||
<nowiki>javascript:(function(){let a=![];function b(g,h,i=''){return c(g['match'](/(?<=\*{3} START.*?\*{3}).*(?=\*{3} END.*?\*{3})/s)[0x0]['trim'](),h,i);}function c(g,h,i=''){let j=g['trim']()['split'](/--|[\s\*—]+/)['length'];if(i)return j;f(j+'\x20words,\x20'+g['length']+'\x20chars\x0ain\x20'+h);}function d(g,h){fetch(g)['then'](i=>i['text']())['then'](i=>{let j=b(i,'ebook',h);h&&(h['innerHTML']+='wc:'+j);})['catch'](i=>{});}function e(){let g=document['location']['toString'](),h=window['getSelection']()+'';if(h['length']>0x0)c(h,'selection');else{if(g['match'](/gutenberg.org\/(files|cache\/epub)\/\d+/))b(document['body']['innerText'],'ebook');else{if(g['match'](/gutenberg.org\/ebooks\/(\d+)/))d(g+'.txt.utf-8',document['querySelector']('#cover'));else{if(g['match'](/gutenberg.org\/ebooks\/(subject|search)/))for(const i of document['querySelectorAll']('.booklink>a>span:nth-child(2)')){d(i['parentElement']['href']+'.txt.utf-8',i);}else!a&&c(document['body']['innerText'],'webpage');}}}}e();function f(g){let h=document['getElementById']('xcount')||document['createElement']('div');h['id']='xcount',h['style']='position:fixed;top:0;right:0;width:10em;height:2em;background:#333c;color:#fff;z-index:10000;padding:0.5em;text-align:right;',h['innerHTML']='',h['ondblclick']=function(){this['remove']();},document['body']['appendChild'](h),h['innerHTML']=g;}document['onclick']=function(g){let h=document['getSelection']();if(h){let i,j;try{i=h['anchorNode']['parentNode']['tagName']['match'](/^H\d/),j=h['anchorNode']['parentNode']['parentNode']['tagName']['match'](/^H\d/);}catch(k){}if(i||j){let l=document['createRange'](),m=j?h['anchorNode']['parentNode']['parentNode']:h['anchorNode']['parentNode'],n=j?h['anchorNode']['parentNode']['parentNode']['nextElementSibling']:h['anchorNode']['parentNode']['nextElementSibling'];while(n['nextElementSibling']){if(n['nextElementSibling']&&n['nextElementSibling']['tagName']['match'](/^(H\d|SECTION)/))break;n=n['nextElementSibling'];}l['setStartAfter'](m),l['setEndAfter'](n),h['addRange'](l);}}e();};}());</nowiki> |
|||
<u>Get the script here</u>: [https://vox.quartertone.net/#cc ChapterCounter on vox.quartertone.net]. |
|||
==== Chapter Counter (beta) ==== |
|||
This script |
This script counts the number of words in indexed chapters of a Gutenberg book. Navigate to the HTML or the plain text page, and activate the script. |
||
Navigate to the HTML or the plain text page, and activate the script. |
|||
Current Limitations: |
Current Limitations: |
||
Line 69: | Line 59: | ||
* Does not work if chapter headings do not match the TOC (eg, TOC lists ''Chapter IV'', but chapter headings appear as ''IV''). |
* Does not work if chapter headings do not match the TOC (eg, TOC lists ''Chapter IV'', but chapter headings appear as ''IV''). |
||
* Does not work if the TOC is formatted strangely (eg page numbers or other text interspersed between the chapter titles). |
* Does not work if the TOC is formatted strangely (eg page numbers or other text interspersed between the chapter titles). |
||
* Update 2023-04-14: Corrected the word count method so "em dashes" are accurately accounted for. |
|||
For questions or issues with either of the above scripts, please post in [https://forum.librivox.org/viewtopic.php?t=96792 this forum thread], or send a Private Message to [https://forum.librivox.org/ucp.php?i=pm&mode=compose&u=141665 ''quartertone'']. |
|||
<nowiki>javascript:(function(){if(document['location']['toString']()['match'](/gutenberg.org\/(files|cache\/epub)\/\d+/)){let d=document['body']['innerText']['match'](/(?<=\*{3} ?START.*?\*{3}).*(?=\*{3} ?END.*?\*{3})/s)[0x0]['trim']()['split'](/\n+/),e=document['getSelection']()['toString'](),f=e?e:'contents',g=[],h='',i='',j={};for(var a of d){a=a['trim']();if(!a||a['length']==0x0)continue;if(!h&&a['match'](RegExp('^'+f,'i'))){h='INDEX';continue;}else{if(h=='INDEX')g['length']>0x0&&c(g[0x0],a)?(h='BODY',i=g[0x0],j[i]=''):g['push'](a);else{if(h=='BODY'){if(g[g['indexOf'](i)+0x1]!==undefined&&c(a,g[g['indexOf'](i)+0x1])){i=g[g['indexOf'](i)+0x1],j[i]='';continue;}j[i]+=a+'\x20';}}}}var b=document['getElementById']('xcount')||document['createElement']('div');b['id']='xcount',b['style']='position:fixed;top:0;right:0;width:20em;height:20em;overflow-y:scroll;background:#333c;color:#fff;',b['innerHTML']='',b['ondblclick']=function(){this['remove']();},document['body']['appendChild'](b);for(const k in j){b['innerHTML']+=k+':\x20'+j[k]['split'](/--|[\s\*—]+/)['length']+'\x20words<br/><br/>';}}function c(l,m){if(!l||!m)return![];if(l['toUpperCase']()['replace'](/\W/g,'')==m['toUpperCase']()['replace'](/\W/g,''))return!![];if(l['match'](/^chapter.+\./i)&&l['toLowerCase']()['match'](/^chapter.+\./)[0x0]==m['toLowerCase']()['match'](/^chapter.+\./)[0x0])return!![];return![];}}());</nowiki> |
|||
=== Google Chrome Counter === |
|||
The link to the extension in the Google Chrome store: |
|||
For questions or issues with either of the above scripts, please post in [https://forum.librivox.org/viewtopic.php?t=96792 this forum thread], or send a Private Message to [https://forum.librivox.org/ucp.php?i=pm&mode=compose&u=141665 ''quartertone'']. |
|||
https://chrome.google.com/webstore/detail/word-counter-plus/fpjegfbcdijjfkceenlfoehpcakfgldj |
|||
Click "Add to Chrome". Once installed (you may need to restart your browser after adding it), highlight the text you want the word count for and right-click. There should be a Word Counter Plus option in the right click menu. Once selected, it will display the word count for the selected text. |
|||
Note: The scripts above have been ''minified''. To view the scripts in a human-readable format, please visit [https://vox.quartertone.net vox.quartertone.net]. |
|||
== Gutenberg Progressive word counter == |
|||
=== Websites === |
|||
Various websites provide an interface to count the number of words in copy-pasted text. Below are some sites that provide accurate word counts: |
|||
This script is adapted from PeeGee's Gutenberg word counting script. The original version of the script was no longer functioning, so this de-bugged version was created. Information about the previous version of this script can be found archived at: [[PeeGee's Script]]. |
|||
=== How it Works === |
|||
* [https://awordcounter.com/ awordcounter.com] |
|||
The script runs against the HTML ebooks on [http://www.gutenberg.org/wiki/Main_Page Project Gutenberg]. |
|||
* [https://wordcounter.net/ wordcounter.net] |
|||
# you click the paragraph where you want to start the count, |
|||
* [https://wordcounter.io/ wordcounter.io] |
|||
# it asks you the target number of words, |
|||
* [https://thewordcounter.com/ thewordcounter.com] |
|||
# it quickly goes through every paragraph from that point onwards and counts the words and the running total |
|||
* [https://easywordcount.com/ easywordcount.com] |
|||
# it stops when it reaches the target, or the end of the chapter if before |
|||
* [http://www.awordcounter.com/ wordcounter.com] (no limit to length) |
|||
# the page is temporarily changed to display the word counts right there at the end of each paragraph |
|||
# you can repeat this as many times as you like, each time you click a paragraph the temporary page changes are removed |
|||
=== |
=== Screenshots === |
||
Here are a few screenshots to illustrate the process: |
|||
<gallery> |
|||
Most document editors (Microsoft Word, Google Docs, LibreOffice, etc) and some basic text editors have a built-in word counting feature. Copy and paste your text into a document, select the text you want to count. |
|||
Image:Wordcount1.png|The first prompt |
|||
Image:Wordcount2.png|Choose target number |
|||
Image:Wordcount3.png|The count displayed |
|||
</gallery> |
|||
=== Installing the Script === |
|||
* Microsoft Word |
|||
** '''Review → Word Count''' |
|||
* This script requires the TamperMonkey browser extension which is available for most modern browsers. |
|||
** MS Word will also automatically display the word count on the bottom status bar, unless this feature has been disabled. To re-enable it, right-click on the bottom status bar and tick the Word Count option. Just highlight the words you want counted, either part or all of the text. Wait a moment and the word count will display (lower left corner) |
|||
** [https://www.tampermonkey.net Get TamperMonkey] for your browser. |
|||
* LibreOffice Writer |
|||
* Instructions for installing the extension can be found in the GutenCount tutorial playlist above. |
|||
** '''Tools → Word Count''' |
|||
** YouTube: [https://youtu.be/XeBnn6ma-5Y Installing Tampermonkey/Gutencount]. |
|||
** A running word count is displayed on the bottom status bar. The status bar cannot be modified but the entire bar may be toggled hidden or displayed by selecting '''View → Status Bar''' |
|||
* Once Tampermonkey is installed, go to the Greasyfork page for the script: |
|||
* Google Docs |
|||
** Install [https://greasyfork.org/en/scripts/464790 Gutenberg Progressive Word Count]. |
|||
** '''Tools → Word count''' |
|||
** Install the script by clicking the green button that says "Install this script". |
|||
** Keyboard shortcut: '''Ctrl + Shift + C''' |
|||
=== Limitations === |
|||
The script only works on the Gutenberg online HTML books, not the ''text'' or ''zipped HTML'', or other formats. |
|||
=== Support === |
|||
If you have any problems installing or using this script you can either post a message in [https://forum.librivox.org/viewtopic.php?t=96792 this forum thread], or send a Private Message to [https://forum.librivox.org/ucp.php?i=pm&mode=compose&u=141665 ''quartertone'']. |
Latest revision as of 18:11, 11 July 2023
Here are a number of useful tools to help both readers and book coordinators get accurate word counts.
Websites
Below are various websites that provide an interface to count the number of words in copy-pasted text. No word limits to what you can paste in, but partial word count of highlighted portions of text is either not available, or requires scrolling to find. All identify the top 10 keywords in the text, check spelling, and to accomodate writers, give a character count useful for typing responses in Twitter, Facebook, etc.
- [1] Word Counter Plus, extension installs in Edge, Chrome, Brave and other browsers upon Get. Counts words and characters in highlighted segment, in a hover over window.
- wordcounter.net counts highlighted segments, but word count is displayed at bottom.
- wordcounter.io type or paste in your text; highlighted portions not counted
- thewordcounter.com type or paste in your text; highlighted portions not counted
- easywordcount.com type or paste in your text; highlighted portions not counted
- wordstotime.com gives an estimated reading time (depending on your speaking speed -- slow, medium, fast) as well as word count.
Document Editors
Most document editors (Microsoft Word, Google Docs, LibreOffice, etc) and some basic text editors have a built-in word counting feature. Copy and paste your text into a document, select the text you want to count.
- Microsoft Word
- Review → Word Count
- MS Word will also automatically display the word count on the bottom status bar, unless this feature has been disabled. To re-enable it, right-click on the bottom status bar and tick the Word Count option. Just highlight the words you want counted, either part or all of the text. Wait a moment and the word count will display (lower left corner) This is a powerful program, great for dividing up whole books into sections, visually dividing long chapters into approximately equal segments, etc. Video tutorial to be added soon.
- LibreOffice Writer
- Tools → Word Count
- A running word count is displayed on the bottom status bar. The status bar cannot be modified but the entire bar may be toggled hidden or displayed by selecting View → Status Bar
- Google Docs
- Tools → Word count
- Keyboard shortcut: Ctrl + Shift + C
Web Browser Bookmarklets
These bookmarklets can be used with most modern web browsers. The code for these scripts can be found by following the links below, or you can find them as Tampermonkey/Greasemonkey scripts on GreasyFork.org.
Gutencount (word counter)
Get the script here: Gutencount on vox.quartertone.net.
Also available as a Tampermonkey/Greasemonkey script, which can be found here: Gutencount on GreasyFork.org
(The Tampermonkey version will not activate on non-Gutenberg sites)
Here are some tutorial videos on how to use this script.
This is a "universal" word counter bookmarklet. With a single click, you can get an accurate word count for the body of a Gutenberg book.
- If you select some text, it will count the words in the selection.
- On a normal webpage, it will count all the text on the page
- In a Guterberg ebook page it will count the ebook text, excluding the Gutenberg disclaimer and legalese.
- This will work whether you are on the main page, the HTML page (or as-submitted), or on the plain text page.
- Slight discrepancies may be present due to extra text (Transcriber's notes, Book summary, subtitles, etc) in some formats that are not present in the others.
- BONUS: On the Gutenberg search results page, it will append the word count to all search results! (So, if you're looking for a short short story, you don't have to go counting every book that comes up in search.)
- Update(2023-04-11): Word/character count will now be displayed in a fixed box in the upper right corner of the window, instead of a pop-up alert. Double click to dismiss.
- NEW(2023-04-14): When in the HTML page of an ebook, click on the chapter heading to get a word count for that chapter.
Chapter Counter (beta)
Get the script here: ChapterCounter on vox.quartertone.net.
This script counts the number of words in indexed chapters of a Gutenberg book. Navigate to the HTML or the plain text page, and activate the script.
Current Limitations:
- The Table of contents (TOC) must be present, and labeled Contents.
- TOC should not include any sections that appear before the contents list (eg, Preface).
- Does not work if chapter headings do not match the TOC (eg, TOC lists Chapter IV, but chapter headings appear as IV).
- Does not work if the TOC is formatted strangely (eg page numbers or other text interspersed between the chapter titles).
For questions or issues with either of the above scripts, please post in this forum thread, or send a Private Message to quartertone.
Google Chrome Counter
The link to the extension in the Google Chrome store: https://chrome.google.com/webstore/detail/word-counter-plus/fpjegfbcdijjfkceenlfoehpcakfgldj
Click "Add to Chrome". Once installed (you may need to restart your browser after adding it), highlight the text you want the word count for and right-click. There should be a Word Counter Plus option in the right click menu. Once selected, it will display the word count for the selected text.
Gutenberg Progressive word counter
This script is adapted from PeeGee's Gutenberg word counting script. The original version of the script was no longer functioning, so this de-bugged version was created. Information about the previous version of this script can be found archived at: PeeGee's Script.
How it Works
The script runs against the HTML ebooks on Project Gutenberg.
- you click the paragraph where you want to start the count,
- it asks you the target number of words,
- it quickly goes through every paragraph from that point onwards and counts the words and the running total
- it stops when it reaches the target, or the end of the chapter if before
- the page is temporarily changed to display the word counts right there at the end of each paragraph
- you can repeat this as many times as you like, each time you click a paragraph the temporary page changes are removed
Screenshots
Here are a few screenshots to illustrate the process:
-
The first prompt
-
Choose target number
-
The count displayed
Installing the Script
- This script requires the TamperMonkey browser extension which is available for most modern browsers.
- Get TamperMonkey for your browser.
- Instructions for installing the extension can be found in the GutenCount tutorial playlist above.
- YouTube: Installing Tampermonkey/Gutencount.
- Once Tampermonkey is installed, go to the Greasyfork page for the script:
- Install Gutenberg Progressive Word Count.
- Install the script by clicking the green button that says "Install this script".
Limitations
The script only works on the Gutenberg online HTML books, not the text or zipped HTML, or other formats.
Support
If you have any problems installing or using this script you can either post a message in this forum thread, or send a Private Message to quartertone.