Wait a minute, do you mean this blog post is just about counting words in a document? First, it is easy enough, and second, this can be done by any word processor on the fly.
You are right in that it is about counting words. However, the aim of this blog post is to show how flexible Ruby can be in meeting our desires on counting what we determine are considered words. This is in opposition to the word processors we use, which likely will not be able to determine such criteria.
Let me clarify this point a bit further. When a word processor is counting words, it takes the white space as a delimiter. As a result, what comes after that will be considered a new word and included in the word count.
What if you have a number, a standalone letter, email address, etc.? Do you consider those words? I don't. Word processors will not give you the option to filter the counted words.
Continue reading %Counting Real Words with Ruby%
by A. Hasan via SitePoint
No comments:
Post a Comment