/** @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 XmiMetaData(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
xmiMetaData.removeFromIndexes(); XmiMetaData xmiMetaData = new XmiMetaData(aCAS); xmiMetaData.setMaxXmiId(xmiId); log.trace("Retrieved max xmi ID {} for document {}.", xmiMetaData.getMaxXmiId(), docId); xmiMetaData.setSofaIdMappings(mappingsArray); xmiMetaData.addToIndexes();
nextXmiId = JCasUtil.selectSingle(aJCas, XmiMetaData.class).getMaxXmiId(); } catch (IllegalArgumentException e) {
/** Internal - constructor used by generator * @generated * @param addr low level Feature Structure reference * @param type the type of this Feature Structure */ public XmiMetaData(int addr, TOP_Type type) { super(addr, type); readObject(); }
/** * Reads all {@link XmiMetaData} types from the CAS index, writes the * actual sofa xmi:id to sofaID mapping into a map, removes the annotations * from the index and returns the map. * * @param aJCas * @param docId * @return */ private Map<String, Integer> getOriginalSofaIdMappings(JCas aJCas, DocumentId docId) { if (storeAll) return Collections.emptyMap(); XmiMetaData xmiMetaData; try { xmiMetaData = JCasUtil.selectSingle(aJCas, XmiMetaData.class); if (xmiMetaData.getSofaIdMappings() == null) return Collections.emptyMap(); } catch (IllegalArgumentException e) { // in case there is no XMI meta data return Collections.emptyMap(); } // note that we change the mapping orientation; originally stored // was xmiID:sofaID[sofaName]; but for the XmiSplitter input we need // it the other way round. Map<String, Integer> map = Stream.of(xmiMetaData.getSofaIdMappings().toArray()).map(line -> line.split("=")) .collect(Collectors.toMap(split -> split[1], split -> Integer.parseInt(split[0]))); log.trace("Got Sofa XMI map from the CAS: {} for document {}", map, docId); return map; }
/** @generated * @param jcas JCas to which this Feature Structure belongs */ public XmiMetaData(JCas jcas) { super(jcas); readObject(); }