/** @generated * @param jcas JCas to which this Feature Structure belongs * @param begin offset to the begin spot in the SofA * @param end offset to the end spot in the SofA */ public GrammarAnomaly(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
@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); } } }
/** Internal - constructor used by generator * @generated * @param addr low level Feature Structure reference * @param type the type of this Feature Structure */ public GrammarAnomaly(int addr, TOP_Type type) { super(addr, type); readObject(); }
/** @generated * @param jcas JCas to which this Feature Structure belongs */ public GrammarAnomaly(JCas jcas) { super(jcas); readObject(); }