By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,664 Members | 1,656 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,664 IT Pros & Developers. It's quick & easy.

Porters Stemming Algorithm

P: n/a
I dug out a PHP version of Porters Algorithm from
:-http://www.tartarus.org/~martin/PorterStemmer/php.txt

Whenever I try and run it I'm getting the error
"Wrong parameter count for join() "

Can anyone guess what I am doing wrong, I haven't modified the class
so I assume its the way I'm calling it.

Richard
************* code to call class *********************
<?php
require("stemming.inc");

$string="compuTing";
$string=strtolower($string);
echo $string;
$stm=new stemming();
$stm->reset();
for($i=0;$i<strlen($string);$i++)
$stm->add(substr($string,$i,1));

$stm->stem(0);
$stem = $stm->toString(); //stem of the string
echo $stem;
?>
****************** end code***************************
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 22 Jun 2004 09:11:11 -0700, ra******@yahoo.co.uk (Richard Hyett) wrote:
I dug out a PHP version of Porters Algorithm from
:-http://www.tartarus.org/~martin/PorterStemmer/php.txt

Whenever I try and run it I'm getting the error
"Wrong parameter count for join() "

Can anyone guess what I am doing wrong, I haven't modified the class
so I assume its the way I'm calling it.


What version of PHP are you running? The URL you posted contains a
single-parameter usage of join; join's second parameter is only optional from
PHP 4.3.0 onwards. See the PHP manual.

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space
Jul 17 '05 #2

P: n/a

"Andy Hassall" <an**@andyh.co.uk> wrote in message
news:qj********************************@4ax.com...
On 22 Jun 2004 09:11:11 -0700, ra******@yahoo.co.uk (Richard Hyett) wrote:
I dug out a PHP version of Porters Algorithm from
:-http://www.tartarus.org/~martin/PorterStemmer/php.txt

Whenever I try and run it I'm getting the error
"Wrong parameter count for join() "

Can anyone guess what I am doing wrong, I haven't modified the class
so I assume its the way I'm calling it.
What version of PHP are you running? The URL you posted contains a
single-parameter usage of join; join's second parameter is only optional

from PHP 4.3.0 onwards. See the PHP manual.


Thanks Andy, that helped me sort it out. I stuck in the 'glue' parameter ""
rather than upgraded the PHP, the quickest option!

Richard
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.