public void process(JCas jCas) throws AnalysisEngineProcessException { for (DocumentBlock block : select(jCas, DocumentBlock.class)) { String label = block.getLabel(); if (label == null) label = "NOSECTIONN"; label = StringUtils.rightPad(label, 20) + " "; System.out.println(label + block.getCoveredText().replaceAll("\n", "")); } System.out.println("\n\n\n\n"); }
public void process(JCas jCas) throws AnalysisEngineProcessException { try { for (DocumentBlock block : select(jCas, DocumentBlock.class)) { String label = classify(block.getCoveredText()); if (label.equals(LABEL_INSIDE)) { block.setLabel(SECTION_REFERENCES_ENTRY); } } } catch (Exception e) { int pmId = BlueCasUtil.getHeaderIntDocId(jCas); LOG.warn("could not perform inference on " + pmId, e); } }
public void process2(JCas jCas) throws AnalysisEngineProcessException { LOG.debug(getHeaderSource(jCas) + "**************************************"); String states = ""; for (DocumentBlock block : select(jCas, DocumentBlock.class)) { if (block.getLabel() == null) { states += LABEL_OUTSIDE; LOG.debug(LABEL_OUTSIDE + "\t" + block.getCoveredText().replaceAll("\n", "")); } else if (block.getLabel().equals(SECTION_REFERENCES_ENTRY)) { states += LABEL_INSIDE; LOG.debug(LABEL_INSIDE + "\t" + block.getCoveredText().replaceAll("\n", "")); } } LOG.debug(getHeaderSource(jCas) + " " + states); LOG.debug("\n\n\n"); } }
+ ";border:1px solid " + color); htmlElt.appendChild(buildTextElt(dom, "span", b.getCoveredText(), attrs));
for (DocumentBlock block : select(jCas, DocumentBlock.class)) { if (block.getPageId() < 2) { txt += block.getCoveredText() + " ";