Phase: Bio_Entities Input: Token SpaceToken Concept Options: control = appelt rule: BioConcept1 ( ( ({Token.category == JJ} | {Token.category == JJR}) {SpaceToken.kind == space} )* ( ({Token.category == NN} | {Token.category == NNS} | {Token.category == NNPS} | {Token.category == NNP}) {SpaceToken.kind == space} )* ({Token.string == cell} | {Token.string == neuron} | {Token.string == egg} |{Token.string == type} |{Token.string == types} | {Token.string == eggs} |{Token.string == lineage} |{Token.string == cells}|{Token.string == neurons}|{Token.string == glia} | {Token.string == glium}) ):concept --> :concept.Concept = { rule = "BioConcept1" } rule: BioConcept2 ( ( ({Token.category == JJ} | {Token.category == JJR}) {SpaceToken.kind == space} )* ( ({Token.category == NNP} | {Token.category == NNPS} | {Token.category == NN} | {Token.category == NNS}) {SpaceToken.kind == space} )* ({Token.category == NNP} | {Token.category == NNPS} | {Token.category == NN} | {Token.category == NNS}):noun ):concept --> { gate.AnnotationSet nouns = (gate.AnnotationSet)bindings.get( "noun" ); gate.AnnotationSet tokens = inputAS.get( nouns.firstNode().getOffset() ).get( "Token" ); List tokensList = new ArrayList( tokens ); Collections.sort( tokensList, new gate.util.OffsetComparator() ); Iterator tokensIter = tokensList.iterator(); gate.Annotation token = (gate.Annotation)tokensIter.next(); String sToken = (String)token.getFeatures().get( "string" ); if( sToken.endsWith( "cyte" ) || sToken.endsWith( "blast" ) || sToken.endsWith("phage") || sToken.endsWith( "clast" ) || sToken.endsWith ( "glia" ) || sToken.endsWith( "clasts" ) || sToken.endsWith ( "blasts" ) || sToken.endsWith( "glium" ) || sToken.endsWith ( "phil" ) || sToken.endsWith( "gonia" ) || sToken.endsWith ( "gonium" ) || sToken.endsWith( "cytes" ) || sToken.endsWith( "phages" ) ) { try { gate.AnnotationSet concept = (gate.AnnotationSet)bindings.get( "concept" ); outputAS.add( concept.firstNode().getOffset(), concept.lastNode().getOffset(), "Concept", Factory.newFeatureMap() ); gate.AnnotationSet concepts = inputAS.get( concept.firstNode().getOffset() ).get( "Concept" ); ((gate.Annotation)concepts.iterator().next()).getFeatures().put( "rule", "BioConcept2" ); } catch( InvalidOffsetException e ){ e.printStackTrace(); } } } macro: BioConcept ( ({BioConcept1}|{BioConcept2}) )