需要一个代码示例来帮助您正确理解自己的RUTA脚本中的设置参数。
就我而言,我需要将配置参数“ emptyIsInvisible”设置为false。根本原因在Are some extra settings in RUTA script needed to detect annotations with the same begin and end attributes?
中进行了描述我做了两次尝试
1)使用标准Ruta Engine的名称:
ENGINE BasicEngine;
Document{->CONFIGURE(BasicEngine, "emptyIsInvisible" = false)};`
脚本的该部分不会更改默认设置。
2)使用自己引擎的名称:
ENGINE xxx.yyy.zzz.TagEngine;
Document{->CONFIGURE(TagEngine, "emptyIsInvisible" = false)};
在这种情况下,脚本会引发以下异常:
Exception in thread "main" java.lang.StackOverflowError
at java.io.UnixFileSystem.getBooleanAttributes0(Native Method)
at java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:242)
at java.io.File.exists(File.java:819)
at sun.misc.URLClassPath$FileLoader.getResource(URLClassPath.java:1081)
at sun.misc.URLClassPath$FileLoader.findResource(URLClassPath.java:1048)
at sun.misc.URLClassPath$1.next(URLClassPath.java:226)
at sun.misc.URLClassPath$1.hasMoreElements(URLClassPath.java:236)
at java.net.URLClassLoader$3$1.run(URLClassLoader.java:589)
at java.net.URLClassLoader$3$1.run(URLClassLoader.java:587)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader$3.next(URLClassLoader.java:586)
at java.net.URLClassLoader$3.hasMoreElements(URLClassLoader.java:611)
at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java:45)
at sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java:54)
at java.util.ServiceLoader$LazyIterator.hasNextService(ServiceLoader.java:354)
at java.util.ServiceLoader$LazyIterator.hasNext(ServiceLoader.java:393)
at java.util.ServiceLoader$1.hasNext(ServiceLoader.java:474)
at javax.xml.parsers.FactoryFinder$1.run(FactoryFinder.java:293)
at java.security.AccessController.doPrivileged(Native Method)
at javax.xml.parsers.FactoryFinder.findServiceProvider(FactoryFinder.java:289)
at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:267)
at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:127)
at org.apache.uima.internal.util.XMLUtils.createSAXParserFactory(XMLUtils.java:543)
at org.apache.uima.util.impl.XMLParser_impl.parse(XMLParser_impl.java:159)
at org.apache.uima.util.impl.XMLParser_impl.parseResourceSpecifier(XMLParser_impl.java:399)
at org.apache.uima.util.impl.XMLParser_impl.parseResourceSpecifier(XMLParser_impl.java:381)
at org.apache.uima.ruta.engine.Ruta.wrapAnalysisEngine(Ruta.java:278)
at org.apache.uima.ruta.engine.Ruta.wrapAnalysisEngine(Ruta.java:270)
at org.apache.uima.ruta.engine.RutaEngine.initializeEngines(RutaEngine.java:896)
at org.apache.uima.ruta.engine.RutaEngine.initializeScript(RutaEngine.java:820)
at org.apache.uima.ruta.engine.RutaEngine.initialize(RutaEngine.java:527)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initializeAnalysisComponent(PrimitiveAnalysisEngine_impl.java:267)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initialize(PrimitiveAnalysisEngine_impl.java:172)
at org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(AnalysisEngineFactory_impl.java:94)
at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:62)
at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:279)
at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:331)
at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:448)
at org.apache.uima.ruta.engine.Ruta.wrapAnalysisEngine(Ruta.java:279)
at org.apache.uima.ruta.engine.Ruta.wrapAnalysisEngine(Ruta.java:270)
at org.apache.uima.ruta.engine.RutaEngine.initializeEngines(RutaEngine.java:896)
at org.apache.uima.ruta.engine.RutaEngine.initializeScript(RutaEngine.java:820)
at org.apache.uima.ruta.engine.RutaEngine.initialize(RutaEngine.java:527)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initializeAnalysisComponent(PrimitiveAnalysisEngine_impl.java:267)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initialize(PrimitiveAnalysisEngine_impl.java:172)
at org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(AnalysisEngineFactory_impl.java:94)
at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:62)
at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:279)
at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:331)
at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:448)
at org.apache.uima.ruta.engine.Ruta.wrapAnalysisEngine(Ruta.java:279)
at org.apache.uima.ruta.engine.Ruta.wrapAnalysisEngine(Ruta.java:270)
at org.apache.uima.ruta.engine.RutaEngine.initializeEngines(RutaEngine.java:896)
at org.apache.uima.ruta.engine.RutaEngine.initializeScript(RutaEngine.java:820)
at org.apache.uima.ruta.engine.RutaEngine.initialize(RutaEngine.java:527)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initializeAnalysisComponent(PrimitiveAnalysisEngine_impl.java:267)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initialize(PrimitiveAnalysisEngine_impl.java:172)
at org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(AnalysisEngineFactory_impl.java:94)
at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:62)
at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:279)
at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:331)
at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:448)
at org.apache.uima.ruta.engine.Ruta.wrapAnalysisEngine(Ruta.java:279)
at org.apache.uima.ruta.engine.Ruta.wrapAnalysisEngine(Ruta.java:270)
at org.apache.uima.ruta.engine.RutaEngine.initializeEngines(RutaEngine.java:896)
at org.apache.uima.ruta.engine.RutaEngine.initializeScript(RutaEngine.java:820)
at org.apache.uima.ruta.engine.RutaEngine.initialize(RutaEngine.java:527)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initializeAnalysisComponent(PrimitiveAnalysisEngine_impl.java:267)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initialize(PrimitiveAnalysisEngine_impl.java:172)
at org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(AnalysisEngineFactory_impl.java:94)
at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:62)
at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:279)
at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:331)
....
答案 0 :(得分:0)
此参数不能解决链接问题中的问题。如果在某些位置根本没有注释,则该参数控制基本匹配。这意味着只有在应用其他播种(例如没有播种)的情况下,这才会影响匹配。
关于这个问题: 您无法在分析引擎尝试执行的脚本中配置RutaEngine分析引擎。您需要在框架级别设置配置参数。这取决于您如何在代码中创建和运行UIMA分析引擎。
在一个简单的Ruta项目中,您需要修改模板分析引擎描述(BasicEngine.xml),以便生成的描述将包含参数值。
使用uimaFIT或其他工厂方法,在创建描述或分析引擎时需要传递参数及其值。
免责声明:我是UIMA Ruta的开发人员