1

我开始学习 UIMA Ruta 并且在任务中遇到了一些麻烦。我需要添加一个简单的规则,该规则将创建名为 FLName 的新组合注释,该注释将由 FirstName 和 LastName 注释组成,它们音译每个西里尔字母书写的单词。这是我的代码,有人能找到我错的地方吗?

Main
Document {-> CALL(TranslitCyrillic)};
Document {-> CALL(AnnotatePerson)};

Symbol {-> UNMARK(Symbol)};
Document {-> RETAINTYPE(SPACE)};
ALL {-> UNMARK(ALL)}; 

AnnotatePerson
DECLARE Annotation FirstName (STRING first_name);
DECLARE Annotation LastName (STRING last_name);
DECLARE Annotation FLName(STRING first_name, STRING last_name);

//in this rule trouble
Word {FEATURE("translit", "beishor"), FEATURE("translit", "bishop") -> CREATE(FLName), FILL(FirstName, "first_name" = Word.translit), 
FILL(LastName, "last_name" = Word.translit)};


Word {FEATURE("translit", "beishor") -> CREATE(FirstName), FILL(FirstName, "first_name" = Word.translit)}
Word {FEATURE("translit", "bishop") -> CREATE(LastName), FILL(LastName, "last_name" = Word.translit)};

我正在尝试做这样的事情 在此处输入图像描述

但结果是这里 输入图像描述

4

2 回答 2

1
Find the solution 
(FirstName # LastName){-> CREATE(FLName, "first_name" = FirstName, "last_name" = LastName)};
于 2016-07-03T09:17:55.873 回答
1

除了正确答案之外,以下是创建复杂注释的典型选项:

(FirstName # LastName){-> CREATE(FLName, "first_name" = FirstName, "last_name" = LastName)};
FirstName # LastName{-> GATHER(FLName, "first_name" = 1, "last_name" = 3)};
(FirstName # LastName){-> FLName, FLName.first_name = FirstName, FLName.last_name = LastName};
(f:FirstName # l:LastName){-> FLName, FLName.first_name = f, FLName.last_name = l};

免责声明:我是 UIMA Ruta 的开发人员

于 2016-07-07T08:26:56.597 回答