Apache UIMA Ruta Guide and Reference - Apache UIMA - The ...
Apache UIMA Ruta Guide and Reference - Apache UIMA - The ...
Apache UIMA Ruta Guide and Reference - Apache UIMA - The ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
CONTEXTCOUNT<br />
A Paragraph is annotated with a KeywordParagraph annotation, if it contains between two <strong>and</strong> four<br />
Keyword annotations.<br />
Paragraph{CONTAINS(Keyword,50,100,true)->MARK(KeywordParagraph)};<br />
A Paragraph is annotated with a KeywordParagraph annotation, if it contains between 50%<br />
<strong>and</strong> 100% Keyword annotations. This is calculated based on the tokens of the Paragraph.<br />
If the Paragraph contains six basic annotations (see Section 2.2, “Basic annotations <strong>and</strong><br />
tokens” [20]), two of them are part of one Keyword annotation, <strong>and</strong> if one basic annotation is<br />
also annotated with a Keyword annotation, then the percentage of the contained Keywords is 50%.<br />
2.6.5. CONTEXTCOUNT<br />
<strong>The</strong> CONTEXTCOUNT condition numbers all occurrences of the matched type within the<br />
context of a passed type's annotation consecutively, thus assigning an index to each occurrence.<br />
Additionally it stores the index of the matched annotation in a numerical variable if one is passed.<br />
<strong>The</strong> condition evaluates true if the index of the matched annotation is within a passed interval. If no<br />
interval is passed, the condition always evaluates true.<br />
2.6.5.1. Definition:<br />
CONTEXTCOUNT(Type(,NumberExpression,NumberExpression)?(,Variable)?)<br />
2.6.5.2. Example:<br />
Keyword{CONTEXTCOUNT(Paragraph,2,3,var)<br />
->MARK(SecondOrThirdKeywordInParagraph)};<br />
Here, the position of the matched Keyword annotation within a Paragraph annotation is calculated<br />
<strong>and</strong> stored in the variable 'var'. If the counted value lies within the interval [2,3], then the matched<br />
Keyword is annotated with the SecondOrThirdKeywordInParagraph annotation.<br />
2.6.6. COUNT<br />
<strong>The</strong> COUNT condition can be used in two different ways. In the first case (see first definition),<br />
it counts the number of annotations of the passed type within the window of the matched<br />
annotation <strong>and</strong> stores the amount in a numerical variable, if such a variable is passed. <strong>The</strong> condition<br />
evaluates true if the counted amount is within a specified interval. If no interval is passed, the<br />
condition always evaluates true. In the second case (see second definition), it counts the number<br />
of occurrences of the passed VariableExpression (second parameter) within the passed list (first<br />
parameter) <strong>and</strong> stores the amount in a numerical variable, if such a variable is passed. Again, the<br />
condition evaluates true if the counted amount is within a specified interval. If no interval is passed,<br />
the condition always evaluates true.<br />
2.6.6.1. Definition:<br />
COUNT(Type(,NumberExpression,NumberExpression)?(,NumberVariable)?)<br />
COUNT(ListExpression,VariableExpression<br />
(,NumberExpression,NumberExpression)?(,NumberVariable)?)<br />
<strong>UIMA</strong> <strong>Ruta</strong> Version 2.0.1 <strong>Apache</strong> <strong>UIMA</strong> <strong>Ruta</strong> Language 31