/** @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 Chemical(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
@Override public void process(JCas jCas) throws AnalysisEngineProcessException { try { // TODO use oscar.findResolved??? for (NamedEntity ne : oscar.findNamedEntities(// jCas.getDocumentText())) { if (RELEVANT_TYPES.contains(ne.getType())) { Chemical chemical = new Chemical(jCas, ne.getStart(), ne.getEnd()); if (ne.getConfidence() != Double.NaN) chemical.setConfidence(ne.getConfidence() + ""); if (ne.getOntIds() != null && ne.getOntIds().size() > 0) chemical.setRegistryNumber(ne.getOntIds().iterator() .next()); // TODO chemical.setType(entity.getType()); chemical.addToIndexes(); } } } catch (Exception e) { throw new AnalysisEngineProcessException(e); } }
} else if (o instanceof Chemical) { Chemical c = (Chemical) o; return "Chemical[" + c.getCoveredText() + "]reg:" + c.getRegistryNumber() + ";substname:" + c.getNameOfSubstance(); } else if (o instanceof SurfaceForm) { SurfaceForm sf = (SurfaceForm) o;
public FeatureStructure createFS(int addr, CASImpl cas) { if (Chemical_Type.this.useExistingInstance) { // Return eq fs instance if already created FeatureStructure fs = Chemical_Type.this.jcas.getJfsFromCaddr(addr); if (null == fs) { fs = new Chemical(addr, Chemical_Type.this); Chemical_Type.this.jcas.putJfsFromCaddr(addr, fs); return fs; } return fs; } else return new Chemical(addr, Chemical_Type.this); } };
/** @generated * @param jcas JCas to which this Feature Structure belongs */ public Chemical(JCas jcas) { super(jcas); readObject(); }
/** Internal - constructor used by generator * @generated * @param addr low level Feature Structure reference * @param type the type of this Feature Structure */ public Chemical(int addr, TOP_Type type) { super(addr, type); readObject(); }