public CoreMap apply(List<? extends CoreMap> in) { return merge(in, 0, in.size()); }
public CoreMap merge(List<? extends CoreMap> in) { return merge(in, 0, in.size()); }
private CoreMap createMergedChunk(int groupStart, int groupEnd) { CoreMap merged = null; /* if (annotation != null) { // Take start and end merged = ChunkAnnotationUtils.getMergedChunk(elements, annotation.get(CoreAnnotations.TextAnnotation.class), groupStart, groupEnd); } */ if (merged == null) { // Okay, have to go through these one by one and merge them merged = CoreMapAggregator.getDefaultAggregator().merge(elements, groupStart, groupEnd); } return merged; }
CoreMap merged = aggregator.merge(elements, groupStart, groupEnd); mergedElements.add(merged); last = groupEnd;
Number v2 = matched.get(matched.size()-1).get(CoreAnnotations.NumericCompositeValueAnnotation.class); if (v2.doubleValue() > v1.doubleValue()) { CoreMap newChunk = CoreMapAggregator.getDefaultAggregator().merge(numerizedTokens, matcher.start(), matcher.end()); newChunk.set(CoreAnnotations.NumericCompositeTypeAnnotation.class, "NUMBER_RANGE"); Pair<Number,Number> range = new Pair<>(v1, v2);
List<CoreMap> mergedNumbers = numberAggregator.merge(annotation.get(CoreAnnotations.TokensAnnotation.class), numbers, in -> Interval.toInterval( in.get(CoreAnnotations.TokenBeginAnnotation.class) - startTokenOffsetFinal,
protected boolean extractAnnotation(List<? extends CoreMap> source, CoreMapAggregator aggregator) { annotation = aggregator.merge(source, chunkOffsets.getBegin(), chunkOffsets.getEnd()); charOffsets = Interval.toInterval(annotation.get(CoreAnnotations.CharacterOffsetBeginAnnotation.class), annotation.get(CoreAnnotations.CharacterOffsetEndAnnotation.class), Interval.INTERVAL_OPEN_END); tokenOffsets = Interval.toInterval(annotation.get(CoreAnnotations.TokenBeginAnnotation.class), annotation.get(CoreAnnotations.TokenEndAnnotation.class), Interval.INTERVAL_OPEN_END); text = annotation.get(CoreAnnotations.TextAnnotation.class); extractFunc.annotate(this, source.subList(chunkOffsets.getBegin(), chunkOffsets.getEnd())); return true; }
Class<TypesafeMap.Key<List<? extends CoreMap>>> tokensAnnotationKey = extractFunc.tokensAnnotationField; if (chunkOffsets != null) { annotation = aggregator.merge((List<? extends CoreMap>) sourceAnnotation.get(tokensAnnotationKey), chunkOffsets.getBegin(), chunkOffsets.getEnd()); if (sourceAnnotation.containsKey(CoreAnnotations.TextAnnotation.class)) { CoreMap annotation2 = aggregator.merge((List<? extends CoreMap>) sourceAnnotation.get(tokensAnnotationKey), chunkOffsets.getBegin(), chunkOffsets.getEnd());
public CoreMap apply(List<? extends CoreMap> in) { return merge(in, 0, in.size()); }
public CoreMap merge(List<? extends CoreMap> in) { return merge(in, 0, in.size()); }
public CoreMap apply(List<? extends CoreMap> in) { return merge(in, 0, in.size()); }
public CoreMap merge(List<? extends CoreMap> in) { return merge(in, 0, in.size()); }
public CoreMap apply(List<? extends CoreMap> in) { return merge(in, 0, in.size()); }
public CoreMap apply(List<? extends CoreMap> in) { return merge(in, 0, in.size()); }
private CoreMap createMergedChunk(int groupStart, int groupEnd) { CoreMap merged = null; /* if (annotation != null) { // Take start and end merged = ChunkAnnotationUtils.getMergedChunk(elements, annotation.get(CoreAnnotations.TextAnnotation.class), groupStart, groupEnd); } */ if (merged == null) { // Okay, have to go through these one by one and merge them merged = CoreMapAggregator.getDefaultAggregator().merge(elements, groupStart, groupEnd); } return merged; }
private CoreMap createMergedChunk(int groupStart, int groupEnd) { CoreMap merged = null; /* if (annotation != null) { // Take start and end merged = ChunkAnnotationUtils.getMergedChunk(elements, annotation.get(CoreAnnotations.TextAnnotation.class), groupStart, groupEnd); } */ if (merged == null) { // Okay, have to go through these one by one and merge them merged = CoreMapAggregator.getDefaultAggregator().merge(elements, groupStart, groupEnd); } return merged; }
protected boolean extractAnnotation(List<? extends CoreMap> source, CoreMapAggregator aggregator) { annotation = aggregator.merge(source, chunkOffsets.getBegin(), chunkOffsets.getEnd()); charOffsets = Interval.toInterval(annotation.get(CoreAnnotations.CharacterOffsetBeginAnnotation.class), annotation.get(CoreAnnotations.CharacterOffsetEndAnnotation.class), Interval.INTERVAL_OPEN_END); tokenOffsets = Interval.toInterval(annotation.get(CoreAnnotations.TokenBeginAnnotation.class), annotation.get(CoreAnnotations.TokenEndAnnotation.class), Interval.INTERVAL_OPEN_END); text = annotation.get(CoreAnnotations.TextAnnotation.class); extractFunc.annotate(this, source.subList(chunkOffsets.getBegin(), chunkOffsets.getEnd())); return true; }
protected boolean extractAnnotation(List<? extends CoreMap> source, CoreMapAggregator aggregator) { annotation = aggregator.merge(source, chunkOffsets.getBegin(), chunkOffsets.getEnd()); charOffsets = Interval.toInterval(annotation.get(CoreAnnotations.CharacterOffsetBeginAnnotation.class), annotation.get(CoreAnnotations.CharacterOffsetEndAnnotation.class), Interval.INTERVAL_OPEN_END); tokenOffsets = Interval.toInterval(annotation.get(CoreAnnotations.TokenBeginAnnotation.class), annotation.get(CoreAnnotations.TokenEndAnnotation.class), Interval.INTERVAL_OPEN_END); text = annotation.get(CoreAnnotations.TextAnnotation.class); extractFunc.annotate(this, source.subList(chunkOffsets.getBegin(), chunkOffsets.getEnd())); return true; }
List<CoreMap> mergedNumbers = numberAggregator.merge(annotation.get(CoreAnnotations.TokensAnnotation.class), numbers, new Function<CoreMap, Interval<Integer>>() { public Interval<Integer> apply(CoreMap in) {
Class<TypesafeMap.Key<List<? extends CoreMap>>> tokensAnnotationKey = extractFunc.tokensAnnotationField; if (chunkOffsets != null) { annotation = aggregator.merge((List<? extends CoreMap>) sourceAnnotation.get(tokensAnnotationKey), chunkOffsets.getBegin(), chunkOffsets.getEnd()); if (sourceAnnotation.containsKey(CoreAnnotations.TextAnnotation.class)) { CoreMap annotation2 = aggregator.merge((List<? extends CoreMap>) sourceAnnotation.get(tokensAnnotationKey), chunkOffsets.getBegin(), chunkOffsets.getEnd());