-2

Possible Duplicate:
Is there any way to detect strings like putjbtghguhjjjanika?
php check if the string is real

I want to make a php function that handle a text string and path it to a special algorithm to detect if this text is meaningful or not, and rate the text from 0 to 100% readability score.

For example:

"skjg askjf akdjf akdjf " will take about 30%. "Hello guys" 90%. "ahdkjshdkjshdkljshdlksjdh" 10% or less.

I hope that make sense.

Community
  • 1
  • 1
Mohammed Tawfik
  • 571
  • 1
  • 8
  • 21
  • I'd use a dictionary file and check how many of the words are in the dictionary. With this 1 and 3 should get 0%, 2 should get 100%. – deceze Oct 17 '11 at 03:08
  • This is the sort of stuff that big players are throwing lots of money at. We can't really tell you, sorry. –  Oct 17 '11 at 03:09
  • 3
    Please don't ask essentially the same question over and over again. – Jared Farrish Oct 17 '11 at 03:09
  • OKAY THANK YOU FOR YOUR RESPONSES BUT I THOUGHT THAT SITE WILL HELP ME DISCUSSING AND SOLVING MY PROBLEM. BTW, I WILL TRY AND I WILL GET IT, BUT i will put it here or there for free of charge @bdares. ANY WAY THANKS ALOT........ – Mohammed Tawfik Oct 17 '11 at 03:48

1 Answers1

2

Here is something to check out: https://github.com/DaveChild/Text-Statistics

This project describes itself as:

The PHP Text Statistics class will help you to indentify issues with your website content, especially with readability. It allows you to measure the readability of text using common scoring systems, including:

  • Flesch Kincaid Reading Ease
  • Flesch Kincaid Grade Level
  • Gunning Fog Score
  • Coleman Liau Index
  • SMOG Index
  • Automated Reability Index

The code that generates the statistics is in a simple class structure. There are also several unit test classes to ensure that changes made don't break existing functionality. There is also a live version of this tool.

ghbarratt
  • 11,496
  • 4
  • 41
  • 41