help needed to assign score to words
Posted: Sat Dec 18, 2010 12:51 am
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.
<?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.