00:00
00:00
Newgrounds Background Image Theme

LOCKdev just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Word frequency counter

1,958 Views | 11 Replies
New Topic Respond to this Topic

When doing SEO work for your site or when writing an article to promote your site,
analyzing the word frequency is very important.

Here is a link for a good word frequency counter: Word frequency counter

Response to Word frequency counter 2015-11-19 02:11:44 (edited 2015-11-19 02:12:32)


At 11/16/15 09:16 AM, gamestoenjoy wrote: When doing SEO work for your site or when writing an article to promote your site,
analyzing the word frequency is very important.

Here is a link for a good word frequency counter: Word frequency counter

Or you could just open a terminal and literally type one line:

tr ' ' '\n' | sort | uniq -c

Why do you post these sites that have nothing to do with programming in the programming forum?

Response to Word frequency counter 2015-11-19 08:21:56 (edited 2015-11-19 08:22:44)


At 11/19/15 02:11 AM, DJ-Ri wrote:
At 11/16/15 09:16 AM, gamestoenjoy wrote: When doing SEO work for your site or when writing an article to promote your site,
analyzing the word frequency is very important.

Here is a link for a good word frequency counter: Word frequency counter
Or you could just open a terminal and literally type one line:

tr ' ' '\n' | sort | uniq -c

Your example is useless, words can be separated by many other characters not only space and newline, so you will need a much more complicated regular expression here.

Response to Word frequency counter 2015-11-20 00:19:11 (edited 2015-11-20 00:33:48)


At 11/19/15 08:21 AM, gamestoenjoy wrote: Your example is useless, words can be separated by many other characters not only space and newline, so you will need a much more complicated regular expression here.

Not really. Just add a little bit of sed.

sed 's/[].,;!+?#|:\/[(){}$%&*-]/ /g' | tr ' ' '\n' | sort | uniq -c

Does the exact same thing that site does, only with 1 line instead of 58. That expression is also a lot less complicated than the one in the javascript function on that page.

Example usage:

$ cat test
The quick brown fox jumps over the lazy dog.
This file contains a series of words, some of which are separated by various special characters.
For]example,This;line!has+all?sorts#of|characters.
In:fact,so/does\this[one.
And{this}one$too!
The&command*line-is
a beautiful thing.
$ cat test | sed 's/[].,;!+?#|:\/[(){}$%&*-]/ /g' | tr ' ' '\n' | sort | uniq -c
      7
      2 a
      1 all
      1 And
      1 are
      1 beautiful
      1 brown
      1 by
      2 characters
      1 command
      1 contains
      1 does
      1 dog
      1 example
      1 fact
      1 file
      1 For
      1 fox
      1 has
      1 In
      1 is
      1 jumps
      1 lazy
      2 line
      3 of
      2 one
      1 over
      1 quick
      1 separated
      1 series
      1 so
      1 some
      1 sorts
      1 special
      1 the
      2 The
      1 thing
      2 this
      2 This
      1 too
      1 various
      1 which
      1 words

It even counts the newlines for you. And if you want it to ignore case, you can simply add a 'tr [A-Z] [a-z]' to the pipeline.

I still don't understand what that page has to do with programming, btw.

Response to Word frequency counter 2016-01-04 06:13:17


At 11/19/15 02:11 AM, DJ-Ri wrote: Why do you post these sites that have nothing to do with programming in the programming forum?

I suspect he's learning programming in his spare time and wants to share what he makes.

It seems he doesn't feel they are worth the effort if other people aren't at least pretending to find them useful.

I simply critique and move on.

My advice to OP is just keep these snippets to yourself and share when you have something original or if you're having trouble getting something to work. Would save you a lot of time.


∀x (∃e (e ∈ x ∧ ∀x ¬(x ∈ e)) ∨ ∃y ¬∃e (e ∈ x ∧ ¬∃z (z ∈ y ∧ z ∈ e ∧ ∀x ¬((x ∈ y ∧ x ∈ e) ∧ ¬(x = z)))))

Response to Word frequency counter 2016-01-17 09:42:42


At 1/4/16 06:13 AM, sharpnova wrote:
At 11/19/15 02:11 AM, DJ-Ri wrote: Why do you post these sites that have nothing to do with programming in the programming forum?
I suspect he's learning programming in his spare time and wants to share what he makes.

Indeed, but I do think that at least some of the members here can learn something useful from this, not all of us are experts in JS.

Response to Word frequency counter 2016-01-17 14:38:13


Indeed, but I do think that at least some of the members here can learn something useful from this, not all of us are experts in JS.

You should include your source code then. Maybe embed it in the page so people can see it while playing with the tool

Then later on you could add some notes and turn all the tools into some kind of tutorial


∀x (∃e (e ∈ x ∧ ∀x ¬(x ∈ e)) ∨ ∃y ¬∃e (e ∈ x ∧ ¬∃z (z ∈ y ∧ z ∈ e ∧ ∀x ¬((x ∈ y ∧ x ∈ e) ∧ ¬(x = z)))))

Response to Word frequency counter 2016-01-17 17:19:59


At 1/17/16 02:38 PM, sharpnova wrote:
Indeed, but I do think that at least some of the members here can learn something useful from this, not all of us are experts in JS.
You should include your source code then. Maybe embed it in the page so people can see it while playing with the tool

Then later on you could add some notes and turn all the tools into some kind of tutorial

I thought it will be easy to view the source code of the conversion, but preparing a tutorial with the source code seems like a great idea :)

