0

これが Wordnik API の問題なのか、単に私の側の php エラーなのかはわかりません。これが私の現在のコードです:

require('./wordnik/Swagger.php');
require('./wordnik/WordsApi.php');

$myAPIKey = '00144cdc1140c4192780f08c3f608399234240dcb560d3e4b';
$client = new APIClient($myAPIKey, 'http://api.wordnik.com/v4');

$wordApi = new WordApi($client);
$input = new WordObject();
$input->includePartOfSpeech='noun';
$input->excludePartOfSpeech='affix,article,connjunction,preposition,abbreviation,suffix';
$input->hasDictionaryDef='true';
$input->minCorpusCount='10000';
$input->maxCorpusCount='null';
$input->minDictionaryCount='20';
$input->maxDictionaryCount=null;
$input->minLength='4';
$input->maxLength='20';

$random_word = $wordApi->getRandomWord($input); //THIS IS THE ERROR LINE
print $random_word->text;

ここに私が得るエラーがあります: 致命的なエラー: 未定義のメソッドへの呼び出し WordApi::getRandomWord()

どんな助けでも大歓迎です。その行の一番下に向かってエラーが発生していますが、理由はわかりません。ありがとうございました。

4

1 に答える 1

0

getRandomWord()Word s Api (複数語)で定義されています。

  • あなたが持っている: WordApi
  • 必要なもの: Word s Api
于 2014-11-19T17:04:31.437 に答える