UIMA Ruta如何制定新的组合注释规则?

时间:2016-07-01 14:57:37

标签: apache uima ruta

我开始学习UIMA Ruta并且遇到一些麻烦。我需要添加一个简单的规则,它将创建一个名为FLName的新组合注释,它将由FirstName和LastName注释组成,这些注释用于音译每个Cyrillic编写的单词。这是我的代码,任何人都可以找到我错的地方吗?

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)};

我试图做这样的事情 enter image description here

但结果就是这样 enter image description here

2 个答案:

答案 0 :(得分:1)

Find the solution 
(FirstName # LastName){-> CREATE(FLName, "first_name" = FirstName, "last_name" = LastName)};

答案 1 :(得分: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的开发者