Response to Word frequency counter 2016-01-18 22:43:58 (edited 2016-01-18 22:45:56)


At 1/17/16 09:42 AM, gamestoenjoy wrote:
At 1/4/16 06:13 AM, sharpnova wrote:
At 11/19/15 02:11 AM, DJ-Ri wrote: Why do you post these sites that have nothing to do with programming in the programming forum?
I suspect he's learning programming in his spare time and wants to share what he makes.
Indeed, but I do think that at least some of the members here can learn something useful from this, not all of us are experts in JS.

I think it is fine to show off your work, but since this is a programming-oriented forum, I would suggest keeping it on topic by at least including your actual code/discussing how the sites work rather than just posting them. Simply posting links to sites you've made without any programming-related information/discussion is something that would be more appropriate in the General forum or even a post on your user page.

Response to Word frequency counter 2017-07-17 04:43:46


In case someone discovers this article and is about to follow this advice: Just don't.
Don't over-analyze and over-optimize your text. Just keep it real and natural and you'll be fine.


Word Game Enthusiast | Words with Friends Gosu | Scrabble Sympathizer

BBS Signature

Response to Word frequency counter 2017-11-06 09:48:08


At 7/17/17 04:43 AM, Derryck1 wrote: In case someone discovers this article and is about to follow this advice: Just don't.
Don't over-analyze and over-optimize your text. Just keep it real and natural and you'll be fine.

What are you talking about? Your post doesn't even seem relevant to this thread at all.


∀x (∃e (e ∈ x ∧ ∀x ¬(x ∈ e)) ∨ ∃y ¬∃e (e ∈ x ∧ ¬∃z (z ∈ y ∧ z ∈ e ∧ ∀x ¬((x ∈ y ∧ x ∈ e) ∧ ¬(x = z)))))

Response to Word frequency counter 2017-12-02 02:49:58


At 11/6/17 09:48 AM, sharpnova wrote:
At 7/17/17 04:43 AM, Derryck1 wrote: In case someone discovers this article and is about to follow this advice: Just don't.
Don't over-analyze and over-optimize your text. Just keep it real and natural and you'll be fine.
What are you talking about? Your post doesn't even seem relevant to this thread at all.

I was just saying that the word frequency isn't important for SEO anymore. It's about having natural texts with a good reading flow, not about keyword density and stuff like that.


Word Game Enthusiast | Words with Friends Gosu | Scrabble Sympathizer

BBS Signature