* @throws WordNetException An error occurred retrieving data.
*/
protected synchronized WordSense[] getReferences(
RelationshipType type, String wordForm) throws WordNetException
{
Synset synset;
String[] wordForms;
wordForm = TextTranslator.translateToExternalFormat(wordForm);
// Get relationship we already resolved
WordSense[] senses = references.getLexicalRelationships(wordForm, type);
// If we haven't resolved them, do it now
if (senses == null)
{
// Get the lexical relationship pointers
WordSensePointer[] sensePtrs = pointers.getLexicalRelationships(
wordForm, type);
// Create a new array for the relationships
senses = new WordSense[sensePtrs.length];
SynsetFactory factory = SynsetFactory.getInstance();
// Loop through the pointers and resolve each one
for (int i = 0; i < senses.length; i++)
{
// Get (and possibly create) the synset
synset = factory.getSynset(sensePtrs[i]);
// Now get the word form in the target synset
wordForms = synset.getWordForms();
senses[i] = new WordSense(
wordForms[sensePtrs[i].getWordNumber() - 1], synset);
}
references.putLexicalRelationships(
wordForm, type, senses);