I  think so.

Here's a good sources to "mine" for code that does this:

1) In the source code for Apache UIMA, in the project uimaj-core, there is a section under src/test/java containing test cases. Many of these test cases do what you're wanting to do. If you are using Eclipse, you can highlight/select the src/test/java folder, and then use the menu Search -> File and put in ResourceSpecifier, and search in *.java in "selected resources" - I got 145 matches... and see some examples.
Look (for instance) in AnalysisEngineDescription_implTest.

Cheers. -Marshall

Steven Bethard wrote:
Is it possible to create ResourceSpecifier objects without an XML
descriptor file? Currently I'm use code like this::

XMLInputSource xmlInput = new XMLInputSource(new File(descriptorPath));
XMLParser parser = UIMAFramework.getXMLParser();
ResourceSpecifier specifier = parser.parseResourceSpecifier(xmlInput);

As you can see, I parse an XML descriptor file in the standard way.
I'd love to be able to manually create a ResourceSpecifier with some
series of Java object creations and method calls.  Is that possible?

(I'd mainly like to do this for tests. I'd like to be able to create
an AnalysisEngine directly, without having to write an XML descriptor
file, so that I don't have to rely on a bunch of external files and
all my testing code can be in the same place.)

Steve

Reply via email to