I modified http://fivefilters.org/term-extraction/ this project to:
This input (https://gist.github.com/4426264) of the python script term-extraction.py text outputs keywords in json format and sends the term-extraction.py → echo.php file through POST json to php
link to term-extraction.py https://gist.github.com/4426181 link to echo.php https://gist.github.com/4426193
here is the json output specified by the php script: https://gist.github.com/4426197 here is the expression term -extraction.py: http://jsfiddle.net/Bw7UX/
here is the desired output of the array that I would like to pass to php: https://gist.github.com/4426208
So my problem is that:
Array ( [json] => None )
I would like the php array to have the meaning of all keywords from a python script, like this link: https://gist.github.com/4426208
array(42) { [0]=> string(10) "rajaratnam" [1]=> string(5) "court" [2]=> string(14) "district court" ... [41]=> string(6) "appeal" }
I think my problem could be with line 69 to 78 term-extraction.py and in particular with this line:
mydata=[('json', self.response.out.write(json.dumps(list, indent=0)))]
Thanks for your answers, I am very new to python, so I appreciate patience.
edit: This is the result when the script is run. I don't understand why json is outputting a python script from them, but it is not in the PHP array correctly. `START echo.php
Null
json echo: POPS: NO POPS array () END echo.php
Status: 200 OK Cache-Control: no-cache Content-Type: text / plain Expires: Fri, Jan 01, 1990 00:00:00 GMT Content-Length: 533 {"json": ["rajaratnam", "court", "district court", "sec", "court documents", "securities fraud", "court documents", "group of galleons", "exchange commission", "sakti prasad", "us", "case", " judgment "," group "," securities "," gupta "," district "," sakti "," right "," co "," founder "," fines "," raj "," consulting "," days "," manager "," conspiracy "," year "," years "," prasad "," inc "," network "," lawsuit "," editing "," against "," sax "," galleon ", “commission”, “reuters”, “documents”, “advice”, “appeal”]} `