public void process ( CAS tcas ) { final AnnotationComboIterator comboIterator = new AnnotationComboIterator ( tcas , mSentenceType , mTokenType ) ; for ( AnnotationIteratorPair annotationIteratorPair : comboIterator ) { final List < AnnotationFS > sentenceTokenAnnotationList = new LinkedList < AnnotationFS > ( ) ; final List < String > sentenceTokenList = new LinkedList < String > ( ) ; final List < String > sentenceTagsList = new LinkedList < String > ( ) ; for ( AnnotationFS tokenAnnotation : annotationIteratorPair . getSubIterator ( ) ) { sentenceTokenAnnotationList . add ( tokenAnnotation ) ; sentenceTokenList . add ( tokenAnnotation . getFeatureValueAsString ( mLexemeFeature ) ) ; sentenceTagsList . add ( tokenAnnotation . getFeatureValueAsString ( mPosFeature ) ) ; } String [ ] toks = sentenceTokenList . toArray ( new String [ sentenceTokenList . size ( ) ] ) ; String [ ] tags = sentenceTagsList . toArray ( new String [ sentenceTagsList . size ( ) ] ) ; String [ ] featureTag = mFeaturizer . featurize ( toks , tags ) ; final Iterator < AnnotationFS > sentenceTokenIterator = sentenceTokenAnnotationList . iterator ( ) ; int index = 0 ; while ( sentenceTokenIterator . hasNext ( ) ) { final AnnotationFS tokenAnnotation = sentenceTokenIterator . next ( ) ; tokenAnnotation . setStringValue ( mFeaturizerFeature , featureTag [ index ] ) ; index ++ ; } } }
Performs featurizer on the given tcas object .