Page 1 of 1

help needed to assign score to words

Posted: Sat Dec 18, 2010 12:51 am
by Rahul Dev
Hello guys, i need some help in assigning a score to a word according to its occurrence in a group of sentences.

<?php
$words="Hello how are you";
$word_array = explode(" ", $words);

$paragraph="Hello! I am fine. How about you? You look good.";
$sencetences = strtok($paragraph, ".!?");
?>

now i'm trying to assign a score to each word in $words e.g Hello=1, how=1, are=0, you=2.

Re: help needed to assign score to words

Posted: Sat Dec 18, 2010 4:19 am
by VladSun
You have series of related posts here... I'm wondering what are you trying to do?
It seems to me that you want to implement the FULL TEXT search functionality in PHP.
Read this first :

http://dev.mysql.com/doc/refman/5.5/en/ ... earch.html
http://devzone.zend.com/article/1304

Notice the http://dev.mysql.com/doc/refman/5.5/en/ ... words.html - most of your posts here are related to the problem solved there.