@knaw-huc/text-annotation-segmenter 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export type { AnnotationSegmentsByChar } from './segment.ts';
3
3
  export { findSegmentOffsets } from './findSegmentOffsets.ts';
4
4
  export type { SegmentOffsets } from './findSegmentOffsets.ts';
5
5
  export { groupSegments } from './groupSegments.ts';
6
+ export { collectGroupSegments } from './collectGroupSegments.ts';
6
7
  export type { Group, SegmentGroup } from './groupSegments.ts';
7
8
  export type { Offsets, TextSegment, SegmentIndex, MarkerPosition, } from './Model.ts';
8
9
  export type { GetOffsets } from './GetOffsets.ts';
package/dist/index.js CHANGED
@@ -95,7 +95,13 @@ function createUngrouped(segments) {
95
95
  segments
96
96
  };
97
97
  }
98
+ function collectGroupSegments(group2) {
99
+ return group2.children.flatMap(
100
+ (child) => child.isGroup ? collectGroupSegments(child) : child.segments
101
+ );
102
+ }
98
103
  export {
104
+ collectGroupSegments,
99
105
  findSegmentOffsets,
100
106
  groupSegments,
101
107
  segment
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knaw-huc/text-annotation-segmenter",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/knaw-huc/text-annotation-segmenter.git"