【发布时间】:2021-10-19 15:22:40
【问题描述】:
我有一个类似这样的 Ruta 规则,其中 dep 是 DKPro 导入的 Dependency 类型。
dep{}->{MyItem{->
SETFEATURE("Display", "displayedValue"),
SETFEATURE("Lemma", dep.Dependent.lemma.value),
SETFEATURE("Parent", dep.Governor)};};
前两个操作有效。我遇到的问题是第三个动作SETFEATURE("Parent", dep.Governor)。 dep.Governor 返回一个 Token 类型,但我的功能需要另一种类型,它恰好与Governor 共享相同的位置。换句话说,我想要我自己的类型,而不是 dep.Governor,它已经注释了那个管理词。
我不确定如何恢复与 dep.Governor 占用相同空间的注释(我的注释)。理想情况下,我想将它作为变量恢复,以便我可以将它重用于其他功能来执行类似的操作。
a:MyItem [that overlaps dep.Governor]
dep{}->{MyItem{->SETFEATURE("Parent", a)};};
这是一个更精确的例子
d:dep.Dependency{->
MyItem,
MyItem.Display = "Ignore",
MyItem.Lemma = d.Dependent.lemma.value,
MyItem.LanguageParent = d,
};
MyItem.LanguageParent = d 行会产生这个 Ruta 错误
Trying to access value of feature "type.MyItem:LanguageParent" as "type.MyItem", but range of feature is "de.tudarmstadt.ukp.dkpro.core.api.syntax.type.dependency.Dependency"
【问题讨论】:
-
您精确示例中的规则适用于我的 Ruta Workbench。也许您的问题已经出现在某个较新版本的 Ruta 中。
标签: uima ruta dkpro-core