public IExceptionEntry getExceptionEntry(String surfaceForm, POS pos) { return getExceptionEntry(new ExceptionEntryID(surfaceForm, pos)); }
public IExceptionEntry getExceptionEntry(String surfaceForm, POS pos) { return getExceptionEntry(new ExceptionEntryID(surfaceForm, pos)); }
/** * Creates a new exception entry for the specified part of speech using the * information in the specified exception proxy object. * * @param proxy * the proxy containing the information for the entry * @param pos * the part of speech for the entry * @throws NullPointerException * if either argument is <code>null</code> * @since JWI 1.0 */ public ExceptionEntry(IExceptionEntryProxy proxy, POS pos) { super(proxy); if (pos == null) throw new NullPointerException(); this.pos = pos; this.id = new ExceptionEntryID(getSurfaceForm(), pos); }
/** * Creates a new exception entry for the specified part of speech using the * specified surface and root forms. * * @param surfaceForm * the surface form for the entry * @param pos * the part of speech for the entry * @param rootForms * the root forms for the entry * @throws NullPointerException * if either argument is <code>null</code> * @since JWI 1.0 */ public ExceptionEntry(String surfaceForm, POS pos, String... rootForms) { super(surfaceForm, rootForms); if(pos == null) throw new NullPointerException(); this.id = new ExceptionEntryID(getSurfaceForm(), pos); this.pos = 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); }
public IExceptionEntry getExceptionEntry(String surfaceForm, POS pos) { checkOpen(); IExceptionEntryID id = new ExceptionEntryID(surfaceForm, pos); IExceptionEntry item = getCache().retrieveItem(id); if(item == null){ item = backing.getExceptionEntry(id); if(item != null) getCache().cacheItem(item); } return item; }