@Override public void process(JCas aJCas) throws AnalysisEngineProcessException { modelProvider.configure(aJCas.getCas()); // get document text String docText = aJCas.getDocumentText(); try { List<RuleMatch> matches = modelProvider.getResource().check(docText); for (RuleMatch match : matches) { // create annotation GrammarAnomaly annotation = new GrammarAnomaly(aJCas); annotation.setBegin(match.getFromPos()); annotation.setEnd(match.getToPos()); annotation.setDescription(match.getMessage()); annotation.addToIndexes(); getContext().getLogger().log(Level.FINEST, "Found: " + annotation); } } catch (IOException e) { throw new AnalysisEngineProcessException(e); } } }