public int hashCode() { return getSynset().hashCode() ^ getLemma().hashCode(); }
/** * Returns all the pointers of the synset that contains this word whose source is this word. */ public List<Pointer> getPointers() { List<Pointer> result = new ArrayList<>(0); for (Pointer pointer : getSynset().getPointers()) { if (this.equals(pointer.getSource())) { result.add(pointer); } } return result; }
public int hashCode() { return getSynset().hashCode() ^ getLemma().hashCode(); }
/** * Returns all the pointers of the synset that contains this word whose source is this word. */ public List<Pointer> getPointers() { List<Pointer> result = new ArrayList<>(0); for (Pointer pointer : getSynset().getPointers()) { if (this.equals(pointer.getSource())) { result.add(pointer); } } return result; }
@Override public String transform(Pointer p) { Synset source; PointerTarget pt = p.getSource(); if (pt instanceof Word) { source = ((Word) pt).getSynset(); } else { source = (Synset) pt; } try { return synsetToString.transform(source) + " -> " + synsetToString.transform(p.getTargetSynset()); } catch (JWNLException e) { throw new IllegalArgumentException(e); } } }
public String toString() { return ResourceBundleSet.insertParams("[Word: {0} [Lemma: {1}] {2} [Index: {3}]]", new Object[]{getPOS(), getLemma(), getSynset(), getIndex()}); }
public String toString() { return ResourceBundleSet.insertParams("[Word: {0} [Lemma: {1}] {2} [Index: {3}]]", new Object[]{getPOS(), getLemma(), getSynset(), getIndex()}); }
private static int getSenseNo(final Word word) throws JWNLException { final IndexWord iw = word.getDictionary().getIndexWord(word.getPOS(), word.getLemma()); for (int i = 0; i < iw.getSenses().size(); i++) { if (iw.getSenses().get(i).getOffset() == word.getSynset().getOffset()) { return i; } } return -1; }
private static int getSenseNo(final Word word) throws JWNLException { final IndexWord iw = word.getDictionary().getIndexWord(word.getPOS(), word.getLemma()); for (int i = 0; i < iw.getSenses().size(); i++) { if (iw.getSenses().get(i).getOffset() == word.getSynset().getOffset()) { return i; } } return -1; }
@Override public UnorderedPair<String> transform(Pointer p) { Synset source; PointerTarget pt = p.getSource(); if (pt instanceof Word) { source = ((Word) pt).getSynset(); } else { source = (Synset) pt; } try { return new UnorderedPair<String>( synsetToString.transform(source), synsetToString.transform(p.getTargetSynset())); } catch (JWNLException e) { throw new IllegalArgumentException(e); } } }
public CachedSense(String senseId) throws SenseInventoryException { super(senseId); try { word = wn.getWordBySenseKey(senseId); synset = word.getSynset(); pos = wordNetPosToSiPos.transform(word.getPOS()); useCount = word.getUseCount(); } catch (JWNLException e) { throw new SenseInventoryException(e); } }
/** * Given a WordNet sense key, returns the corresponding synset offset + POS * * @param senseKey * @return * @throws SenseInventoryException */ public String senseKeyToSynsetOffsetAndPos(String senseKey) throws SenseInventoryException { try { Word w = wn.getWordBySenseKey(senseKey); if (w == null) { throw new SenseInventoryException("Sense key " + senseKey + " not found"); } return synsetToString.transform(w.getSynset()); } catch (JWNLException e) { throw new SenseInventoryException(e); } }
/** * Ctor with an {@link Word} and a dictionary * This Ctor is quicker than the other. * @param jwiDictionary * @throws WordNetException */ ExtJwnlSensedWord(Word wordObj, ExtJwnlDictionary extJwnlDictionary) throws WordNetException { if (wordObj==null) throw new WordNetException("wordObj is null!"); this.wordObj = wordObj; this.synset = new ExtJwnlSynset(extJwnlDictionary, wordObj.getSynset()); this.word = wordObj.getLemma(); this.dictionary = extJwnlDictionary; this.pos = ExtJwnlUtils.getWordNetPartOfSpeech( wordObj.getPOS()); }
if(lePOS.equals(EPartOfSpeech.verb)){ String[] frames = lexeme.getSynset().getVerbFrames(); for(String frame : frames){ Map<String, Word> codeLexeme = new TreeMap<String, Word>();