public static WNPath getWN(ArrayList<IPointer> ptrs1, ArrayList<IPointer> ptrs2, ISynset synset, String w1, String w2) { WNPath wn = new WNPath(); wn.ptrs1 = ptrs1; wn.ptrs2 = ptrs2; wn.synset = synset; wn.w1 = w1; wn.w2 = w2; wn.length = ptrs1.size() + ptrs2.size(); wn.pos = synset.getPOS(); return wn; }
public static WNPath getWN(ArrayList<IPointer> ptrs1, ArrayList<IPointer> ptrs2, ISynset synset, String w1, String w2) { WNPath wn = new WNPath(); wn.ptrs1 = ptrs1; wn.ptrs2 = ptrs2; wn.synset = synset; wn.w1 = w1; wn.w2 = w2; wn.length = ptrs1.size()+ptrs2.size(); wn.pos=synset.getPOS(); return wn; }
public static void addPath( ArrayList<IPointer> pters1, ArrayList<IPointer> pters2, ISynset synset, String w1, String w2) { WNPath wn = new WNPath(); wn.ptrs1=pters1; wn.ptrs2=pters2; wn.synset=synset; wn.w1=w1; wn.w2=w2; wn.pos=synset.getPOS(); paths.add(wn); }
public static void addPath(ArrayList<IPointer> pters1, ArrayList<IPointer> pters2, ISynset synset, String w1, String w2) { WNPath wn = new WNPath(); wn.ptrs1 = pters1; wn.ptrs2 = pters2; wn.synset = synset; wn.w1 = w1; wn.w2 = w2; wn.pos = synset.getPOS(); paths.add(wn); }
public WordNetPartOfSpeech getPartOfSpeech() { return JwiUtils.getWordNetPartOfSpeech(this.realSynset.getPOS()); }
/** * Constructs a new sense key. * * @param lemma * the lemma for the sense key * @param lexID * the lexical id of the sense key * @param synset * the synset for the sense key * @throws NullPointerException * if either the lemma or synset is <code>null</code> * @since JWI 2.1.0 */ public SenseKey(String lemma, int lexID, ISynset synset){ this(lemma, lexID, synset.getPOS(), synset.isAdjectiveSatellite(), synset.getLexicalFile()); }
public static String printableName(IWord word, boolean bUseLexFileName) { ISynset syn = word.getSynset(); StringBuilder sb = new StringBuilder(); sb.append(word.getLemma()); sb.append(NAME_PART_SEP); sb.append(syn.getPOS().getTag()); sb.append(NAME_PART_SEP); // This is the sense number or name if (bUseLexFileName) sb.append(syn.getLexicalFile().getName().toLowerCase()); else sb.append(syn.getLexicalFile().getNumber()); sb.append(NAME_PART_SEP); sb.append(word.getLexicalID()); String res = sb.toString(); return res.replaceAll("[_]", NAME_PART_SEP); }
throw new NullPointerException(); checkLexicalID(lexID); if(synset.getPOS() != POS.ADJECTIVE && adjMarker != null) throw new IllegalArgumentException();
public long getUsageOf(String word) throws WordNetException { IIndexWord idxWord = jwiDictionary.getJwiRealDictionary().getIndexWord(word, this.realSynset.getPOS()); return idxWord.getTagSenseCount(); }
POS pos = iSynsets[0].getPOS(); if (pos.equals(POS.NOUN) || pos.equals(POS.VERB)) // only nouns and verbs have hypernyms
/** * 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; }