/** * Check whether a PoS Tag is relevant of not. A PoS Tag is considered * relevant when it is: * <ul> * <li>VERB</li> * <li>ADJECTIVE</li> * <li>ADVERB</li> * <li>NOUN</li> * </ul> * * @param pos * The Part of Speech of Type {@link POS} * @return whether a Part of Speech is relevant (true) or not (false) */ public static boolean isRelevantPOS(POS pos) { return pos.equals(POS.ADJECTIVE) || pos.equals(POS.ADVERB) || pos.equals(POS.NOUN) || pos.equals(POS.VERB); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Exc)) { return false; } Exc exc = (Exc) o; if (!exceptions.equals(exc.exceptions)) { return false; } if (!lemma.equals(exc.lemma)) { return false; } //noinspection RedundantIfStatement if (!pos.equals(exc.pos)) { return false; } return true; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Exc)) { return false; } Exc exc = (Exc) o; if (!exceptions.equals(exc.exceptions)) { return false; } if (!lemma.equals(exc.lemma)) { return false; } //noinspection RedundantIfStatement if (!pos.equals(exc.pos)) { return false; } return true; }
public String getDomain(Synset syn) { String off=Long.toString(syn.getOffset()); while(off.length()<8) { off="0"+off; } if(syn.getPOS().equals(POS.NOUN)) { off="1"+off; } if(syn.getPOS().equals(POS.VERB)) { off="2"+off; } if(syn.getPOS().equals(POS.ADJECTIVE)) { off="3"+off; } if(syn.getPOS().equals(POS.ADVERB)) { off="4"+off; } return map.get(off); }
/** * Returns true if the lemma and the part of speech both match. */ public boolean equals(Object object) { return (object instanceof IndexWord) && ((IndexWord) object).getLemma().equals(getLemma()) && ((IndexWord) object).getPOS().equals(getPOS()); }
/** * Returns true if the lemma and the part of speech both match. */ public boolean equals(Object object) { return (object instanceof IndexWord) && ((IndexWord) object).getLemma().equals(getLemma()) && ((IndexWord) object).getPOS().equals(getPOS()); }
public String getTargetWordTag() { String wordBaseForm = this.getLemmas()[this.getTargetPosition()]; String ref = ""; if ((WSDHelper.getPOS(this.getTargetTag()) != null)) { if (WSDHelper.getPOS(this.getTargetTag()).equals(POS.VERB)) { ref = wordBaseForm + ".v"; } else if (WSDHelper.getPOS(this.getTargetTag()).equals(POS.NOUN)) { ref = wordBaseForm + ".n"; } else if (WSDHelper.getPOS(this.getTargetTag()).equals(POS.ADJECTIVE)) { ref = wordBaseForm + ".a"; } else if (WSDHelper.getPOS(this.getTargetTag()).equals(POS.ADVERB)) { ref = wordBaseForm + ".r"; } } return ref; }
/** * Two Synsets are equal if their POS's and offsets are equal. */ public boolean equals(Object object) { return (object instanceof Synset) && ((Synset) object).getPOS().equals(getPOS()) && ((Synset) object).getOffset() == getOffset(); }
/** * Two Synsets are equal if their POS's and offsets are equal. */ public boolean equals(Object object) { return (object instanceof Synset) && ((Synset) object).getPOS().equals(getPOS()) && ((Synset) object).getOffset() == getOffset(); }
public boolean senseEquals(Object oword) { if (!(oword instanceof Word)) return false; if (oword == this) return true; Word iword = (Word) oword; if (iword.getLemma().equals(this.getLemma()) && WSDHelper.getPOS(iword.getPos()).equals( WSDHelper.getPOS(this.getPos())) && iword.getLexsn().equals(this.getLexsn())) { return true; } return false; }
public String getWordTag() { String wordBaseForm = this.getLemmas()[this.getWordIndex()]; String ref = ""; if ((WSDHelper.getPOS(this.getPosTags()[this.getWordIndex()]) != null)) { if (WSDHelper.getPOS(this.getPosTags()[this.getWordIndex()]) .equals(POS.VERB)) { ref = wordBaseForm + ".v"; } else if (WSDHelper.getPOS(this.getPosTags()[this.getWordIndex()]) .equals(POS.NOUN)) { ref = wordBaseForm + ".n"; } else if (WSDHelper.getPOS(this.getPosTags()[this.getWordIndex()]) .equals(POS.ADJECTIVE)) { ref = wordBaseForm + ".a"; } else if (WSDHelper.getPOS(this.getPosTags()[this.getWordIndex()]) .equals(POS.ADVERB)) { ref = wordBaseForm + ".r"; } } return ref; }
public boolean equals(Object oword) { if (!(oword instanceof Word)) return false; if (oword == this) return true; Word iword = (Word) oword; if (this.lemma != null && iword.getLemma() != null) { if (iword.getLemma().equals(this.getLemma()) && WSDHelper.getPOS(iword.getPos()).equals( WSDHelper.getPOS(this.getPos()))) { return true; } } else { if (this.word.equals(iword.getWord()) && WSDHelper.getPOSabbreviation(this.getPos()).equals( WSDHelper.getPOSabbreviation(iword.getPos()))) { return true; } } return false; }
if (!target.getPOS().equals(pointer.getTargetPOS()) || target.getIndex() != pointer.getTargetIndex() || target.getSynset().getOffset() != pointer.getTargetOffset()) {
if (!target.getPOS().equals(pointer.getTargetPOS()) || target.getIndex() != pointer.getTargetIndex() || target.getSynset().getOffset() != pointer.getTargetOffset()) {