@Test public void testInsertCachedFeatureGenerator() throws Exception { InputStream generatorDescriptorIn = getClass().getResourceAsStream( "/opennlp/tools/util/featuregen/TestInsertCachedFeatureGenerator.xml"); Assert.assertNotNull(generatorDescriptorIn); AdaptiveFeatureGenerator featureGenerator = GeneratorFactory.create(generatorDescriptorIn, null); Assert.assertTrue(featureGenerator instanceof CachedFeatureGenerator); CachedFeatureGenerator cachedFeatureGenerator = (CachedFeatureGenerator)featureGenerator; Assert.assertTrue(cachedFeatureGenerator.getCachedFeatureGenerator() instanceof AggregatedFeatureGenerator); AggregatedFeatureGenerator aggregatedFeatureGenerator = (AggregatedFeatureGenerator)cachedFeatureGenerator.getCachedFeatureGenerator(); Assert.assertEquals(3, aggregatedFeatureGenerator.getGenerators().size()); for (AdaptiveFeatureGenerator afg: aggregatedFeatureGenerator.getGenerators()) { Assert.assertTrue(afg instanceof OutcomePriorFeatureGenerator); } }
public static AdaptiveFeatureGenerator create(InputStream xmlDescriptorIn, FeatureGeneratorResourceProvider resourceManager) throws IOException { org.w3c.dom.Document xmlDescriptorDOM = createDOM(xmlDescriptorIn); Element generatorElement = xmlDescriptorDOM.getDocumentElement(); return createGenerator(generatorElement, resourceManager); }
GeneratorFactory { public static AdaptiveFeatureGenerator create(InputStream xmlDescriptorIn, FeatureGeneratorResourceProvider resourceManager) throws IOException { org.w3c.dom.Document xmlDescriptorDOM = createDOM(xmlDescriptorIn); Element generatorElement = xmlDescriptorDOM.getDocumentElement(); return createGenerator(generatorElement, resourceManager); } }
GeneratorFactory { public static AdaptiveFeatureGenerator create(InputStream xmlDescriptorIn, FeatureGeneratorResourceProvider resourceManager) throws IOException { org.w3c.dom.Document xmlDescriptorDOM = createDOM(xmlDescriptorIn); Element generatorElement = xmlDescriptorDOM.getDocumentElement(); return createGenerator(generatorElement, resourceManager); }  }
GeneratorFactory { public static AdaptiveFeatureGenerator create(InputStream xmlDescriptorIn, FeatureGeneratorResourceProvider resourceManager) throws IOException { org.w3c.dom.Document xmlDescriptorDOM = createDOM(xmlDescriptorIn); Element generatorElement = xmlDescriptorDOM.getDocumentElement(); return createGenerator(generatorElement, resourceManager); }  static AdaptiveFeatureGenerator create(InputStream xmlDescriptorIn,
      FeatureGeneratorResourceProvider resourceManager); static Map<String, ArtifactSerializer<?>> extractArtifactSerializerMappings(
      InputStream xmlDescriptorIn); static List<Element> getDescriptorElements(InputStream xmlDescriptorIn); }
GeneratorFactory { public static AdaptiveFeatureGenerator create(InputStream xmlDescriptorIn, FeatureGeneratorResourceProvider resourceManager) throws IOException { org.w3c.dom.Document xmlDescriptorDOM = createDOM(xmlDescriptorIn); Element generatorElement = xmlDescriptorDOM.getDocumentElement(); return createGenerator(generatorElement, resourceManager); }  static AdaptiveFeatureGenerator create(InputStream xmlDescriptorIn,
      FeatureGeneratorResourceProvider resourceManager); static Map<String, ArtifactSerializer<?>> extractArtifactSerializerMappings(
      InputStream xmlDescriptorIn); static List<Element> getDescriptorElements(InputStream xmlDescriptorIn);  }