private static void checkInitialized(int requiredStage) { if (requiredStage > _initStage) { throw new JWNLRuntimeException("JWNL_EXCEPTION_007"); } }
/** Get the current WordNet version */ public static Version getVersion() { checkInitialized(VERSION_SET); return _version; }
public String toString() { if (_cachedToString == null) _cachedToString = JWNL.resolveMessage("DICTIONARY_TOSTRING_001", new Object[] { _pos, _key }); return _cachedToString; } }
public WordNet(InputStream propertiesStream) { try { JWNL.initialize(propertiesStream); dict = Dictionary.getInstance(); } catch (JWNLException e) { e.printStackTrace(); } }
private static void releaseDictionary() { synchronized (WordNet.class) { dictionary = null; JWNL.shutdown(); // safe to call it multiple times } }
public String toString() { if (_cachedToString == null) { _cachedToString = JWNL.resolveMessage("DATA_TOSTRING_006", _label); } return _cachedToString; } }
private POSKey(POS pos, Object key) { if (pos == null || key == null) { throw new JWNLRuntimeException("DICTIONARY_EXCEPTION_001"); } _pos = pos; _key = key; }
/** * Resolve <var>msg</var> in one of the resource bundles used by the system. * @param obj parameter to insert into the resolved message */ public static String resolveMessage(String msg, Object obj) { return resolveMessage(msg, new Object[]{obj}); }
public String toString() { if (_resolved == null) _resolved = JWNL.resolveMessage(_unresolved); return _resolved; } }
public JWNLRuntimeException(String key, Object arg, Throwable cause) { super(JWNL.resolveMessage(key, arg), cause); } }
public JWNLException(String key, Object arg, Throwable cause) { super(JWNL.resolveMessage(key, arg), cause); } }
/** Resolve <var>msg</var> in one of the resource bundles used by the system */ public static String resolveMessage(String msg) { return resolveMessage(msg, new Object[0]); }
public JWNLRuntimeException(String key, Object[] args, Throwable cause) { super(JWNL.resolveMessage(key, args), cause); }
public JWNLException(String key) { super(JWNL.resolveMessage(key)); }
public JWNLRuntimeException(String key, Object arg) { super(JWNL.resolveMessage(key, arg)); }
public JWNLRuntimeException(String key, Object[] args) { super(JWNL.resolveMessage(key, args)); }
public JWNLException(String key, Object arg) { super(JWNL.resolveMessage(key, arg)); }
public JWNLException(String key, Object[] args, Throwable cause) { super(JWNL.resolveMessage(key, args), cause); }
public JWNLException(String key, Object[] args) { super(JWNL.resolveMessage(key, args)); }
public String toString() { return resolveMessage("JWNL_TOSTRING_001", _name); }