PHP Classes

VowCon: Determine if words in a string are real or made up

Recommend this page to a friend!
  Info   View files Example   Screenshots Screenshots   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 357 All time: 6,929 This week: 148Up
Version License PHP version Categories
vowcon 1.2GNU Lesser Genera...4.2Algorithms, PHP 5, Text processing


This package can be used to determine if words in a string are real or made up.

It provides two classes to analise individual words or sentences to evaluate the presence of vowels and consonants.

The classes provide statistics about the string and a score that can be used to determine if the words really exist or are invented due to the presence of many consecutive consonants.

Innovation Award
PHP Programming Innovation award nominee
January 2014
Number 2

Prize: One copy of the Zend Studio
Sometimes it is necessary to determine if a word was written by a real person or is not a real a word.

This class provides a solution to evaluate the probability of a word or a phrase being real or made up.

It analyses the presence of vowels and consonants and returns a score that can be low if there are too many consecutive consonants.

Manuel Lemos
Picture of Roger Baklund
  Performance   Level  
Name: Roger Baklund is available for providing paid consulting. Contact Roger Baklund .
Classes: 7 packages by
Country: Norway Norway
Age: 57
All time rank: 18086 in Norway Norway
Week rank: 367 Up1 in Norway Norway Up
Innovation award
Innovation award
Nominee: 4x




"Testing VowConStats class:\n\n";

$words = array("sportsdrink","abc","bcd","aui","aaa","aaaa",
"recognition", "floccinauccinihilipilification",
$v = new VowConStats();
$words as $word) {
$s = $v->Stats($word);
sprintf("%-30s => %.2f %s\n",$word,round($s->score,2),
$s->score > 5.0 ? '!!':
$s->score > 3.5 ? '!':'')));

"\nTesting VowConAnalyzer class:\n\n";

$v = new VowConAnalyzer();

"For analyzing a collection of words. There are four properties\n".
"which can be used to configure the operation. The default values\n".
"are as follows:\n\n";
'MaxAvgScore: '.$v->MaxAvgScore."\n".
'MaxWordScore: '.$v->MaxWordScore."\n".
'MaxBadPercent: '.$v->MaxBadPercent."\n".
'BadWordLimit: '.$v->BadWordLimit."\n\n".

# load words, parameter can be array of words or a string
# which will be split using the Split() method

"Status for the test word collection:\n\n";

'$v->GetTextStatus() => '.$v->GetTextStatus()."\n";

'count($v->words) => '.count($v->words)."\n";
'$v->TextStats->MaxScore => '.$v->TextStats->MaxScore."\n";
'$v->TextStats->AvgScore => '.$v->TextStats->AvgScore."\n";
'$v->TextStats->BadPercent => '.$v->TextStats->BadPercent."\n";

"\nLooping over the collection:\n\n";
$v->words as $word) {
$s = $v->GetWordScore($word);
sprintf("%-30s => %.2f %s\n",$word,round($s,2),
$v->WordIsValid($word)? # using BadWordLimit
'OK':($s > $v->MaxWordScore ? 'Above max word score':'Above bad word limit'));




This package provides two classes which can be used for analyzing text with regards to patterns of vowels and consonants. In natural language, there is a certain balance between the two: there are rarely very many consecutive consonants or vowels in a real word.

Many spambots include a randomly generated word in their payload, these words will fail the tests provided by this package.

  • screenshot1.png
  • screenshot2.png
  Files folder image Files  
File Role Description
Files folder imagescreenshots (2 files)
Accessible without login Plain text file Data Auxiliary data
Plain text file ScandinavianVowConAnalyzer.class.php Class Adds scandinavian (norwegian/danish) vowels
Plain text file VowCon.php Class Defines VowConStats and VowConAnalyzer classes
Accessible without login Plain text file VowCon_test_1.php Example basic tests

  Files folder image Files  /  screenshots  
File Role Description
  Accessible without login Image file vowcon_test_1.png Icon Icon image
  Accessible without login Image file vowcon_test_2.png Icon Icon image

 Version Control Reuses Unique User Downloads Download Rankings  
This week:0
All time:6,929
This week:148Up