/** * Loads all targets in load all pointers and all synsets in all index words. * * @throws JWNLException JWNLException */ protected void resolveAllPointers() throws JWNLException { for (POS pos : POS.getAllPOS()) { resolvePointers(pos); } }
@Override public String transform(net.sf.extjwnl.data.POS pos) { return pos.getKey(); } }
/** * Return the <code>POS</code> whose key matches <var>label</var>, * or null if the label does not match any POS. * * @param label POS label * @return POS */ public static POS getPOSForLabel(String label) { for (POS pos : ALL_POS) { if (pos.getLabel().equals(label)) { return pos; } } return null; }
pos = POS.getPOSForId(posIntId); final String lexFileString = key.substring(colonIndex + 1); int lexColonIndex = lexFileString.indexOf(':'); pos = POS.getPOSForKey(args[i].substring(0, 1)); if (pos == null) { log.error("POS {} is not recognized for derivation {}", args[i], derivation); log.info("Creating {} synset...", pos.getLabel()); final Synset tempSynset = d.createSynset(pos); log.info("Creating word {}...", lemma); for (final POS pos : POS.getAllPOS()) { IndexWord iw = d.getIndexWord(pos, key); if (iw == null) { System.out.println("\nNo information available for " + pos.getLabel() + " " + key); } else { System.out.println("\nInformation available for " + iw.getPOS().getLabel() + " " + iw.getLemma()); printAvailableInfo(iw); iw = d.getIndexWord(pos, form); if (null != iw) { System.out.println("\nInformation available for " + iw.getPOS().getLabel() + " " + iw.getLemma()); printAvailableInfo(iw); final POS p = POS.getPOSForKey(arg.substring(5)); final IndexWord iw = d.lookupIndexWord(p, key); if (iw != null) { System.out.println("\nAntonyms of " + (p == null ? "" : p.getLabel()) + " " + iw.getLemma());
@Override public int hashCode() { int result = pos != null ? pos.hashCode() : 0; result = 31 * result + (int) (offset ^ (offset >>> 32)); result = 31 * result + index; return result; } }
public MapDictionary(Document doc) throws JWNLException { super(doc); tableMap = new EnumMap<>(POS.class); for (POS pos : POS.values()) { Map<DictionaryFileType, Map<Object, DictionaryElement>> files = new EnumMap<>(DictionaryFileType.class); tableMap.put(pos, files); } }
public DetachSuffixesOperation(Dictionary dictionary, Map<String, Param> params) throws JWNLException { super(dictionary, params); suffixMap = new EnumMap<>(POS.class); for (Param p : params.values()) { POS pos = POS.getPOSForLabel(p.getName()); if (pos != null) { suffixMap.put(pos, getSuffixArray(dictionary, p.getValue())); } } }
/** * Return the <code>POS</code> whose id matches <var>id</var>, * or null if the id does not match any POS. * * @param id id for POS * @return POS */ public static POS getPOSForId(int id) { if (NOUN.getId() == id) { return POS.NOUN; } if (VERB.getId() == id) { return POS.VERB; } if (ADJECTIVE.getId() == id) { return POS.ADJECTIVE; } if (ADVERB.getId() == id) { return POS.ADVERB; } if (ADJECTIVE_SATELLITE_ID == id) { return POS.ADJECTIVE; } return null; }
PointerType type = PointerType.getPointerTypeForKey(pointers.getString(1)); long targetOffset = pointers.getLong(2); POS targetPOS = POS.getPOSForKey(pointers.getString(3));
final POS pos = POS.getPOSForId(ssTypeId); if (pos == null) { return null;
pos = POS.getPOSForId(posIntId); final String lexFileString = key.substring(colonIndex + 1); int lexColonIndex = lexFileString.indexOf(':'); pos = POS.getPOSForKey(args[i].substring(0, 1)); if (pos == null) { log.error("POS {} is not recognized for derivation {}", args[i], derivation); log.info("Creating {} synset...", pos.getLabel()); final Synset tempSynset = d.createSynset(pos); log.info("Creating word {}...", lemma); for (final POS pos : POS.getAllPOS()) { IndexWord iw = d.getIndexWord(pos, key); if (iw == null) { System.out.println("\nNo information available for " + pos.getLabel() + " " + key); } else { System.out.println("\nInformation available for " + iw.getPOS().getLabel() + " " + iw.getLemma()); printAvailableInfo(iw); iw = d.getIndexWord(pos, form); if (null != iw) { System.out.println("\nInformation available for " + iw.getPOS().getLabel() + " " + iw.getLemma()); printAvailableInfo(iw); final POS p = POS.getPOSForKey(arg.substring(5)); final IndexWord iw = d.lookupIndexWord(p, key); if (iw != null) { System.out.println("\nAntonyms of " + (p == null ? "" : p.getLabel()) + " " + iw.getLemma());
/** * 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 int hashCode() { int result = pos != null ? pos.hashCode() : 0; result = 31 * result + (int) (offset ^ (offset >>> 32)); result = 31 * result + index; return result; } }
public MapDictionary(Document doc) throws JWNLException { super(doc); tableMap = new EnumMap<>(POS.class); for (POS pos : POS.values()) { Map<DictionaryFileType, Map<Object, DictionaryElement>> files = new EnumMap<>(DictionaryFileType.class); tableMap.put(pos, files); } }
public DetachSuffixesOperation(Dictionary dictionary, Map<String, Param> params) throws JWNLException { super(dictionary, params); suffixMap = new EnumMap<>(POS.class); for (Param p : params.values()) { POS pos = POS.getPOSForLabel(p.getName()); if (pos != null) { suffixMap.put(pos, getSuffixArray(dictionary, p.getValue())); } } }
/** * Return the <code>POS</code> whose id matches <var>id</var>, * or null if the id does not match any POS. * * @param id id for POS * @return POS */ public static POS getPOSForId(int id) { if (NOUN.getId() == id) { return POS.NOUN; } if (VERB.getId() == id) { return POS.VERB; } if (ADJECTIVE.getId() == id) { return POS.ADJECTIVE; } if (ADVERB.getId() == id) { return POS.ADVERB; } if (ADJECTIVE_SATELLITE_ID == id) { return POS.ADJECTIVE; } return null; }
PointerType type = PointerType.getPointerTypeForKey(pointers.getString(1)); long targetOffset = pointers.getLong(2); POS targetPOS = POS.getPOSForKey(pointers.getString(3));
final POS pos = POS.getPOSForId(ssTypeId); if (pos == null) { return null;