2016-08-02 6 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ルタ

のデベロッパー
関連する問題