所以我只是想知道,麗塔wordnet中的每一個字都包含其在getDescription()中的定義,或者只是在getGloss()?
getDescription()返回定義; getGloss()返回定義加一個例句(gloss?)。
看起來像getGloss()是RiTa中getDescription()的超集。
以下是這些方法在rita.RiWordNet.java
的實現:
/**
* Returns full gloss for 1st sense of 'word' with 'pos'
*/
public String getGloss(String word, String pos)
{
Synset synset = getSynsetAtIndex(word, pos, 1);
return getGloss(synset);
}
/**
* Returns description for <code>word</code> with <code>pos</code> or null if
* not found
*/
public String getDescription(String word, String pos)
{
String gloss = getGloss(word, pos);
return WordnetUtil.parseDescription(gloss);
}
如何從麗塔共發現檢索詞?
不確定要檢索哪種字詞。如果你在談論單詞定義,我相信你可以通過getAllGlosses()和getAllSynsets()來實現。你甚至可以寫一個getAllDescription()來處理。
或檢查RiTa圖書館here的參考資料以尋找您所需的方法。