wamania/php-stemmer

How to try the basic example in the Usage instructions

kavasaari opened this issue · 2 comments

Hi, sorry for the very basic issue, but I couldn't make it work.

I used composer (latest version of your stemmer) in a PHP8 environment.

Composer downloaded a 21 Mb vendor directory with autoload.php inside:
I uploaded all the vendor directory with its contents and put outside a PHP file with:

require 'vendor/autoload.php';

Then I tried to execute the basic example you provided in the front page usage section but I got a class not found error.

Is there something else I should add to the autoload? Should I directly require classes? How?

Thanks and happy new year to everybody reading.

You should prefix the Class with Wamania\Snowball\.

$stemmer = Wamania\Snowball\StemmerFactory::create ('finnish');

or introduce it with use:

use Wamania\Snowball\StemmerFactory;

I'll edit the example to fix this.

Ok, thank you, this way it works :-)