/** * Get a list of possible stems. Assume we are looking up a noun. */ public static List<String> getStems(String word, String posTag, IDictionary iDictionary) { POS pos = POS.getPartOfSpeech(posTag.charAt(0)); if(pos == null) { return new ArrayList<String>(); } WordnetStemmer wordnetStemmer = new WordnetStemmer(iDictionary); List<String> stems = wordnetStemmer.findStems(word, pos); return stems; }
/** * Get a list of possible stems. Assume we are looking up a noun. */ public static List<String> getStems(String word, String posTag, IDictionary iDictionary) { POS pos = POS.getPartOfSpeech(posTag.charAt(0)); if(pos == null) { return new ArrayList<String>(); } WordnetStemmer wordnetStemmer = new WordnetStemmer(iDictionary); List<String> stems = wordnetStemmer.findStems(word, pos); return stems; }
/** * Convenience method for transforming the result of the {@link #toString()} * method into an {@code IndexWordID} * * @param value * the string to be parsed * @return the index word id * @throws NullPointerException * if the specified string is <code>null</code> * @throws IllegalArgumentException * if the specified string does not conform to an index word id * string * @since JWI 1.0 */ public static IndexWordID parseIndexWordID(String value) { if(value == null) throw new NullPointerException(); if(!value.startsWith("XID-")) throw new IllegalArgumentException(); if(value.charAt(value.length()-2) != '-') throw new IllegalArgumentException(); POS pos = POS.getPartOfSpeech(value.charAt(value.length()-1)); return new IndexWordID(value.substring(4, value.length()-2), pos); } }
/** * Convenience method for transforming the result of the {@link #toString()} * method back into an {@code IExceptionEntryID}. * * @param value * the string to parse * @return the derived exception entry id * @throws NullPointerException * if the specified string is <code>null</code> * @throws IllegalArgumentException * if the specified string does not conform to an exception * entry id * @since JWI 2.2.0 */ public static ExceptionEntryID parseExceptionEntryID(String value) { if(value == null) throw new NullPointerException(); if(!value.startsWith("EID-")) throw new IllegalArgumentException(); if(value.charAt(value.length()-2) != '-') throw new IllegalArgumentException(); POS pos = POS.getPartOfSpeech(value.charAt(value.length()-1)); return new ExceptionEntryID(value.substring(4, value.length()-2), pos); }
try pos = POS.getPartOfSpeech(tag);
POS pos = POS.getPartOfSpeech(tag); if(pos == null) throw new IllegalArgumentException("unknown part of speech tag: " + tag);
/** * Return lexical file name (WordNet class) corresponding * to the most frequent sense, use Penn Treebank POS tag name * to specify the part of speech. * * @param origStr input word * @param tagStr Penn Treebank POS tag * @return a lexical file name or an empty string. */ public String getLexName(String origStr, String tagStr) { Character p = mPosUtil.get(tagStr); if (p == null) return ""; POS pos = POS.getPartOfSpeech(p); if (null == pos) return ""; return getLexName(origStr, pos); }
POS pos = POS.getPartOfSpeech(value.charAt(13)); ISynsetID id = new SynsetID(offset, pos);
POS pos = POS.getPartOfSpeech(posSym.charAt(0));
POS pos = POS.getPartOfSpeech(args[3].charAt(0));
end = key.indexOf(':', begin); int ss_type = Integer.parseInt(key.substring(begin, end)); POS pos = POS.getPartOfSpeech(ss_type); boolean isAdjSat = POS.isAdjectiveSatellite(ss_type);
POS pos = POS.getPartOfSpeech(posTag.charAt(0)); if(pos == null) { return synonyms;
synset_pos = POS.getPartOfSpeech(synset_tag); target_pos = POS.getPartOfSpeech(tokenizer.nextToken().charAt(0));
POS pos = POS.getPartOfSpeech(posTag.charAt(0)); if(pos == null) { return synonyms;
POS pos = POS.getPartOfSpeech(posTag.charAt(0)); if(pos == null) { return hypernyms;
POS pos = POS.getPartOfSpeech(posTag.charAt(0)); if(pos == null) { return hypernyms;
POS pos = POS.getPartOfSpeech(posTag.charAt(0)); if(pos == null) { return hypernyms;
POS pos = POS.getPartOfSpeech(posTag.charAt(0)); if(pos == null) { return hypernyms;
&& POS.getPartOfSpeech(t.getPos().charAt(0)) != null) { POS pos = POS.getPartOfSpeech(t.getPos().charAt(0)); List<String> stems = stemmer.findStems(t.getCoveredText(), pos);