目前,我正在尝试将一些xml文件转换为Lemon模型。我使用Lemon API和lemon工厂来创建所需对象的实例。不幸的是,我无法了解如何实例化SenseContext类的对象。
例如,词义可以这样创建:
LexicalSense lclsns = factory.makeSense(senseURI); 其中,工厂是LemonFactory的一个实例。对于SenseContext,在LemonFactory中不存在make函数,并且尝试使用make()没有成功的方法,即:
SenseContext sns = factory.make(SenseContext.class, snsURI, snsURI); (插入两次相同的URI只是为了测试)。
谁能告诉我如何正确实例化SenseContext对象?
提前感谢!
Add On (12.01.2015 - 17:47):关于接口的文档可以在这里找到:http://lemon-model.net/apidocs/index.html和接口本身在这里http://lemon-model.net/download/api.php
发布于 2015-01-13 00:47:56
以下是Lemon api的javadoc API中的搜索结果:
SenseContext
根据这一点,您需要使用:
LinguisticOntology.getContext(String name)或
LexInfo.getContext(String name)编辑:
根据javadoc的说法,该接口只有一个实现,因此您的选择是:http://lemon-model.net/apidocs/eu/monnetproject/lemon/impl/class-use/ContextImpl.html
AccepterFactory.getContextImpl(URI uri) 或
AccepterFactory.getContextImpl(String bNode) https://stackoverflow.com/questions/27905208
复制相似问题