/** * Add an annotation to the JCas index, notifying UimaMonitor of the fact we have done so * * @param annot Annotation(s) to add */ public void add(Annotation... annotations) { add(Arrays.asList(annotations)); }
/** * Add an annotation to the JCas index, notifying UimaMonitor of the fact we have done so * * @param annot Annotation(s) to add */ public void add(Annotation... annotations) { add(Arrays.asList(annotations)); }
/** * Add a new annotation, which is merged from the old annotations, removing the old annotations. * * @param newAnnotation The annotation which is to be added to the document as the merged result * of the old annotations * @param annotations Annotation(s) which have been merged and should be removed */ public void mergeWithNew(Annotation newAnnotation, Collection<? extends Annotation> annotations) { add(newAnnotation); mergeWithExisting(newAnnotation, annotations); }
/** * Add an annotation to the JCas index, notifying UimaMonitor of the fact we have done so * * @param annot Annotation(s) to add */ protected void addToJCasIndex(Annotation... annotations) { getSupport().add(annotations); }
/** * Add an annotation to the JCas index, notifying UimaMonitor of the fact we have done so * * @param annotations Annotation(s) to add */ protected void addToJCasIndex(Annotation... annotations) { getSupport().add(annotations); }
/** * Add an annotation to the JCas index, notifying UimaMonitor of the fact we have done so * * @param annot Annotation(s) to add */ protected void addToJCasIndex(Collection<? extends Annotation> annotations) { getSupport().add(annotations); }
/** * Add an annotation to the JCas index, notifying UimaMonitor of the fact we have done so * * @param annot Annotation(s) to add */ protected void addToJCasIndex(Annotation... annotations) { getSupport().add(annotations); }
/** * Add an annotation to the JCas index, notifying UimaMonitor of the fact we have done so * * @param annot Annotation(s) to add */ protected void addToJCasIndex(Collection<? extends Annotation> annotations) { getSupport().add(annotations); }
/** * Add an annotation to the JCas index, notifying UimaMonitor of the fact we have done so * * @param annotations Annotation(s) to add */ protected void addToJCasIndex(Collection<? extends Annotation> annotations) { getSupport().add(annotations); }
/** * Add a new annotation, which is merged from the old annotations, removing the old annotations. * * @param newAnnotation The annotation which is to be added to the document as the merged result * of the old annotations * @param annotations Annotation(s) which have been merged and should be removed */ public void mergeWithNew(Annotation newAnnotation, Collection<? extends Annotation> annotations) { add(newAnnotation); mergeWithExisting(newAnnotation, annotations); }
/** * Add an annotation to the JCas index, notifying UimaMonitor of the fact we have done so * * @param annotations Annotation(s) to add */ protected void addToJCasIndex(Annotation... annotations) { getSupport().add(annotations); }
/** * Add an annotation to the JCas index, notifying UimaMonitor of the fact we have done so * * @param annotations Annotation(s) to add */ protected void addToJCasIndex(Collection<? extends Annotation> annotations) { getSupport().add(annotations); }
private void addMetadata(JCas jCas, Integer index, String value) { Metadata md = new Metadata(jCas); Integer colNameIndex = index; if (index >= contentColumn) colNameIndex--; if (colNameIndex >= columns.size() || columns.get(colNameIndex).trim().isEmpty()) { md.setKey("column" + (index + 1)); } else { md.setKey(columns.get(colNameIndex).trim()); } md.setValue(value); getSupport().add(md); } }
@Override protected void doGetNext(JCas jCas) throws IOException, CollectionException { InputStream is = IOUtils.toInputStream(line, Charset.defaultCharset()); extractContent(is, file.getPath() + "#" + lineNumber, jCas); Metadata md = new Metadata(jCas); md.setKey("lineNumber"); md.setValue(lineNumber.toString()); getSupport().add(md); }
@Override protected void doGetNext(JCas jCas) throws IOException, CollectionException { InputStream is = IOUtils.toInputStream(line, Charset.defaultCharset()); extractor.processStream(is, file.getPath() + "#" + lineNumber, jCas); Metadata md = new Metadata(jCas); md.setKey("lineNumber"); md.setValue(lineNumber.toString()); getSupport().add(md); }
private void addMetadata(JCas jCas, String key, String value) { Metadata md = new Metadata(jCas); md.setKey(key); md.setValue(value); getSupport().add(md); }
private void addMetadata(JCas jCas, String key, String value) { Metadata md = new Metadata(jCas); md.setKey(key); md.setValue(value); getSupport().add(md); }
private void addMetadata(JCas jCas, String key, String value) { Metadata md = new Metadata(jCas); md.setKey(key); md.setValue(value); getSupport().add(md); }
private void addMetadata(JCas jCas, String key, String value) { Metadata md = new Metadata(jCas); md.setKey(key); md.setValue(value); getSupport().add(md); }
@Test public void testAddMetadata() throws ResourceInitializationException { FakeBaleenContentExtractor annotator = new MockedBaleenContentExtractor(); annotator.initialize( new CustomResourceSpecifier_impl(), ImmutableMap.of(Resource.PARAM_UIMA_CONTEXT, context)); Metadata md = annotator.addMetadata(jCas, KEY, VALUE); verify(support).add(md); assertNull(annotator.addMetadata(jCas, "", VALUE)); assertNull(annotator.addMetadata(jCas, null, VALUE)); assertNull(annotator.addMetadata(jCas, KEY, "")); assertNull(annotator.addMetadata(jCas, KEY, null)); resetMocked(); }