if (resultMatchedTextFeature != null) {
annotation.setStringValue(resultMatchedTextFeature, matchedText);
}
if (matchedTokensFeature != null) {
FSArray matchedTokens = new FSArray(getJCas(), matched.size());
FeatureStructure[] featureStructArray = new FeatureStructure[matched.size()];
matched.toArray(featureStructArray);
matchedTokens.copyFromArray(featureStructArray, 0, 0, featureStructArray.length);
annotation.setFeatureValue(matchedTokensFeature, matchedTokens);
/*
* FSArray tmp = (FSArray) annotation.getFeatureValue (matchedTokensFeature); FeatureStructure []
* tmpfs = tmp.toArray (); System.err.println ("FSArray: begin"); for (int i = 0; i <
* tmpfs.length; i++) { System.err.println (((Annotation) tmpfs[i]).getCoveredText ()); }