Github Octocat

Read all about it

WordsCounted is customisable Ruby natural language processor. This site is a demo for the gem's functionality. Take a look at the repo for full documentation.

The source code for this site is available on Github.

Try it



Exclude words less than five characters long.

WordsCounted.count(post, exclude: ->(word) { word.length > 5 })


Exclude common words.

WordsCounted.count(post, exclude: %w[a the to I in of])

Custom regexp

Include numbers and exclude some common words.

WordsCounted.count(post, regexp: /[\p{Alnum}\-']+/, exclude: "a the to in")

Using lambdas and arrays is not supported in this demo. Take a look at the documentation for more options.

How to use this demo

Customise the program output using the regexp and exclude options.

woman with instructions


This option lets you pass custom criteria to split the string. For example, use it include numbers or exclude diacritics.


Use this option to exclude anything from the stats. For example, if you want to exclude the and a, pass them as a space delimited string.

Besides a string, exclude accepts an array, lambda, or a regexp. Note that lambdas and arrays are disabled in this demo.