WordNet access using php
I tried to access the wordnet dictionary as mentioned in: Calling wordnet from php (Wordnet class or API for PHP). It worked fine through command line. Then I tried to use the php function shell_exec() as below to access the dictionary:
<?php
$output=shell_exec("\Program Files (x86)\WordNet\2.1\bin\wn");
echo $output;
?>
This displays the search option like -ant, -hyp, and so on.i.e it worked fine
But when I tried to add the search option in the above command(as below) it did not work:
<?php
$output=shell_exec("\Program Files (x86)\WordNet\2.1\bin\wn star -synsn");
echo $output;
?>
or even when I gave space in the command like:
$output=shell_exec("\Program Files (x86)\WordNet\2.1\bin\wn ")
it did not work.
Can you please help me what may be the reason for thi开发者_JAVA技巧s and any suggestion for the solution?
ok i got the solution now.the problem was because of the spaces between the command.So i handled them as below:
$cmd = '"C:/Program Files (x86)/WordNet/2.1/bin/wn" "home" "-synsn"';
$output=shell_exec($cmd);
thanks to all who responded to my query
精彩评论