小编Ans*_*hul的帖子

用于运行UIMA Ruta脚本的Java API

我是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)

java uima ruta

6
推荐指数
1
解决办法
1724
查看次数

标签 统计

java ×1

ruta ×1

uima ×1