You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by pk...@apache.org on 2012/11/09 15:21:47 UTC

svn commit: r1407465 [1/3] - in /uima/sandbox/trunk/TextMarker: uima-docbook-textmarker/src/docbook/language/ uimaj-ep-textmarker-ide/src/main/antlr3/org/apache/uima/textmarker/ide/core/parser/ uimaj-ep-textmarker-ide/src/main/resources/org/apache/uima...

Author: pkluegl
Date: Fri Nov  9 14:21:46 2012
New Revision: 1407465

URL: http://svn.apache.org/viewvc?rev=1407465&view=rev
Log:
UIMA-2496
- extended UNMARK action definition in grammars
- added arguments for action
- adapted verbalization for explanation components
- extended documentation
- updated hover information in IDE

Modified:
    uima/sandbox/trunk/TextMarker/uima-docbook-textmarker/src/docbook/language/tools.textmarker.language.actions.xml
    uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/antlr3/org/apache/uima/textmarker/ide/core/parser/TextMarkerParser.g
    uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/resources/org/apache/uima/textmarker/ide/ui/documentation/Actions.html
    uima/sandbox/trunk/TextMarker/uimaj-textmarker/src/main/antlr3/org/apache/uima/textmarker/parser/TextMarkerParser.g
    uima/sandbox/trunk/TextMarker/uimaj-textmarker/src/main/java/org/apache/uima/textmarker/action/ActionFactory.java
    uima/sandbox/trunk/TextMarker/uimaj-textmarker/src/main/java/org/apache/uima/textmarker/action/UnmarkAction.java
    uima/sandbox/trunk/TextMarker/uimaj-textmarker/src/main/java/org/apache/uima/textmarker/verbalize/ActionVerbalizer.java

Modified: uima/sandbox/trunk/TextMarker/uima-docbook-textmarker/src/docbook/language/tools.textmarker.language.actions.xml
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uima-docbook-textmarker/src/docbook/language/tools.textmarker.language.actions.xml?rev=1407465&r1=1407464&r2=1407465&view=diff
==============================================================================
--- uima/sandbox/trunk/TextMarker/uima-docbook-textmarker/src/docbook/language/tools.textmarker.language.actions.xml (original)
+++ uima/sandbox/trunk/TextMarker/uima-docbook-textmarker/src/docbook/language/tools.textmarker.language.actions.xml Fri Nov  9 14:21:46 2012
@@ -1082,7 +1082,10 @@
 		<title>UNMARK</title>
 		<para>
 			The UNMARK action removes the annotation of the given type
-			overlapping the matched annotation.
+			overlapping the matched annotation. There are two additional configurations: If additional
+			indexes are given, then the span of the specified rule elements are applied, similar the the MARK action.
+			If instead a boolean is given as an additional argument, then all annoations of the given type are removed
+			that start at the macthed position.
 		</para>
 		<section>
 			<title>
@@ -1090,6 +1093,8 @@
 			</title>
 			<para>
 				<programlisting><![CDATA[UNMARK(TypeExpression)]]></programlisting>
+				<programlisting><![CDATA[UNMARK(TypeExpression (,NumberExpression)*)]]></programlisting>
+				<programlisting><![CDATA[UNMARK(TypeExpression, BooleanExpression)]]></programlisting>
 			</para>
 		</section>
 		<section>
@@ -1102,6 +1107,18 @@
 			<para>
 				Here, the headline annotation is removed.
 			</para>
+			<para>
+				<programlisting><![CDATA[CW ANY+? QUESTION{->UNMARK(Headline,1,3)};]]></programlisting>
+			</para>
+			<para>
+				Here, all headline annotations are removed that start with a capitalized word and end with a question mark.
+			</para>
+			<para>
+				<programlisting><![CDATA[CW{->UNMARK(Headline,true)};]]></programlisting>
+			</para>
+			<para>
+				Here, all headline annotations are removed that start with a capitalized word.
+			</para>
 		</section>
 	</section>
 
@@ -1130,6 +1147,7 @@
 			<para>
 				Here, all annotations but headlines are removed.
 			</para>
+			
 		</section>
 	</section>
 

Modified: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/antlr3/org/apache/uima/textmarker/ide/core/parser/TextMarkerParser.g
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/antlr3/org/apache/uima/textmarker/ide/core/parser/TextMarkerParser.g?rev=1407465&r1=1407464&r2=1407465&view=diff
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/antlr3/org/apache/uima/textmarker/ide/core/parser/TextMarkerParser.g (original)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/antlr3/org/apache/uima/textmarker/ide/core/parser/TextMarkerParser.g Fri Nov  9 14:21:46 2012
@@ -1551,12 +1551,33 @@ actionDynamicAnchoring returns [TextMark
 
 //unknown
 actionUnmark returns [TextMarkerAction action = null]
+@init {
+List<Expression> list = new ArrayList<Expression>();
+}
     :
     name = UNMARK LPAREN f = typeExpression
     {action = ActionFactory.createAction(name, f);}
+    
+    (COMMA 
+    (
+  	(b = booleanExpression) => b = booleanExpression
+  	{action = ActionFactory.createAction(name, f, b);}
+  	|
+  	(
+  	index = numberExpression {list.add(index);} 
+  	{action = ActionFactory.createAction(name, f, list);}
+  	(COMMA index = numberExpression {list.add(index);})*
+  	{action = ActionFactory.createAction(name, f, list);}
+  	)
+    )
+      
+    )?
+    {action = ActionFactory.createAction(name, f , b, list);}
      RPAREN
     ;
 
+
+
 actionUnmarkAll returns [TextMarkerAction action = null]
     :
     name = UNMARKALL LPAREN f = typeExpression