473,408 Members | 1,761 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Porters Stemming Algorithm

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
2 2173
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

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jack Smith | last post by:
Hello, any help appreciated with following problem. I figured out the algorithm (I think), just having trouble proving it is optimal. Suppose we are given n tasks each of which takes 1 unit...
16
by: cody | last post by:
I have to write an algorithm with must ensure that objects are put in buckets (which are always 4 in size). The objects have two properties: A and B. It is not allowed that in a bucket are objects...
10
by: bpontius | last post by:
The GES Algorithm A Surprisingly Simple Algorithm for Parallel Pattern Matching "Partially because the best algorithms presented in the literature are difficult to understand and to implement,...
32
by: Cmorriskuerten | last post by:
HI, is this is this solution to test if a number is a prime number or not: /* * Is n a prime number? * Return TRUE (1): n is a prime number * Return FALSE (0): n is a *not* a prime number...
113
by: Bonj | last post by:
I was in need of an encryption algorithm to the following requirements: 1) Must be capable of encrypting strings to a byte array, and decyrpting back again to the same string 2) Must have the same...
4
by: FBM | last post by:
Hi, I am working on a program that simulates one of the elements of ATM. The simulation stores events which occurs every some milliseconds for a certain amount of time. Every time that an event...
2
by: Julio C. Hernandez Castro | last post by:
Dear all, We have just developped a new block cipher called Raiden, following a Feistel Network structure by means of genetic programming. Our intention now consists on getting as much feedback...
0
by: aruna | last post by:
hey guys i earlier had very valuable responses from you all for base64 encoding algorithm.so thank for that. so now i need your assistance to do a float encoding algorithm. you may wonder why i'm...
1
by: almurph | last post by:
Hi everyone, Concerning the Needleman-Wunsch algorithm (cf. http://en.wikipedia.org/wiki/Needleman-Wunsch_algorithm) I have noticed a possible loop. Inside the algorithm there is an...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.