我是UIMA Ruta的新手.我使用脚本语言制作了一些注释器.我可以在EclipseIDE中运行它们.我想编写一个JAVA API来自动运行提供的输入脚本.
我使用的是UIMA文档中提供的相同示例项目.
到目前为止,我已经能够做到这一点
try {
File taeDescriptor = null;
File inputDir = null;
// Read and validate command line arguments
boolean validArgs = false;
if (args.length == 2) {
taeDescriptor = new File(args[0]);
inputDir = new File(args[1]);
validArgs = taeDescriptor.exists()
&& !taeDescriptor.isDirectory()
&& inputDir.isDirectory();
}
if (!validArgs) {
printUsageMessage();
} else {
// get Resource Specifier from XML file
XMLInputSource in = new XMLInputSource(taeDescriptor);
ResourceSpecifier specifier = UIMAFramework.getXMLParser()
.parseResourceSpecifier(in);
// for debugging, output the Resource Specifier
// System.out.println(specifier); …Run Code Online (Sandbox Code Playgroud)