2016-08-02 78 views
1

我可以使用Uima Ruta分割单词的字母吗?Uima ruta -Abbrevations

Ex。

1.(WHO) 
2.(APIAs) 

脚本:

DECLARE Char; 
CAP->{"."->Char;}; 

,因为你需要匹配更小的东西你不能用这个一般规则:

DECLARE NEW; 
BLOCK (foreach)CAP{} 
{ 
W{REGEXP(".")->MARK(NEW)}; 

} 

回答

1

是的,这是在UIMA鲁塔simple regex规则实现比RutaBasic。唯一的选择是使用直接在文本上操作而不是在注释上运行的regexp规则。你当然应该非常小心,因为这会导致很多注释。

一些解释有点精简规则:CAP->{"."->Char;};

CAP // the only rule element of the rule: match on each CAP annotation 
->{// indicates that inlined rules follow that are applied in the context of the matched annotation. 
"." // a regular expression matching on each character 
-> Char // the "action" of the regex rule: create an annotation of the type Char for each match of the regex 
;}; // end of regex rule, end of inlined rules, end of actual rule 

汇总,对所有CAP注释规则迭代,适用于每个迭代覆盖文本正则表达式,并为比赛的注解。

您当然也可以使用BLOCK而不是内联规则。

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