Skip to content

I use your examples but it does not work #20

@marn65

Description

@marn65

hi.I was looking for a text mining code in python and I saw this awesome php code.
I installed package in ubuntu 16.04.3:
sudo apt-get install libpspell-dev php7.0-pspell aspell-en php7.0-enchant
then I used composer install. after it finished I went to test folder:

gn@me ~/c/p/tests> php TestBaseCase.php 
PHP Fatal error:  Class 'PHPUnit_Framework_TestCase' not found in /home/gn/code/php-text-analysis/tests/TestBaseCase.php on line 13

also I used tokenizer as bellow:

<?php
use TextAnalysis\Tokenizers\GeneralTokenizer;


        $tokenizer = new GeneralTokenizer();
        $text1 = $tokenizer->tokenize('hi, how are you');
        $text2 = $tokenizer->tokenize('hello, thank you')  ;

and it returned:

gn@me ~/c/p/tests> php similarity.php 
PHP Fatal error:  Uncaught Error: Class 'TextAnalysis\Tokenizers\GeneralTokenizer' not found in /home/gn/code/php-text-analysis/tests/similarity.php:6
Stack trace:
#0 {main}
  thrown in /home/gn/code/php-text-analysis/tests/similarity.php on line 6

also, I went to src folder and created a similarity.php file:

<?php

        require_once 'Tokenizers/GeneralTokenizer.php'; 
        $tokenizer = new \Tokenizers\GeneralTokenizer();
        $text1 = $tokenizer->tokenize('hi, how are you');
        $text2 = $tokenizer->tokenize('hello, thank you')  ;

and it gaves me this error:
PHP Fatal error: Class 'TextAnalysis\Tokenizers\TokenizerAbstract' not found in /home/gn/code/php-text-analysis/src/Tokenizers/GeneralTokenizer.php on line 11

what is my wrong steps and how can I use code correctly?
thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions