@Test public void testParameters() throws Exception { InputStream generatorDescriptorIn = getClass().getResourceAsStream( "/opennlp/tools/util/featuregen/TestParametersConfig.xml"); Assert.assertNotNull(generatorDescriptorIn); AdaptiveFeatureGenerator generator = GeneratorFactory.create(generatorDescriptorIn, null); Assert.assertTrue(generator instanceof TestParametersFeatureGenerator); TestParametersFeatureGenerator featureGenerator = (TestParametersFeatureGenerator)generator; Assert.assertEquals(123, featureGenerator.ip); Assert.assertEquals(45, featureGenerator.fp, 0.1); Assert.assertEquals(67890, featureGenerator.lp); Assert.assertEquals(123456.789, featureGenerator.dp, 0.1); Assert.assertTrue(featureGenerator.bp); Assert.assertEquals("HELLO", featureGenerator.sp); }
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);  }