public IndexWord(Dictionary dictionary, String lemma, POS pos, Synset synset) throws JWNLException { this(dictionary, lemma, pos); if (null == synset) { if (null != dictionary) { throw new IllegalArgumentException(dictionary.getMessages().resolveMessage("DICTIONARY_EXCEPTION_042")); } else { throw new IllegalArgumentException("Synset must be not null"); } } if (synset.getPOS() != pos) { if (null != dictionary) { throw new IllegalArgumentException(dictionary.getMessages().resolveMessage("DICTIONARY_EXCEPTION_062")); } else { throw new IllegalArgumentException("Synset POS must be equal to index word POS"); } } this.synsets = new SynsetList(1); this.synsets.add(synset); }
public IndexWord(Dictionary dictionary, String lemma, POS pos, Synset synset) throws JWNLException { this(dictionary, lemma, pos); if (null == synset) { if (null != dictionary) { throw new IllegalArgumentException(dictionary.getMessages().resolveMessage("DICTIONARY_EXCEPTION_042")); } else { throw new IllegalArgumentException("Synset must be not null"); } } if (synset.getPOS() != pos) { if (null != dictionary) { throw new IllegalArgumentException(dictionary.getMessages().resolveMessage("DICTIONARY_EXCEPTION_062")); } else { throw new IllegalArgumentException("Synset POS must be equal to index word POS"); } } this.synsets = new SynsetList(1); this.synsets.add(synset); }
/** * Returns the senses of this word. * * @return all the senses of this word */ public List<Synset> getSenses() { if (null == synsets) { synsets = new SynsetList(); } return synsets; }
/** * Returns the senses of this word. * * @return all the senses of this word */ public List<Synset> getSenses() { if (null == synsets) { synsets = new SynsetList(); } return synsets; }