Jump to content

php capabilities


richardjh

Recommended Posts

Okay, maybe i should rephrase the question  ;)

 

would it be possible to create a php script which could analyze, say, a paragraph of text and return a list of things such as word frequency, common word / unusual word / overused words (maybe using a dictionary via mysql). sentence length and so forth? I know php has many string manipulation functions but I'm wondering how clever one could be using php to analyze long strings.

 

I think it would be possible to also create a php code snippet to analyze the pace of a block of text by getting it to count the sentences ( increment +1 at each full stop) and then by using a bit of math calculations work out if the block of text is fast or slow paced (maybe also using speech mark counts within the calculations). Anyone have a view on this?

 

many thanks thanks

R

Link to comment
https://forums.phpfreaks.com/topic/162635-php-capabilities/#findComment-858737
Share on other sites

Well I'm thinking of creating something to analyze blocks of text such as short stories and chapters of books. For pace I thought that by counting the sentences in a block of text AND by working out how many short, long or average sentences (including in the calculation things such as dialogue - text within quotes) and other factors, the script should arrive at a figure which could give a guide on pace within that block of text. For instance lots of short sentences with few long/average sentences would indicate pace which is far too fast; or a block with only very long sentences would be far too slow etc. Obviously the maths and calculations for such a script would be complicated and have to take in quite a few factors but that's the gist.

Link to comment
https://forums.phpfreaks.com/topic/162635-php-capabilities/#findComment-858763
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.