public static String fixOffset(int offset, POS tag) { String foff = Integer.toString(offset); while(foff.length() < 8) foff = "0"+foff; if(tag.equals(POS.ADJECTIVE)) foff += "-a"; else foff += "-"+tag.getTag(); return foff; }
private boolean match(ISynset left, ArrayList<ISynset> synsets2) { for (ISynset is : synsets2) { if (is.equals(left) && is.getPOS().equals(left.getPOS())) return true; } return false; }
private boolean match(ISynset left, ArrayList<ISynset> synsets2) { for (ISynset is : synsets2) { // System.out.println(left+" "+is); if (is.equals(left) && is.getPOS().equals(left.getPOS())) return true; } return false; }
private boolean match(ISynset left, ArrayList<ISynset> synsets2) { for(ISynset is: synsets2) { //System.out.println(left+" "+is); if(is.equals(left) && is.getPOS().equals(left.getPOS())) return true; } return false; }
private boolean match(ISynset left, ArrayList<ISynset> synsets2) { for (ISynset is : synsets2) { if (is.equals(left) && is.getPOS().equals(left.getPOS())) return true; } return false; }
private boolean match(ISynset left, ISynset left2) { return left.equals(left2) && left.getPOS().equals(left2.getPOS()); }
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if(!(obj instanceof IExceptionEntryID)) return false; final IExceptionEntryID other = (IExceptionEntryID) obj; if (!surfaceForm.equals(other.getSurfaceForm())) return false; if (!pos.equals(other.getPOS())) return false; return true; }
private boolean match(ISynset left, ISynset left2) { return left.equals(left2) && left.getPOS().equals(left2.getPOS()); }
public boolean equals(Object obj) { if(this == obj) return true; if(obj == null) return false; if(!(obj instanceof IIndexWordID)) return false; final IIndexWordID other = (IIndexWordID) obj; if(!lemma.equals(other.getLemma())) return false; if(!pos.equals(other.getPOS())) return false; return true; }
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof ISynsetID)) return false; final ISynsetID other = (ISynsetID) obj; if (offset != other.getOffset()) return false; if (!pos.equals(other.getPOS())) return false; return true; }
/** * Get all the cousin synsets of the given iSynsets, according to the loose definition, by which a cousin of a synset to the n-th degree is any synset that * shares a hypernym, reachable by a hypernym path of length n (and possibly by other shorter and/or longer paths as well). Also, a cousin of a set of synsets * is a cousin of AT LEAST one of the synsets in the set. * * @param iSynsets * @param degree * @return */ Set<String> getLooseCousinsForRealSynset(ISynset[] iSynsets, int degree) { Set<String> cousinLemmas = new HashSet<String>(); if (iSynsets != null && iSynsets.length > 0) { POS pos = iSynsets[0].getPOS(); if (pos.equals(POS.NOUN) || pos.equals(POS.VERB)) // only nouns and verbs have hypernyms { Set<ISynsetID> remoteCousinSynsetIDs = computeRemoteCousinSynsetIDs(iSynsets, degree); // collect the lemmas cousinLemmas = getWordsOfSynsetIDs(remoteCousinSynsetIDs); // screen out the original synset's lemmas Set<String> originalSynsetLemmas = getWordsOfSynsets(iSynsets); cousinLemmas.removeAll(originalSynsetLemmas); } } return cousinLemmas; }
ArrayList<ISynset> synsets2 = wrap.getAllSynset(w2, p2); if (p1 != null && p2 != null && !p1.equals(p2)) return 0.; min2 = 100; if (pos.equals(POS.NOUN)) continue; for (ISynset is : synsets1) { if (!pos.equals(is.getPOS())) continue; double d = getLCS(is); if (d < min1) min1 = d; if (!pos.equals(is.getPOS())) continue;
public ArrayList<IWord> getIWords(String st, POS pos_) { List<String> stems = getStemsList(st, pos_); ArrayList<IWord> iwds = new ArrayList<IWord>(); for(String s: stems){ //System.out.println(s); for (POS pos : POS.values()) { if(pos_!=null && !pos.equals(pos_)) continue; IIndexWord idxWord = dict.getIndexWord(s, pos); //System.out.println(idxWord); if(idxWord==null) continue; List<IWordID> senses = idxWord.getWordIDs(); // 1 st meaning for(IWordID iw : senses) { //System.out.println(iw); iwds.add(dict.getWord(iw)); } } } return iwds; }
public ArrayList<IWord> getIWords(String st, POS pos_) { List<String> stems = getStemsList(st, pos_); ArrayList<IWord> iwds = new ArrayList<IWord>(); for (String s : stems) { // System.out.println(s); for (POS pos : POS.values()) { if (pos_ != null && !pos.equals(pos_)) continue; IIndexWord idxWord = dict.getIndexWord(s, pos); // System.out.println(idxWord); if (idxWord == null) continue; List<IWordID> senses = idxWord.getWordIDs(); // 1 st meaning for (IWordID iw : senses) { // System.out.println(iw); iwds.add(dict.getWord(iw)); } } } return iwds; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final ILexFile other = (ILexFile) obj; if (desc == null) { if(other.getDescription() != null) return false; } else if (!desc.equals(other.getDescription())) return false; if (name == null) { if (other.getName() != null) return false; } else if (!name.equals(other.getName())) return false; if (num != other.getNumber()) return false; if (pos == null) { if (other.getPOS() != null) return false; } else if (!pos.equals(other.getPOS())) return false; return true; }
if(pos_ !=null && !pos.equals(pos_)) continue;
if (pos_ != null && !pos.equals(pos_)) continue;