@Override public String toString() { if (id.getWordNumber() == 0) { return "W-" + id.getSynsetID().toString().substring(4) + "-?-" + id.getLemma(); } else { return "W-" + id.getSynsetID().toString().substring(4) + "-" + id.getWordNumber() + "-" + id.getLemma(); } }
public IWord getWord(IWordID id) { if(data != null){ ISynset synset = data.synsets.get(id.getPOS()).get(id.getSynsetID()); return (synset == null) ? null : synset.getWord(id.getWordNumber()); } else { return backing.getWord(id); } }
public IWord getWord(IWordID id) { checkOpen(); ISynset synset = getSynset(id.getSynsetID()); if(synset == null) return null; // One or the other of the WordID number or lemma may not exist, // depending on whence the word id came, so we have to check // them before trying. if (id.getWordNumber() > 0) { return synset.getWords().get(id.getWordNumber() - 1); } else if (id.getLemma() != null) { for(IWord word : synset.getWords()) { if (word.getLemma().equalsIgnoreCase(id.getLemma())) return word; } return null; } else { throw new IllegalArgumentException("Not enough information in IWordID instance to retrieve word."); } }
for(IWordID otherID : entry.getValue()){ otherSynset = synsets.get(otherID.getPOS()).get(otherID.getSynsetID()); newList.add(otherSynset.getWord(otherID.getWordNumber()).getID());