簡體   English   中英

致命錯誤:使用Wordnik API調用未定義的方法

[英]Fatal error: Call to undefined method with Wordnik API

不知道這是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()

任何幫助是極大的贊賞。 該錯誤發生在最底端的那條線上,只是不確定為什么。 謝謝。

getRandomWord()在Word Api(復數單詞)中定義。

  • 您具有:WordApi
  • 您需要:Word Api

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM