I'm the beginner NLP programmer in PHP. I just want to discuss about the stop word removal.
this is my practice:
I have the following declaration of a variable $words = "he's the young man";
and then I remove the common words like this
$common_words = $this->common_words();
$ncwords = preg_replace('/\b('.implode('|',$common_words).')\b/','',$data);
// I have save the array common_words in another function
and I explode my no common words
$a_ncwords=explode(" ", $ncwords);
But, when I print $a_ncwords
, like so print_r($a_ncwords);
I get a result like this:
Array ( [0] => [1] => [2] => young [3] => man )
why are the index[0]
and index[1]
array values null?