/** @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 Date(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
@Override public void process(JCas jCas) throws AnalysisEngineProcessException { int pmId = getHeaderIntDocId(jCas); try { if (PubmedArticleEntity.findFirst(PUBMED_ID + " = ?", pmId) == null) { PubmedArticleEntity a = new PubmedArticleEntity(); a.set(PUBMED_ID, pmId); a.set(ABSTRACT, jCas.getDocumentText()); try { Date date = JCasUtil.selectSingle(jCas, Date.class); a.set(PUBLISHED_DATE, date.getYear() + "-" + date.getMonth() + "-" + date.getDay()); } catch (Exception e) {// nope LOG.warn("could not add date to " + pmId, e); } a.set(TITLE, StringUtils.snippetizeAtSpace(getTitle(jCas), 510)); a.saveIt(); inserted++; if (processed++ % 10000 == 0) LOG.debug("processed {}\tinserted {}", processed, inserted); } } catch (Exception e) { LOG.error("could not insert " + pmId, e); } }
/** Internal - constructor used by generator * @generated * @param addr low level Feature Structure reference * @param type the type of this Feature Structure */ public Date(int addr, TOP_Type type) { super(addr, type); readObject(); }
public FeatureStructure createFS(int addr, CASImpl cas) { if (Date_Type.this.useExistingInstance) { // Return eq fs instance if already created FeatureStructure fs = Date_Type.this.jcas.getJfsFromCaddr(addr); if (null == fs) { fs = new Date(addr, Date_Type.this); Date_Type.this.jcas.putJfsFromCaddr(addr, fs); return fs; } return fs; } else return new Date(addr, Date_Type.this); } };
/** @generated * @param jcas JCas to which this Feature Structure belongs */ public Date(JCas jcas) { super(jcas); readObject(); }