POSTaggerFactory extends BaseToolFactory { public static POSTaggerFactory create(String subclassName, Dictionary ngramDictionary, TagDictionary posDictionary) throws InvalidFormatException { if (subclassName == null) { return new POSTaggerFactory(ngramDictionary, posDictionary); } try { POSTaggerFactory theFactory = ExtensionLoader.instantiateExtension( POSTaggerFactory.class, subclassName); theFactory.init(ngramDictionary, posDictionary); return theFactory; } catch (Exception e) { String msg = "Could not instantiate the " + subclassName + ". The initialization throw an exception."; System.err.println(msg); e.printStackTrace(); throw new InvalidFormatException(msg, e); } } POSTaggerFactory();  POSTaggerFactory(Dictionary ngramDictionary,
      TagDictionary posDictionary); @Override @SuppressWarnings("rawtypes") Map<String, ArtifactSerializer> createArtifactSerializersMap(); @Override Map<String, Object> createArtifactMap(); TagDictionary createTagDictionary(File dictionary); TagDictionary createTagDictionary(InputStream in); void setTagDictionary(TagDictionary dictionary); TagDictionary getTagDictionary(); Dictionary getDictionary(); void setDictionary(Dictionary ngramDict); POSContextGenerator getPOSContextGenerator(); POSContextGenerator getPOSContextGenerator(int cacheSize); SequenceValidator<String> getSequenceValidator(); @Override void validateArtifactMap(); static POSTaggerFactory create(String subclassName,
      Dictionary ngramDictionary, TagDictionary posDictionary); TagDictionary createEmptyTagDictionary();  }
@Test(expected = InvalidFormatException.class) public void testCreateWithInvalidName() throws InvalidFormatException { BaseToolFactory.create("X", null); }
@Test(expected = InvalidFormatException.class) public void testCreateWithInvalidName2() throws InvalidFormatException { POSTaggerFactory.create("X", null, null); }
@Test(expected = InvalidFormatException.class) public void testCreateWithHierarchy() throws InvalidFormatException { BaseToolFactory.create(Object.class.getCanonicalName(), null); }
@Test(expected = InvalidFormatException.class) public void testCreateWithHierarchy2() throws InvalidFormatException { POSTaggerFactory.create(this.getClass().getCanonicalName(), null, null); }