W3C home > Mailing lists > Public > w3c-wai-ig@w3.org > April to June 2005

Re: Checking character count

From: Matthew Smith <matt@kbc.net.au>
Date: Thu, 09 Jun 2005 08:56:50 +0930
Message-ID: <42A77EBA.4010806@kbc.net.au>
To: w3c-wai-ig@w3.org

David Dorward wrote:

>>Does anyone know whether it is possible to check for the number of 
>>characters in a block of text?
> It is. How you do that rather depends on the programming language you
> are working in.
> Simple Perl example: 
>   perl -e "print scalar split '', 'The quick brown fox'";
And similarly, one can do an approximate word count by counting white space:

perl -e "print scalar split /\s/, 'The quick brown fox'";

I started writing a CGI programme to count words, mean word length, "Top
10" used words, etc.  The user just pastes text into a form.  I might be
persuaded to resurrect this and run it on one of my sites if anyone
thinks it would be worthwhile.  Saves having to have specific software
running on a machine.

On a similar subject - would anyone care to nominate any algorithms for
automatic (approximate) testing of readability, like Flesh-Kincaid, etc?



Matthew Smith
South Australia
Received on Wednesday, 8 June 2005 23:27:01 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 20:36:25 UTC