Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

empty array #2

Open
lijoabraham-zz opened this issue May 9, 2016 · 3 comments
Open

empty array #2

lijoabraham-zz opened this issue May 9, 2016 · 3 comments

Comments

@lijoabraham-zz
Copy link

After doing all these ,I am still getting null result. Am I missing anything?

Code :-
require('class_Stanford_POS_Tagger.php');
$pos = new Stanford_POS_Tagger('../PHP-Stanford-NLP-master/data/stanford-postagger-2015-12-09');
print_r($pos->array_tag("The cow jumped over the moon and the dish ran away with the spoon."));

@slokuta
Copy link

slokuta commented Oct 19, 2016

I'm having the same issue. Did you ever find a solution?

Thank you.

@MinsungHong
Copy link

Finally, I found a solution. My OS is windows 10.
And I use the jar file of version 3.3.1 (released at 2014-01-04) from http://nlp.stanford.edu/software/tagger.shtml.
(I tried new version, but it's not work. So i recommend version 3.3.1)

I just changed the line 71 from $tmp_path = '/tmp' to $tmp_path = './temp' in class_Stanford_POS_Tagger.php file.
And then make a new folder in my work folder which contains test.php, class_Stanford_POS_Tagger.php, Stanford jar file and so on (i.e., i use same folder for all files).
The new folder's name is temp. This new tem_path is relative path (i.e., it is path of my folder, not tmp folder of windows).

And it is working now :)
My guess is that the problem related with permission of windows.

And then, my test source is following as:
require('class_Stanford_POS_Tagger.php');
$pos = new Stanford_POS_Tagger();
var_dump($pos->array_tag("The cow jumped over the moon and."));

Thank you for Charles Hays.

@MinsungHong
Copy link

And If you want to use your php file in different folder of class_Stanford_POS_Tagger php file.
You have to input this code $this->set_tmp_path($path); at __construct function in class_Stanford_POS_Tagger php file after setting the path.

And then, test source is following as:
require('NLP_stanford/class_Stanford_POS_Tagger.php');
$pos = new Stanford_POS_Tagger(DIR.'/NLP_stanford');
var_dump($pos->array_tag("The cow jumped over the moon and."));

I hope it help for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants