- *
- * int64 id = 1;
- * @return The id.
- */
- long getId();
-
- /**
- *
- * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
- * This is required due to the text and position coordinates not being equal.
- *
- *
- * repeated int32 stringIdxToPositionIdx = 2;
- * @return A list containing the stringIdxToPositionIdx.
- */
- java.util.List getStringIdxToPositionIdxList();
- /**
- *
- * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
- * This is required due to the text and position coordinates not being equal.
- *
- *
- * repeated int32 stringIdxToPositionIdx = 2;
- * @return The count of stringIdxToPositionIdx.
- */
- int getStringIdxToPositionIdxCount();
- /**
- *
- * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
- * This is required due to the text and position coordinates not being equal.
- *
- *
- * repeated int32 stringIdxToPositionIdx = 2;
- * @param index The index of the element to return.
- * @return The stringIdxToPositionIdx at the given index.
- */
- int getStringIdxToPositionIdx(int index);
-
- /**
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- *
- * repeated .DocumentPositionData.Position positions = 3;
- */
- com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.PositionOrBuilder getPositionsOrBuilder(
- int index);
- }
- /**
- * Protobuf type {@code DocumentPositionData}
- */
- public static final class DocumentPositionData extends
- com.google.protobuf.GeneratedMessage implements
- // @@protoc_insertion_point(message_implements:DocumentPositionData)
- DocumentPositionDataOrBuilder {
- private static final long serialVersionUID = 0L;
- static {
- com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
- com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
- /* major= */ 4,
- /* minor= */ 28,
- /* patch= */ 3,
- /* suffix= */ "",
- DocumentPositionData.class.getName());
- }
- // Use DocumentPositionData.newBuilder() to construct.
- private DocumentPositionData(com.google.protobuf.GeneratedMessage.Builder> builder) {
- super(builder);
- }
- private DocumentPositionData() {
- stringIdxToPositionIdx_ = emptyIntList();
- positions_ = java.util.Collections.emptyList();
- }
-
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.internal_static_DocumentPositionData_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.internal_static_DocumentPositionData_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.class, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Builder.class);
- }
-
- public interface PositionOrBuilder extends
- // @@protoc_insertion_point(interface_extends:DocumentPositionData.Position)
- com.google.protobuf.MessageOrBuilder {
-
- /**
- * repeated float value = 1;
- * @return A list containing the value.
- */
- java.util.List getValueList();
- /**
- * repeated float value = 1;
- * @return The count of value.
- */
- int getValueCount();
- /**
- * repeated float value = 1;
- * @param index The index of the element to return.
- * @return The value at the given index.
- */
- float getValue(int index);
- }
- /**
- *
- * Definition of a BoundingBox that contains x, y, width, and height.
- *
- * Definition of a BoundingBox that contains x, y, width, and height.
- *
- *
- * Protobuf type {@code DocumentPositionData.Position}
- */
- public static final class Builder extends
- com.google.protobuf.GeneratedMessage.Builder implements
- // @@protoc_insertion_point(builder_implements:DocumentPositionData.Position)
- com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.PositionOrBuilder {
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.internal_static_DocumentPositionData_Position_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.internal_static_DocumentPositionData_Position_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position.class, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position.Builder.class);
- }
-
- // Construct using com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position.newBuilder()
- private Builder() {
-
- }
-
- private Builder(
- com.google.protobuf.GeneratedMessage.BuilderParent parent) {
- super(parent);
-
- }
- @java.lang.Override
- public Builder clear() {
- super.clear();
- bitField0_ = 0;
- value_ = emptyFloatList();
- return this;
- }
-
- @java.lang.Override
- public com.google.protobuf.Descriptors.Descriptor
- getDescriptorForType() {
- return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.internal_static_DocumentPositionData_Position_descriptor;
- }
-
- @java.lang.Override
- public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position getDefaultInstanceForType() {
- return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position.getDefaultInstance();
- }
-
- @java.lang.Override
- public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position build() {
- com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(result);
- }
- return result;
- }
-
- @java.lang.Override
- public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position buildPartial() {
- com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position result = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position(this);
- if (bitField0_ != 0) { buildPartial0(result); }
- onBuilt();
- return result;
- }
-
- private void buildPartial0(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position result) {
- int from_bitField0_ = bitField0_;
- if (((from_bitField0_ & 0x00000001) != 0)) {
- value_.makeImmutable();
- result.value_ = value_;
- }
- }
-
- @java.lang.Override
- public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position) {
- return mergeFrom((com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position)other);
- } else {
- super.mergeFrom(other);
- return this;
- }
- }
-
- public Builder mergeFrom(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position other) {
- if (other == com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position.getDefaultInstance()) return this;
- if (!other.value_.isEmpty()) {
- if (value_.isEmpty()) {
- value_ = other.value_;
- value_.makeImmutable();
- bitField0_ |= 0x00000001;
- } else {
- ensureValueIsMutable();
- value_.addAll(other.value_);
- }
- onChanged();
- }
- this.mergeUnknownFields(other.getUnknownFields());
- onChanged();
- return this;
- }
-
- @java.lang.Override
- public final boolean isInitialized() {
- return true;
- }
-
- @java.lang.Override
- public Builder mergeFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- if (extensionRegistry == null) {
- throw new java.lang.NullPointerException();
- }
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- case 13: {
- float v = input.readFloat();
- ensureValueIsMutable();
- value_.addFloat(v);
- break;
- } // case 13
- case 10: {
- int length = input.readRawVarint32();
- int limit = input.pushLimit(length);
- int alloc = length > 4096 ? 4096 : length;
- ensureValueIsMutable(alloc / 4);
- while (input.getBytesUntilLimit() > 0) {
- value_.addFloat(input.readFloat());
- }
- input.popLimit(limit);
- break;
- } // case 10
- default: {
- if (!super.parseUnknownField(input, extensionRegistry, tag)) {
- done = true; // was an endgroup tag
- }
- break;
- } // default:
- } // switch (tag)
- } // while (!done)
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.unwrapIOException();
- } finally {
- onChanged();
- } // finally
- return this;
- }
- private int bitField0_;
-
- private com.google.protobuf.Internal.FloatList value_ = emptyFloatList();
- private void ensureValueIsMutable() {
- if (!value_.isModifiable()) {
- value_ = makeMutableCopy(value_);
- }
- bitField0_ |= 0x00000001;
- }
- private void ensureValueIsMutable(int capacity) {
- if (!value_.isModifiable()) {
- value_ = makeMutableCopy(value_, capacity);
- }
- bitField0_ |= 0x00000001;
- }
- /**
- * repeated float value = 1;
- * @return A list containing the value.
- */
- public java.util.List
- getValueList() {
- value_.makeImmutable();
- return value_;
- }
- /**
- * repeated float value = 1;
- * @return The count of value.
- */
- public int getValueCount() {
- return value_.size();
- }
- /**
- * repeated float value = 1;
- * @param index The index of the element to return.
- * @return The value at the given index.
- */
- public float getValue(int index) {
- return value_.getFloat(index);
- }
- /**
- * repeated float value = 1;
- * @param index The index to set the value at.
- * @param value The value to set.
- * @return This builder for chaining.
- */
- public Builder setValue(
- int index, float value) {
-
- ensureValueIsMutable();
- value_.setFloat(index, value);
- bitField0_ |= 0x00000001;
- onChanged();
- return this;
- }
- /**
- * repeated float value = 1;
- * @param value The value to add.
- * @return This builder for chaining.
- */
- public Builder addValue(float value) {
-
- ensureValueIsMutable();
- value_.addFloat(value);
- bitField0_ |= 0x00000001;
- onChanged();
- return this;
- }
- /**
- * repeated float value = 1;
- * @param values The value to add.
- * @return This builder for chaining.
- */
- public Builder addAllValue(
- java.lang.Iterable extends java.lang.Float> values) {
- ensureValueIsMutable();
- com.google.protobuf.AbstractMessageLite.Builder.addAll(
- values, value_);
- bitField0_ |= 0x00000001;
- onChanged();
- return this;
- }
- /**
- * repeated float value = 1;
- * @return This builder for chaining.
- */
- public Builder clearValue() {
- value_ = emptyFloatList();
- bitField0_ = (bitField0_ & ~0x00000001);
- onChanged();
- return this;
- }
-
- // @@protoc_insertion_point(builder_scope:DocumentPositionData.Position)
- }
-
- // @@protoc_insertion_point(class_scope:DocumentPositionData.Position)
- private static final com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position DEFAULT_INSTANCE;
- static {
- DEFAULT_INSTANCE = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position();
- }
-
- public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position getDefaultInstance() {
- return DEFAULT_INSTANCE;
- }
-
- private static final com.google.protobuf.Parser
- PARSER = new com.google.protobuf.AbstractParser() {
- @java.lang.Override
- public Position parsePartialFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- Builder builder = newBuilder();
- try {
- builder.mergeFrom(input, extensionRegistry);
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(builder.buildPartial());
- } catch (com.google.protobuf.UninitializedMessageException e) {
- throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(e)
- .setUnfinishedMessage(builder.buildPartial());
- }
- return builder.buildPartial();
- }
- };
-
- public static com.google.protobuf.Parser parser() {
- return PARSER;
- }
-
- @java.lang.Override
- public com.google.protobuf.Parser getParserForType() {
- return PARSER;
- }
-
- @java.lang.Override
- public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position getDefaultInstanceForType() {
- return DEFAULT_INSTANCE;
- }
-
- }
-
- public static final int ID_FIELD_NUMBER = 1;
- private long id_ = 0L;
- /**
- *
- * Identifier of the text block.
- *
- *
- * int64 id = 1;
- * @return The id.
- */
- @java.lang.Override
- public long getId() {
- return id_;
- }
-
- public static final int STRINGIDXTOPOSITIONIDX_FIELD_NUMBER = 2;
- @SuppressWarnings("serial")
- private com.google.protobuf.Internal.IntList stringIdxToPositionIdx_ =
- emptyIntList();
- /**
- *
- * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
- * This is required due to the text and position coordinates not being equal.
- *
- *
- * repeated int32 stringIdxToPositionIdx = 2;
- * @return A list containing the stringIdxToPositionIdx.
- */
- @java.lang.Override
- public java.util.List
- getStringIdxToPositionIdxList() {
- return stringIdxToPositionIdx_;
- }
- /**
- *
- * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
- * This is required due to the text and position coordinates not being equal.
- *
- *
- * repeated int32 stringIdxToPositionIdx = 2;
- * @return The count of stringIdxToPositionIdx.
- */
- public int getStringIdxToPositionIdxCount() {
- return stringIdxToPositionIdx_.size();
- }
- /**
- *
- * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
- * This is required due to the text and position coordinates not being equal.
- *
- *
- * repeated int32 stringIdxToPositionIdx = 2;
- * @param index The index of the element to return.
- * @return The stringIdxToPositionIdx at the given index.
- */
- public int getStringIdxToPositionIdx(int index) {
- return stringIdxToPositionIdx_.getInt(index);
- }
- private int stringIdxToPositionIdxMemoizedSerializedSize = -1;
-
- public static final int POSITIONS_FIELD_NUMBER = 3;
- @SuppressWarnings("serial")
- private java.util.List positions_;
- /**
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
- * This is required due to the text and position coordinates not being equal.
- *
- *
- * repeated int32 stringIdxToPositionIdx = 2;
- * @return A list containing the stringIdxToPositionIdx.
- */
- public java.util.List
- getStringIdxToPositionIdxList() {
- stringIdxToPositionIdx_.makeImmutable();
- return stringIdxToPositionIdx_;
- }
- /**
- *
- * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
- * This is required due to the text and position coordinates not being equal.
- *
- *
- * repeated int32 stringIdxToPositionIdx = 2;
- * @return The count of stringIdxToPositionIdx.
- */
- public int getStringIdxToPositionIdxCount() {
- return stringIdxToPositionIdx_.size();
- }
- /**
- *
- * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
- * This is required due to the text and position coordinates not being equal.
- *
- *
- * repeated int32 stringIdxToPositionIdx = 2;
- * @param index The index of the element to return.
- * @return The stringIdxToPositionIdx at the given index.
- */
- public int getStringIdxToPositionIdx(int index) {
- return stringIdxToPositionIdx_.getInt(index);
- }
- /**
- *
- * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
- * This is required due to the text and position coordinates not being equal.
- *
- *
- * repeated int32 stringIdxToPositionIdx = 2;
- * @param index The index to set the value at.
- * @param value The stringIdxToPositionIdx to set.
- * @return This builder for chaining.
- */
- public Builder setStringIdxToPositionIdx(
- int index, int value) {
-
- ensureStringIdxToPositionIdxIsMutable();
- stringIdxToPositionIdx_.setInt(index, value);
- bitField0_ |= 0x00000002;
- onChanged();
- return this;
- }
- /**
- *
- * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
- * This is required due to the text and position coordinates not being equal.
- *
- *
- * repeated int32 stringIdxToPositionIdx = 2;
- * @param value The stringIdxToPositionIdx to add.
- * @return This builder for chaining.
- */
- public Builder addStringIdxToPositionIdx(int value) {
-
- ensureStringIdxToPositionIdxIsMutable();
- stringIdxToPositionIdx_.addInt(value);
- bitField0_ |= 0x00000002;
- onChanged();
- return this;
- }
- /**
- *
- * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
- * This is required due to the text and position coordinates not being equal.
- *
- * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
- * This is required due to the text and position coordinates not being equal.
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- *
- *
- * repeated .DocumentPositionData.Position positions = 3;
- */
- public java.util.List
- getPositionsBuilderList() {
- return getPositionsFieldBuilder().getBuilderList();
- }
- private com.google.protobuf.RepeatedFieldBuilder<
- com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position.Builder, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.PositionOrBuilder>
- getPositionsFieldBuilder() {
- if (positionsBuilder_ == null) {
- positionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
- com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position.Builder, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.PositionOrBuilder>(
- positions_,
- ((bitField0_ & 0x00000004) != 0),
- getParentForChildren(),
- isClean());
- positions_ = null;
- }
- return positionsBuilder_;
- }
-
- // @@protoc_insertion_point(builder_scope:DocumentPositionData)
- }
-
- // @@protoc_insertion_point(class_scope:DocumentPositionData)
- private static final com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData DEFAULT_INSTANCE;
- static {
- DEFAULT_INSTANCE = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData();
- }
-
- public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData getDefaultInstance() {
- return DEFAULT_INSTANCE;
- }
-
- private static final com.google.protobuf.Parser
- PARSER = new com.google.protobuf.AbstractParser() {
- @java.lang.Override
- public DocumentPositionData parsePartialFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- Builder builder = newBuilder();
- try {
- builder.mergeFrom(input, extensionRegistry);
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(builder.buildPartial());
- } catch (com.google.protobuf.UninitializedMessageException e) {
- throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(e)
- .setUnfinishedMessage(builder.buildPartial());
- }
- return builder.buildPartial();
- }
- };
-
- public static com.google.protobuf.Parser parser() {
- return PARSER;
- }
-
- @java.lang.Override
- public com.google.protobuf.Parser getParserForType() {
- return PARSER;
- }
-
- @java.lang.Override
- public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData getDefaultInstanceForType() {
- return DEFAULT_INSTANCE;
- }
-
- }
-
- private static final com.google.protobuf.Descriptors.Descriptor
- internal_static_AllDocumentPositionData_descriptor;
- private static final
- com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internal_static_AllDocumentPositionData_fieldAccessorTable;
- private static final com.google.protobuf.Descriptors.Descriptor
- internal_static_DocumentPositionData_descriptor;
- private static final
- com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internal_static_DocumentPositionData_fieldAccessorTable;
- private static final com.google.protobuf.Descriptors.Descriptor
- internal_static_DocumentPositionData_Position_descriptor;
- private static final
- com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internal_static_DocumentPositionData_Position_fieldAccessorTable;
-
- public static com.google.protobuf.Descriptors.FileDescriptor
- getDescriptor() {
- return descriptor;
- }
- private static com.google.protobuf.Descriptors.FileDescriptor
- descriptor;
- static {
- java.lang.String[] descriptorData = {
- "\n\032DocumentPositionData.proto\"N\n\027AllDocum" +
- "entPositionData\0223\n\024documentPositionData\030" +
- "\001 \003(\0132\025.DocumentPositionData\"\220\001\n\024Documen" +
- "tPositionData\022\n\n\002id\030\001 \001(\003\022\036\n\026stringIdxTo" +
- "PositionIdx\030\002 \003(\005\0221\n\tpositions\030\003 \003(\0132\036.D" +
- "ocumentPositionData.Position\032\031\n\010Position" +
- "\022\r\n\005value\030\001 \003(\002Bc\nFcom.knecon.fforesight" +
- ".service.layoutparser.internal.api.data." +
- "redactionB\031DocumentPositionDataProtob\006pr" +
- "oto3"
- };
- descriptor = com.google.protobuf.Descriptors.FileDescriptor
- .internalBuildGeneratedFileFrom(descriptorData,
- new com.google.protobuf.Descriptors.FileDescriptor[] {
- });
- internal_static_AllDocumentPositionData_descriptor =
- getDescriptor().getMessageTypes().get(0);
- internal_static_AllDocumentPositionData_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessage.FieldAccessorTable(
- internal_static_AllDocumentPositionData_descriptor,
- new java.lang.String[] { "DocumentPositionData", });
- internal_static_DocumentPositionData_descriptor =
- getDescriptor().getMessageTypes().get(1);
- internal_static_DocumentPositionData_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessage.FieldAccessorTable(
- internal_static_DocumentPositionData_descriptor,
- new java.lang.String[] { "Id", "StringIdxToPositionIdx", "Positions", });
- internal_static_DocumentPositionData_Position_descriptor =
- internal_static_DocumentPositionData_descriptor.getNestedTypes().get(0);
- internal_static_DocumentPositionData_Position_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessage.FieldAccessorTable(
- internal_static_DocumentPositionData_Position_descriptor,
- new java.lang.String[] { "Value", });
- descriptor.resolveAllFeaturesImmutable();
- }
-
- // @@protoc_insertion_point(outer_class_scope)
-}
diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentStructure.java b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentStructure.java
deleted file mode 100644
index 4bf9558..0000000
--- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentStructure.java
+++ /dev/null
@@ -1,173 +0,0 @@
-package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction;
-
-import java.awt.geom.Rectangle2D;
-import java.io.Serializable;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Stream;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.AccessLevel;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import lombok.experimental.FieldDefaults;
-
-@Deprecated
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-@FieldDefaults(level = AccessLevel.PRIVATE)
-@Schema(description = "Object containing information about the parsed tree structure of the SemanticNodes, such as Section, Paragraph, Headline etc inside of the document.")
-public class DocumentStructure implements Serializable {
-
- @Schema(description = "The root EntryData represents the Document.")
- EntryData root;
-
- @Schema(description = "Object containing the extra field names, a table has in its properties field.")
- public static class TableProperties implements Serializable {
-
- public static final String NUMBER_OF_ROWS = "numberOfRows";
- public static final String NUMBER_OF_COLS = "numberOfCols";
-
- }
-
- @Schema(description = "Object containing the extra field names, an Image has in its properties field.")
- public static class ImageProperties implements Serializable {
-
- public static final String TRANSPARENT = "transparent";
- public static final String IMAGE_TYPE = "imageType";
- public static final String POSITION = "position";
- public static final String ID = "id";
-
- public static final String REPRESENTATION_HASH = "representationHash";
-
- }
-
- @Schema(description = "Object containing the extra field names, a table cell has in its properties field.")
- public static class TableCellProperties implements Serializable {
-
- public static final String B_BOX = "bBox";
- public static final String ROW = "row";
- public static final String COL = "col";
- public static final String HEADER = "header";
-
- }
-
- @Schema(description = "Object containing the extra field names, a duplicate paragraph has in its properties field.")
- public static class DuplicateParagraphProperties implements Serializable {
-
- public static final String UNSORTED_TEXTBLOCK_ID = "utbid";
-
- }
-
- public static final String RECTANGLE_DELIMITER = ";";
-
-
- public static Rectangle2D parseRectangle2D(String bBox) {
-
- List floats = Arrays.stream(bBox.split(RECTANGLE_DELIMITER))
- .map(Float::parseFloat)
- .toList();
- return new Rectangle2D.Float(floats.get(0), floats.get(1), floats.get(2), floats.get(3));
- }
-
-
- public static double[] parseRepresentationVector(String representationHash) {
-
- String[] stringArray = representationHash.split("[,\\s]+");
- double[] doubleArray = new double[stringArray.length];
- for (int i = 0; i < stringArray.length; i++) {
- doubleArray[i] = Double.parseDouble(stringArray[i]);
- }
-
- return doubleArray;
- }
-
-
- public EntryData get(List tocId) {
-
- if (tocId.isEmpty()) {
- return root;
- }
- EntryData entry = root.children.get(tocId.get(0));
- for (int id : tocId.subList(1, tocId.size())) {
- entry = entry.children.get(id);
- }
- return entry;
- }
-
-
- public Stream streamAllEntries() {
-
- return Stream.concat(Stream.of(root), root.children.stream())
- .flatMap(DocumentStructure::flatten);
- }
-
-
- public String toString() {
-
- return String.join("\n",
- streamAllEntries().map(EntryData::toString)
- .toList());
- }
-
-
- private static Stream flatten(EntryData entry) {
-
- return Stream.concat(Stream.of(entry),
- entry.children.stream()
- .flatMap(DocumentStructure::flatten));
- }
-
-
- @Data
- @Builder
- @NoArgsConstructor
- @AllArgsConstructor
- @FieldDefaults(level = AccessLevel.PRIVATE)
- @Schema(description = "Object containing information of a SemanticNode and also structuring the layout with children.")
- public static class EntryData implements Serializable {
-
- @Schema(description = "Type of the semantic node.", allowableValues = {"DOCUMENT", "SECTION", "PARAGRAPH", "HEADLINE", "TABLE", "TABLE_CELL", "HEADER", "FOOTER", "IMAGE"})
- NodeType type;
- @Schema(description = "Specifies the position in the parsed tree structure.", example = "[1, 0, 2]")
- int[] treeId;
- @Schema(description = "Specifies the text block IDs associated with this semantic node. The value should be joined with the DocumentTextData/DocumentPositionData. Is empty, if no text block is directly associated with this semantic node. Only Paragraph, Headline, Header or Footer is directly associated with a text block.", example = "[1]")
- Long[] atomicBlockIds;
- @Schema(description = "Specifies the pages this semantic node appears on. The value should be joined with the PageData.", example = "[1, 2, 3]")
- Long[] pageNumbers;
- @Schema(description = "Some semantic nodes have additional information, this information is stored in this Map. The extra fields are specified by the Properties subclasses.", example = "For a Table: {\"numberOfRows\": 3, \"numberOfCols\": 4}")
- Map properties;
- @Schema(description = "All child Entries of this Entry.", example = "[1, 2, 3]")
- List children;
- @Schema(description = "Describes the origin of the semantic node", example = "[ALGORITHM]")
- Set engines;
-
-
- @Override
- public String toString() {
-
- StringBuilder sb = new StringBuilder();
- sb.append("[");
- for (int i : treeId) {
- sb.append(i);
- sb.append(",");
- }
- sb.delete(sb.length() - 1, sb.length());
- sb.append("]: ");
-
- sb.append(type);
- sb.append(" atbs = ");
- sb.append(atomicBlockIds.length);
-
- return sb.toString();
- }
-
- }
-
-}
diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentStructureProto.java b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentStructureProto.java
deleted file mode 100644
index 7604748..0000000
--- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentStructureProto.java
+++ /dev/null
@@ -1,694 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-// NO CHECKED-IN PROTOBUF GENCODE
-// source: DocumentStructure.proto
-// Protobuf Java Version: 4.28.3
-
-package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction;
-
-public final class DocumentStructureProto {
- private DocumentStructureProto() {}
- static {
- com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
- com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
- /* major= */ 4,
- /* minor= */ 28,
- /* patch= */ 3,
- /* suffix= */ "",
- DocumentStructureProto.class.getName());
- }
- public static void registerAllExtensions(
- com.google.protobuf.ExtensionRegistryLite registry) {
- }
-
- public static void registerAllExtensions(
- com.google.protobuf.ExtensionRegistry registry) {
- registerAllExtensions(
- (com.google.protobuf.ExtensionRegistryLite) registry);
- }
- public interface DocumentStructureOrBuilder extends
- // @@protoc_insertion_point(interface_extends:DocumentStructure)
- com.google.protobuf.MessageOrBuilder {
-
- /**
- *
- * The root EntryData represents the Document.
- *
- *
- * .EntryData root = 1;
- * @return Whether the root field is set.
- */
- boolean hasRoot();
- /**
- *
- * The root EntryData represents the Document.
- *
- * The text blocks are ordered, this number represents the end of the text block as a string offset.
- *
- *
- * int32 end = 6;
- * @return The end.
- */
- int getEnd();
-
- /**
- *
- * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
- *
- *
- * repeated int32 lineBreaks = 7;
- * @return A list containing the lineBreaks.
- */
- java.util.List getLineBreaksList();
- /**
- *
- * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
- *
- *
- * repeated int32 lineBreaks = 7;
- * @return The count of lineBreaks.
- */
- int getLineBreaksCount();
- /**
- *
- * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
- *
- *
- * repeated int32 lineBreaks = 7;
- * @param index The index of the element to return.
- * @return The lineBreaks at the given index.
- */
- int getLineBreaks(int index);
- }
- /**
- * Protobuf type {@code DocumentTextData}
- */
- public static final class DocumentTextData extends
- com.google.protobuf.GeneratedMessage implements
- // @@protoc_insertion_point(message_implements:DocumentTextData)
- DocumentTextDataOrBuilder {
- private static final long serialVersionUID = 0L;
- static {
- com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
- com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
- /* major= */ 4,
- /* minor= */ 28,
- /* patch= */ 3,
- /* suffix= */ "",
- DocumentTextData.class.getName());
- }
- // Use DocumentTextData.newBuilder() to construct.
- private DocumentTextData(com.google.protobuf.GeneratedMessage.Builder> builder) {
- super(builder);
- }
- private DocumentTextData() {
- searchText_ = "";
- lineBreaks_ = emptyIntList();
- }
-
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.internal_static_DocumentTextData_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.internal_static_DocumentTextData_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData.class, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData.Builder.class);
- }
-
- public static final int ID_FIELD_NUMBER = 1;
- private long id_ = 0L;
- /**
- *
- * Identifier of the text block.
- *
- *
- * int64 id = 1;
- * @return The id.
- */
- @java.lang.Override
- public long getId() {
- return id_;
- }
-
- public static final int PAGE_FIELD_NUMBER = 2;
- private long page_ = 0L;
- /**
- *
- * The page the text block occurs on.
- *
- *
- * int64 page = 2;
- * @return The page.
- */
- @java.lang.Override
- public long getPage() {
- return page_;
- }
-
- public static final int SEARCHTEXT_FIELD_NUMBER = 3;
- @SuppressWarnings("serial")
- private volatile java.lang.Object searchText_ = "";
- /**
- *
- *
- * string searchText = 3;
- * @return The bytes for searchText.
- */
- @java.lang.Override
- public com.google.protobuf.ByteString
- getSearchTextBytes() {
- java.lang.Object ref = searchText_;
- if (ref instanceof java.lang.String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- searchText_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
- }
-
- public static final int NUMBERONPAGE_FIELD_NUMBER = 4;
- private int numberOnPage_ = 0;
- /**
- *
- * Each text block is assigned a number on a page, starting from 0.
- *
- *
- * int32 numberOnPage = 4;
- * @return The numberOnPage.
- */
- @java.lang.Override
- public int getNumberOnPage() {
- return numberOnPage_;
- }
-
- public static final int START_FIELD_NUMBER = 5;
- private int start_ = 0;
- /**
- *
- * The text blocks are ordered, this number represents the start of the text block as a string offset.
- *
- *
- * int32 start = 5;
- * @return The start.
- */
- @java.lang.Override
- public int getStart() {
- return start_;
- }
-
- public static final int END_FIELD_NUMBER = 6;
- private int end_ = 0;
- /**
- *
- * The text blocks are ordered, this number represents the end of the text block as a string offset.
- *
- *
- * int32 end = 6;
- * @return The end.
- */
- @java.lang.Override
- public int getEnd() {
- return end_;
- }
-
- public static final int LINEBREAKS_FIELD_NUMBER = 7;
- @SuppressWarnings("serial")
- private com.google.protobuf.Internal.IntList lineBreaks_ =
- emptyIntList();
- /**
- *
- * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
- *
- *
- * repeated int32 lineBreaks = 7;
- * @return A list containing the lineBreaks.
- */
- @java.lang.Override
- public java.util.List
- getLineBreaksList() {
- return lineBreaks_;
- }
- /**
- *
- * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
- *
- *
- * repeated int32 lineBreaks = 7;
- * @return The count of lineBreaks.
- */
- public int getLineBreaksCount() {
- return lineBreaks_.size();
- }
- /**
- *
- * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
- *
- * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
- *
- *
- * repeated int32 lineBreaks = 7;
- * @return A list containing the lineBreaks.
- */
- public java.util.List
- getLineBreaksList() {
- lineBreaks_.makeImmutable();
- return lineBreaks_;
- }
- /**
- *
- * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
- *
- *
- * repeated int32 lineBreaks = 7;
- * @return The count of lineBreaks.
- */
- public int getLineBreaksCount() {
- return lineBreaks_.size();
- }
- /**
- *
- * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
- *
- *
- * repeated int32 lineBreaks = 7;
- * @param index The index of the element to return.
- * @return The lineBreaks at the given index.
- */
- public int getLineBreaks(int index) {
- return lineBreaks_.getInt(index);
- }
- /**
- *
- * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
- *
- *
- * repeated int32 lineBreaks = 7;
- * @param index The index to set the value at.
- * @param value The lineBreaks to set.
- * @return This builder for chaining.
- */
- public Builder setLineBreaks(
- int index, int value) {
-
- ensureLineBreaksIsMutable();
- lineBreaks_.setInt(index, value);
- bitField0_ |= 0x00000040;
- onChanged();
- return this;
- }
- /**
- *
- * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
- *
- *
- * repeated int32 lineBreaks = 7;
- * @param value The lineBreaks to add.
- * @return This builder for chaining.
- */
- public Builder addLineBreaks(int value) {
-
- ensureLineBreaksIsMutable();
- lineBreaks_.addInt(value);
- bitField0_ |= 0x00000040;
- onChanged();
- return this;
- }
- /**
- *
- * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
- *
- * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
- *
- * Specifies the position in the parsed tree structure.
- *
- *
- * repeated int32 treeId = 2;
- * @return A list containing the treeId.
- */
- java.util.List getTreeIdList();
- /**
- *
- * Specifies the position in the parsed tree structure.
- *
- *
- * repeated int32 treeId = 2;
- * @return The count of treeId.
- */
- int getTreeIdCount();
- /**
- *
- * Specifies the position in the parsed tree structure.
- *
- *
- * repeated int32 treeId = 2;
- * @param index The index of the element to return.
- * @return The treeId at the given index.
- */
- int getTreeId(int index);
-
- /**
- *
- * Specifies the text block IDs associated with this semantic node.
- *
- *
- * repeated int64 atomicBlockIds = 3;
- * @return A list containing the atomicBlockIds.
- */
- java.util.List getAtomicBlockIdsList();
- /**
- *
- * Specifies the text block IDs associated with this semantic node.
- *
- *
- * repeated int64 atomicBlockIds = 3;
- * @return The count of atomicBlockIds.
- */
- int getAtomicBlockIdsCount();
- /**
- *
- * Specifies the text block IDs associated with this semantic node.
- *
- *
- * repeated int64 atomicBlockIds = 3;
- * @param index The index of the element to return.
- * @return The atomicBlockIds at the given index.
- */
- long getAtomicBlockIds(int index);
-
- /**
- *
- * Specifies the pages this semantic node appears on.
- *
- *
- * repeated int64 pageNumbers = 4;
- * @return A list containing the pageNumbers.
- */
- java.util.List getPageNumbersList();
- /**
- *
- * Specifies the pages this semantic node appears on.
- *
- *
- * repeated int64 pageNumbers = 4;
- * @return The count of pageNumbers.
- */
- int getPageNumbersCount();
- /**
- *
- * Specifies the pages this semantic node appears on.
- *
- *
- * repeated int64 pageNumbers = 4;
- * @param index The index of the element to return.
- * @return The pageNumbers at the given index.
- */
- long getPageNumbers(int index);
-
- /**
- *
- * Some semantic nodes have additional information, this information is stored in this Map.
- *
- * Describes the origin of the semantic node.
- *
- *
- * repeated .LayoutEngine engines = 7;
- * @return A list containing the engines.
- */
- java.util.List getEnginesList();
- /**
- *
- * Describes the origin of the semantic node.
- *
- *
- * repeated .LayoutEngine engines = 7;
- * @return The count of engines.
- */
- int getEnginesCount();
- /**
- *
- * Describes the origin of the semantic node.
- *
- *
- * repeated .LayoutEngine engines = 7;
- * @param index The index of the element to return.
- * @return The engines at the given index.
- */
- com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine getEngines(int index);
- /**
- *
- * Describes the origin of the semantic node.
- *
- *
- * repeated .LayoutEngine engines = 7;
- * @return A list containing the enum numeric values on the wire for engines.
- */
- java.util.List
- getEnginesValueList();
- /**
- *
- * Describes the origin of the semantic node.
- *
- *
- * repeated .LayoutEngine engines = 7;
- * @param index The index of the value to return.
- * @return The enum numeric value on the wire of engines at the given index.
- */
- int getEnginesValue(int index);
- }
- /**
- * Protobuf type {@code EntryData}
- */
- public static final class EntryData extends
- com.google.protobuf.GeneratedMessage implements
- // @@protoc_insertion_point(message_implements:EntryData)
- EntryDataOrBuilder {
- private static final long serialVersionUID = 0L;
- static {
- com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
- com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
- /* major= */ 4,
- /* minor= */ 28,
- /* patch= */ 3,
- /* suffix= */ "",
- EntryData.class.getName());
- }
- // Use EntryData.newBuilder() to construct.
- private EntryData(com.google.protobuf.GeneratedMessage.Builder> builder) {
- super(builder);
- }
- private EntryData() {
- type_ = 0;
- treeId_ = emptyIntList();
- atomicBlockIds_ = emptyLongList();
- pageNumbers_ = emptyLongList();
- children_ = java.util.Collections.emptyList();
- engines_ = emptyIntList();
- }
-
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.internal_static_EntryData_descriptor;
- }
-
- @SuppressWarnings({"rawtypes"})
- @java.lang.Override
- protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
- int number) {
- switch (number) {
- case 5:
- return internalGetProperties();
- default:
- throw new RuntimeException(
- "Invalid map field number: " + number);
- }
- }
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.internal_static_EntryData_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.class, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.Builder.class);
- }
-
- public static final int TYPE_FIELD_NUMBER = 1;
- private int type_ = 0;
- /**
- *
- * Type of the semantic node.
- *
- *
- * .NodeType type = 1;
- * @return The enum numeric value on the wire for type.
- */
- @java.lang.Override public int getTypeValue() {
- return type_;
- }
- /**
- *
- * Type of the semantic node.
- *
- *
- * .NodeType type = 1;
- * @return The type.
- */
- @java.lang.Override public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType getType() {
- com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType result = com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType.forNumber(type_);
- return result == null ? com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType.UNRECOGNIZED : result;
- }
-
- public static final int TREEID_FIELD_NUMBER = 2;
- @SuppressWarnings("serial")
- private com.google.protobuf.Internal.IntList treeId_ =
- emptyIntList();
- /**
- *
- * Specifies the position in the parsed tree structure.
- *
- *
- * repeated int32 treeId = 2;
- * @return A list containing the treeId.
- */
- @java.lang.Override
- public java.util.List
- getTreeIdList() {
- return treeId_;
- }
- /**
- *
- * Specifies the position in the parsed tree structure.
- *
- *
- * repeated int32 treeId = 2;
- * @return The count of treeId.
- */
- public int getTreeIdCount() {
- return treeId_.size();
- }
- /**
- *
- * Specifies the position in the parsed tree structure.
- *
- *
- * repeated int32 treeId = 2;
- * @param index The index of the element to return.
- * @return The treeId at the given index.
- */
- public int getTreeId(int index) {
- return treeId_.getInt(index);
- }
- private int treeIdMemoizedSerializedSize = -1;
-
- public static final int ATOMICBLOCKIDS_FIELD_NUMBER = 3;
- @SuppressWarnings("serial")
- private com.google.protobuf.Internal.LongList atomicBlockIds_ =
- emptyLongList();
- /**
- *
- * Specifies the text block IDs associated with this semantic node.
- *
- *
- * repeated int64 atomicBlockIds = 3;
- * @return A list containing the atomicBlockIds.
- */
- @java.lang.Override
- public java.util.List
- getAtomicBlockIdsList() {
- return atomicBlockIds_;
- }
- /**
- *
- * Specifies the text block IDs associated with this semantic node.
- *
- *
- * repeated int64 atomicBlockIds = 3;
- * @return The count of atomicBlockIds.
- */
- public int getAtomicBlockIdsCount() {
- return atomicBlockIds_.size();
- }
- /**
- *
- * Specifies the text block IDs associated with this semantic node.
- *
- *
- * repeated int64 atomicBlockIds = 3;
- * @param index The index of the element to return.
- * @return The atomicBlockIds at the given index.
- */
- public long getAtomicBlockIds(int index) {
- return atomicBlockIds_.getLong(index);
- }
- private int atomicBlockIdsMemoizedSerializedSize = -1;
-
- public static final int PAGENUMBERS_FIELD_NUMBER = 4;
- @SuppressWarnings("serial")
- private com.google.protobuf.Internal.LongList pageNumbers_ =
- emptyLongList();
- /**
- *
- * Specifies the pages this semantic node appears on.
- *
- *
- * repeated int64 pageNumbers = 4;
- * @return A list containing the pageNumbers.
- */
- @java.lang.Override
- public java.util.List
- getPageNumbersList() {
- return pageNumbers_;
- }
- /**
- *
- * Specifies the pages this semantic node appears on.
- *
- *
- * repeated int64 pageNumbers = 4;
- * @return The count of pageNumbers.
- */
- public int getPageNumbersCount() {
- return pageNumbers_.size();
- }
- /**
- *
- * Specifies the pages this semantic node appears on.
- *
- *
- * repeated int64 pageNumbers = 4;
- * @param index The index of the element to return.
- * @return The pageNumbers at the given index.
- */
- public long getPageNumbers(int index) {
- return pageNumbers_.getLong(index);
- }
- private int pageNumbersMemoizedSerializedSize = -1;
-
- public static final int PROPERTIES_FIELD_NUMBER = 5;
- private static final class PropertiesDefaultEntryHolder {
- static final com.google.protobuf.MapEntry<
- java.lang.String, java.lang.String> defaultEntry =
- com.google.protobuf.MapEntry
- .newDefaultInstance(
- com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.internal_static_EntryData_PropertiesEntry_descriptor,
- com.google.protobuf.WireFormat.FieldType.STRING,
- "",
- com.google.protobuf.WireFormat.FieldType.STRING,
- "");
- }
- @SuppressWarnings("serial")
- private com.google.protobuf.MapField<
- java.lang.String, java.lang.String> properties_;
- private com.google.protobuf.MapField
- internalGetProperties() {
- if (properties_ == null) {
- return com.google.protobuf.MapField.emptyMapField(
- PropertiesDefaultEntryHolder.defaultEntry);
- }
- return properties_;
- }
- public int getPropertiesCount() {
- return internalGetProperties().getMap().size();
- }
- /**
- *
- * Some semantic nodes have additional information, this information is stored in this Map.
- *
- *
- * repeated .EntryData children = 6;
- */
- @java.lang.Override
- public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryDataOrBuilder getChildrenOrBuilder(
- int index) {
- return children_.get(index);
- }
-
- public static final int ENGINES_FIELD_NUMBER = 7;
- @SuppressWarnings("serial")
- private com.google.protobuf.Internal.IntList engines_;
- private static final com.google.protobuf.Internal.IntListAdapter.IntConverter<
- com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine> engines_converter_ =
- new com.google.protobuf.Internal.IntListAdapter.IntConverter<
- com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine>() {
- public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine convert(int from) {
- com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine result = com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine.forNumber(from);
- return result == null ? com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine.UNRECOGNIZED : result;
- }
- };
- /**
- *
- * Describes the origin of the semantic node.
- *
- *
- * repeated .LayoutEngine engines = 7;
- * @return A list containing the engines.
- */
- @java.lang.Override
- public java.util.List getEnginesList() {
- return new com.google.protobuf.Internal.IntListAdapter<
- com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine>(engines_, engines_converter_);
- }
- /**
- *
- * Describes the origin of the semantic node.
- *
- *
- * repeated .LayoutEngine engines = 7;
- * @return The count of engines.
- */
- @java.lang.Override
- public int getEnginesCount() {
- return engines_.size();
- }
- /**
- *
- * Describes the origin of the semantic node.
- *
- *
- * repeated .LayoutEngine engines = 7;
- * @param index The index of the element to return.
- * @return The engines at the given index.
- */
- @java.lang.Override
- public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine getEngines(int index) {
- return engines_converter_.convert(engines_.getInt(index));
- }
- /**
- *
- * Describes the origin of the semantic node.
- *
- *
- * repeated .LayoutEngine engines = 7;
- * @return A list containing the enum numeric values on the wire for engines.
- */
- @java.lang.Override
- public java.util.List
- getEnginesValueList() {
- return engines_;
- }
- /**
- *
- * Describes the origin of the semantic node.
- *
- *
- * .NodeType type = 1;
- * @return The enum numeric value on the wire for type.
- */
- @java.lang.Override public int getTypeValue() {
- return type_;
- }
- /**
- *
- * Type of the semantic node.
- *
- *
- * .NodeType type = 1;
- * @param value The enum numeric value on the wire for type to set.
- * @return This builder for chaining.
- */
- public Builder setTypeValue(int value) {
- type_ = value;
- bitField0_ |= 0x00000001;
- onChanged();
- return this;
- }
- /**
- *
- * Type of the semantic node.
- *
- *
- * .NodeType type = 1;
- * @return The type.
- */
- @java.lang.Override
- public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType getType() {
- com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType result = com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType.forNumber(type_);
- return result == null ? com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType.UNRECOGNIZED : result;
- }
- /**
- *
- * Type of the semantic node.
- *
- *
- * .NodeType type = 1;
- * @param value The type to set.
- * @return This builder for chaining.
- */
- public Builder setType(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000001;
- type_ = value.getNumber();
- onChanged();
- return this;
- }
- /**
- *
- * Specifies the position in the parsed tree structure.
- *
- *
- * repeated int32 treeId = 2;
- * @return A list containing the treeId.
- */
- public java.util.List
- getTreeIdList() {
- treeId_.makeImmutable();
- return treeId_;
- }
- /**
- *
- * Specifies the position in the parsed tree structure.
- *
- *
- * repeated int32 treeId = 2;
- * @return The count of treeId.
- */
- public int getTreeIdCount() {
- return treeId_.size();
- }
- /**
- *
- * Specifies the position in the parsed tree structure.
- *
- *
- * repeated int32 treeId = 2;
- * @param index The index of the element to return.
- * @return The treeId at the given index.
- */
- public int getTreeId(int index) {
- return treeId_.getInt(index);
- }
- /**
- *
- * Specifies the position in the parsed tree structure.
- *
- *
- * repeated int32 treeId = 2;
- * @param index The index to set the value at.
- * @param value The treeId to set.
- * @return This builder for chaining.
- */
- public Builder setTreeId(
- int index, int value) {
-
- ensureTreeIdIsMutable();
- treeId_.setInt(index, value);
- bitField0_ |= 0x00000002;
- onChanged();
- return this;
- }
- /**
- *
- * Specifies the position in the parsed tree structure.
- *
- *
- * repeated int32 treeId = 2;
- * @param value The treeId to add.
- * @return This builder for chaining.
- */
- public Builder addTreeId(int value) {
-
- ensureTreeIdIsMutable();
- treeId_.addInt(value);
- bitField0_ |= 0x00000002;
- onChanged();
- return this;
- }
- /**
- *
- * Specifies the position in the parsed tree structure.
- *
- * Specifies the text block IDs associated with this semantic node.
- *
- *
- * repeated int64 atomicBlockIds = 3;
- * @return A list containing the atomicBlockIds.
- */
- public java.util.List
- getAtomicBlockIdsList() {
- atomicBlockIds_.makeImmutable();
- return atomicBlockIds_;
- }
- /**
- *
- * Specifies the text block IDs associated with this semantic node.
- *
- *
- * repeated int64 atomicBlockIds = 3;
- * @return The count of atomicBlockIds.
- */
- public int getAtomicBlockIdsCount() {
- return atomicBlockIds_.size();
- }
- /**
- *
- * Specifies the text block IDs associated with this semantic node.
- *
- *
- * repeated int64 atomicBlockIds = 3;
- * @param index The index of the element to return.
- * @return The atomicBlockIds at the given index.
- */
- public long getAtomicBlockIds(int index) {
- return atomicBlockIds_.getLong(index);
- }
- /**
- *
- * Specifies the text block IDs associated with this semantic node.
- *
- *
- * repeated int64 atomicBlockIds = 3;
- * @param index The index to set the value at.
- * @param value The atomicBlockIds to set.
- * @return This builder for chaining.
- */
- public Builder setAtomicBlockIds(
- int index, long value) {
-
- ensureAtomicBlockIdsIsMutable();
- atomicBlockIds_.setLong(index, value);
- bitField0_ |= 0x00000004;
- onChanged();
- return this;
- }
- /**
- *
- * Specifies the text block IDs associated with this semantic node.
- *
- *
- * repeated int64 atomicBlockIds = 3;
- * @param value The atomicBlockIds to add.
- * @return This builder for chaining.
- */
- public Builder addAtomicBlockIds(long value) {
-
- ensureAtomicBlockIdsIsMutable();
- atomicBlockIds_.addLong(value);
- bitField0_ |= 0x00000004;
- onChanged();
- return this;
- }
- /**
- *
- * Specifies the text block IDs associated with this semantic node.
- *
- * Specifies the pages this semantic node appears on.
- *
- *
- * repeated int64 pageNumbers = 4;
- * @return A list containing the pageNumbers.
- */
- public java.util.List
- getPageNumbersList() {
- pageNumbers_.makeImmutable();
- return pageNumbers_;
- }
- /**
- *
- * Specifies the pages this semantic node appears on.
- *
- *
- * repeated int64 pageNumbers = 4;
- * @return The count of pageNumbers.
- */
- public int getPageNumbersCount() {
- return pageNumbers_.size();
- }
- /**
- *
- * Specifies the pages this semantic node appears on.
- *
- *
- * repeated int64 pageNumbers = 4;
- * @param index The index of the element to return.
- * @return The pageNumbers at the given index.
- */
- public long getPageNumbers(int index) {
- return pageNumbers_.getLong(index);
- }
- /**
- *
- * Specifies the pages this semantic node appears on.
- *
- *
- * repeated int64 pageNumbers = 4;
- * @param index The index to set the value at.
- * @param value The pageNumbers to set.
- * @return This builder for chaining.
- */
- public Builder setPageNumbers(
- int index, long value) {
-
- ensurePageNumbersIsMutable();
- pageNumbers_.setLong(index, value);
- bitField0_ |= 0x00000008;
- onChanged();
- return this;
- }
- /**
- *
- * Specifies the pages this semantic node appears on.
- *
- *
- * repeated int64 pageNumbers = 4;
- * @param value The pageNumbers to add.
- * @return This builder for chaining.
- */
- public Builder addPageNumbers(long value) {
-
- ensurePageNumbersIsMutable();
- pageNumbers_.addLong(value);
- bitField0_ |= 0x00000008;
- onChanged();
- return this;
- }
- /**
- *
- * Specifies the pages this semantic node appears on.
- *
- * Describes the origin of the semantic node.
- *
- *
- * repeated .LayoutEngine engines = 7;
- * @return A list containing the engines.
- */
- public java.util.List getEnginesList() {
- return new com.google.protobuf.Internal.IntListAdapter<
- com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine>(engines_, engines_converter_);
- }
- /**
- *
- * Describes the origin of the semantic node.
- *
- *
- * repeated .LayoutEngine engines = 7;
- * @return The count of engines.
- */
- public int getEnginesCount() {
- return engines_.size();
- }
- /**
- *
- * Describes the origin of the semantic node.
- *
- *
- * repeated .LayoutEngine engines = 7;
- * @param index The index of the element to return.
- * @return The engines at the given index.
- */
- public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine getEngines(int index) {
- return engines_converter_.convert(engines_.getInt(index));
- }
- /**
- *
- * Describes the origin of the semantic node.
- *
- *
- * repeated .LayoutEngine engines = 7;
- * @param index The index to set the value at.
- * @param value The engines to set.
- * @return This builder for chaining.
- */
- public Builder setEngines(
- int index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine value) {
- if (value == null) {
- throw new NullPointerException();
- }
- ensureEnginesIsMutable();
- engines_.setInt(index, value.getNumber());
- onChanged();
- return this;
- }
- /**
- *
- * Describes the origin of the semantic node.
- *
- *
- * repeated .LayoutEngine engines = 7;
- * @param value The engines to add.
- * @return This builder for chaining.
- */
- public Builder addEngines(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine value) {
- if (value == null) {
- throw new NullPointerException();
- }
- ensureEnginesIsMutable();
- engines_.addInt(value.getNumber());
- onChanged();
- return this;
- }
- /**
- *
- * Describes the origin of the semantic node.
- *
- *
- * repeated .LayoutEngine engines = 7;
- * @param values The engines to add.
- * @return This builder for chaining.
- */
- public Builder addAllEngines(
- java.lang.Iterable extends com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine> values) {
- ensureEnginesIsMutable();
- for (com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine value : values) {
- engines_.addInt(value.getNumber());
- }
- onChanged();
- return this;
- }
- /**
- *
- * Describes the origin of the semantic node.
- *
- * Describes the origin of the semantic node.
- *
- *
- * repeated .LayoutEngine engines = 7;
- * @return A list containing the enum numeric values on the wire for engines.
- */
- public java.util.List
- getEnginesValueList() {
- return java.util.Collections.unmodifiableList(engines_);
- }
- /**
- *
- * Describes the origin of the semantic node.
- *
- *
- * repeated .LayoutEngine engines = 7;
- * @param index The index of the value to return.
- * @return The enum numeric value on the wire of engines at the given index.
- */
- public int getEnginesValue(int index) {
- return engines_.getInt(index);
- }
- /**
- *
- * Describes the origin of the semantic node.
- *
- *
- * repeated .LayoutEngine engines = 7;
- * @param index The index to set the value at.
- * @param value The enum numeric value on the wire for engines to set.
- * @return This builder for chaining.
- */
- public Builder setEnginesValue(
- int index, int value) {
- ensureEnginesIsMutable();
- engines_.setInt(index, value);
- onChanged();
- return this;
- }
- /**
- *
- * Describes the origin of the semantic node.
- *
- *
- * repeated .LayoutEngine engines = 7;
- * @param value The enum numeric value on the wire for engines to add.
- * @return This builder for chaining.
- */
- public Builder addEnginesValue(int value) {
- ensureEnginesIsMutable();
- engines_.addInt(value);
- onChanged();
- return this;
- }
- /**
- *
- * Describes the origin of the semantic node.
- *
- *
- * repeated .LayoutEngine engines = 7;
- * @param values The enum numeric values on the wire for engines to add.
- * @return This builder for chaining.
- */
- public Builder addAllEnginesValue(
- java.lang.Iterable values) {
- ensureEnginesIsMutable();
- for (int value : values) {
- engines_.addInt(value);
- }
- onChanged();
- return this;
- }
-
- // @@protoc_insertion_point(builder_scope:EntryData)
- }
-
- // @@protoc_insertion_point(class_scope:EntryData)
- private static final com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData DEFAULT_INSTANCE;
- static {
- DEFAULT_INSTANCE = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData();
- }
-
- public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData getDefaultInstance() {
- return DEFAULT_INSTANCE;
- }
-
- private static final com.google.protobuf.Parser
- PARSER = new com.google.protobuf.AbstractParser() {
- @java.lang.Override
- public EntryData parsePartialFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- Builder builder = newBuilder();
- try {
- builder.mergeFrom(input, extensionRegistry);
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(builder.buildPartial());
- } catch (com.google.protobuf.UninitializedMessageException e) {
- throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(e)
- .setUnfinishedMessage(builder.buildPartial());
- }
- return builder.buildPartial();
- }
- };
-
- public static com.google.protobuf.Parser parser() {
- return PARSER;
- }
-
- @java.lang.Override
- public com.google.protobuf.Parser getParserForType() {
- return PARSER;
- }
-
- @java.lang.Override
- public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData getDefaultInstanceForType() {
- return DEFAULT_INSTANCE;
- }
-
- }
-
- private static final com.google.protobuf.Descriptors.Descriptor
- internal_static_EntryData_descriptor;
- private static final
- com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internal_static_EntryData_fieldAccessorTable;
- private static final com.google.protobuf.Descriptors.Descriptor
- internal_static_EntryData_PropertiesEntry_descriptor;
- private static final
- com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internal_static_EntryData_PropertiesEntry_fieldAccessorTable;
-
- public static com.google.protobuf.Descriptors.FileDescriptor
- getDescriptor() {
- return descriptor;
- }
- private static com.google.protobuf.Descriptors.FileDescriptor
- descriptor;
- static {
- java.lang.String[] descriptorData = {
- "\n\017EntryData.proto\032\022LayoutEngine.proto\032\016N" +
- "odeType.proto\"\202\002\n\tEntryData\022\027\n\004type\030\001 \001(" +
- "\0162\t.NodeType\022\016\n\006treeId\030\002 \003(\005\022\026\n\016atomicBl" +
- "ockIds\030\003 \003(\003\022\023\n\013pageNumbers\030\004 \003(\003\022.\n\npro" +
- "perties\030\005 \003(\0132\032.EntryData.PropertiesEntr" +
- "y\022\034\n\010children\030\006 \003(\0132\n.EntryData\022\036\n\007engin" +
- "es\030\007 \003(\0162\r.LayoutEngine\0321\n\017PropertiesEnt" +
- "ry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001BX\nFco" +
- "m.knecon.fforesight.service.layoutparser" +
- ".internal.api.data.redactionB\016EntryDataP" +
- "rotob\006proto3"
- };
- descriptor = com.google.protobuf.Descriptors.FileDescriptor
- .internalBuildGeneratedFileFrom(descriptorData,
- new com.google.protobuf.Descriptors.FileDescriptor[] {
- com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.getDescriptor(),
- com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.getDescriptor(),
- });
- internal_static_EntryData_descriptor =
- getDescriptor().getMessageTypes().get(0);
- internal_static_EntryData_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessage.FieldAccessorTable(
- internal_static_EntryData_descriptor,
- new java.lang.String[] { "Type", "TreeId", "AtomicBlockIds", "PageNumbers", "Properties", "Children", "Engines", });
- internal_static_EntryData_PropertiesEntry_descriptor =
- internal_static_EntryData_descriptor.getNestedTypes().get(0);
- internal_static_EntryData_PropertiesEntry_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessage.FieldAccessorTable(
- internal_static_EntryData_PropertiesEntry_descriptor,
- new java.lang.String[] { "Key", "Value", });
- descriptor.resolveAllFeaturesImmutable();
- com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.getDescriptor();
- com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.getDescriptor();
- }
-
- // @@protoc_insertion_point(outer_class_scope)
-}
diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/LayoutEngine.java b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/LayoutEngine.java
deleted file mode 100644
index a6e8c03..0000000
--- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/LayoutEngine.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction;
-
-@Deprecated
-public enum LayoutEngine {
- ALGORITHM,
- AI,
- OUTLINE
-}
diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/LayoutEngineProto.java b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/LayoutEngineProto.java
deleted file mode 100644
index 572243b..0000000
--- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/LayoutEngineProto.java
+++ /dev/null
@@ -1,177 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-// NO CHECKED-IN PROTOBUF GENCODE
-// source: LayoutEngine.proto
-// Protobuf Java Version: 4.28.3
-
-package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction;
-
-public final class LayoutEngineProto {
- private LayoutEngineProto() {}
- static {
- com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
- com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
- /* major= */ 4,
- /* minor= */ 28,
- /* patch= */ 3,
- /* suffix= */ "",
- LayoutEngineProto.class.getName());
- }
- public static void registerAllExtensions(
- com.google.protobuf.ExtensionRegistryLite registry) {
- }
-
- public static void registerAllExtensions(
- com.google.protobuf.ExtensionRegistry registry) {
- registerAllExtensions(
- (com.google.protobuf.ExtensionRegistryLite) registry);
- }
- /**
- * Protobuf enum {@code LayoutEngine}
- */
- public enum LayoutEngine
- implements com.google.protobuf.ProtocolMessageEnum {
- /**
- * ALGORITHM = 0;
- */
- ALGORITHM(0),
- /**
- * AI = 1;
- */
- AI(1),
- /**
- * OUTLINE = 2;
- */
- OUTLINE(2),
- UNRECOGNIZED(-1),
- ;
-
- static {
- com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
- com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
- /* major= */ 4,
- /* minor= */ 28,
- /* patch= */ 3,
- /* suffix= */ "",
- LayoutEngine.class.getName());
- }
- /**
- * ALGORITHM = 0;
- */
- public static final int ALGORITHM_VALUE = 0;
- /**
- * AI = 1;
- */
- public static final int AI_VALUE = 1;
- /**
- * OUTLINE = 2;
- */
- public static final int OUTLINE_VALUE = 2;
-
-
- public final int getNumber() {
- if (this == UNRECOGNIZED) {
- throw new java.lang.IllegalArgumentException(
- "Can't get the number of an unknown enum value.");
- }
- return value;
- }
-
- /**
- * @param value The numeric wire value of the corresponding enum entry.
- * @return The enum associated with the given numeric wire value.
- * @deprecated Use {@link #forNumber(int)} instead.
- */
- @java.lang.Deprecated
- public static LayoutEngine valueOf(int value) {
- return forNumber(value);
- }
-
- /**
- * @param value The numeric wire value of the corresponding enum entry.
- * @return The enum associated with the given numeric wire value.
- */
- public static LayoutEngine forNumber(int value) {
- switch (value) {
- case 0: return ALGORITHM;
- case 1: return AI;
- case 2: return OUTLINE;
- default: return null;
- }
- }
-
- public static com.google.protobuf.Internal.EnumLiteMap
- internalGetValueMap() {
- return internalValueMap;
- }
- private static final com.google.protobuf.Internal.EnumLiteMap<
- LayoutEngine> internalValueMap =
- new com.google.protobuf.Internal.EnumLiteMap() {
- public LayoutEngine findValueByNumber(int number) {
- return LayoutEngine.forNumber(number);
- }
- };
-
- public final com.google.protobuf.Descriptors.EnumValueDescriptor
- getValueDescriptor() {
- if (this == UNRECOGNIZED) {
- throw new java.lang.IllegalStateException(
- "Can't get the descriptor of an unrecognized enum value.");
- }
- return getDescriptor().getValues().get(ordinal());
- }
- public final com.google.protobuf.Descriptors.EnumDescriptor
- getDescriptorForType() {
- return getDescriptor();
- }
- public static final com.google.protobuf.Descriptors.EnumDescriptor
- getDescriptor() {
- return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.getDescriptor().getEnumTypes().get(0);
- }
-
- private static final LayoutEngine[] VALUES = values();
-
- public static LayoutEngine valueOf(
- com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
- if (desc.getType() != getDescriptor()) {
- throw new java.lang.IllegalArgumentException(
- "EnumValueDescriptor is not for this type.");
- }
- if (desc.getIndex() == -1) {
- return UNRECOGNIZED;
- }
- return VALUES[desc.getIndex()];
- }
-
- private final int value;
-
- private LayoutEngine(int value) {
- this.value = value;
- }
-
- // @@protoc_insertion_point(enum_scope:LayoutEngine)
- }
-
-
- public static com.google.protobuf.Descriptors.FileDescriptor
- getDescriptor() {
- return descriptor;
- }
- private static com.google.protobuf.Descriptors.FileDescriptor
- descriptor;
- static {
- java.lang.String[] descriptorData = {
- "\n\022LayoutEngine.proto*2\n\014LayoutEngine\022\r\n\t" +
- "ALGORITHM\020\000\022\006\n\002AI\020\001\022\013\n\007OUTLINE\020\002B[\nFcom." +
- "knecon.fforesight.service.layoutparser.i" +
- "nternal.api.data.redactionB\021LayoutEngine" +
- "Protob\006proto3"
- };
- descriptor = com.google.protobuf.Descriptors.FileDescriptor
- .internalBuildGeneratedFileFrom(descriptorData,
- new com.google.protobuf.Descriptors.FileDescriptor[] {
- });
- descriptor.resolveAllFeaturesImmutable();
- }
-
- // @@protoc_insertion_point(outer_class_scope)
-}
diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/NodeType.java b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/NodeType.java
deleted file mode 100644
index cc1df4d..0000000
--- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/NodeType.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction;
-
-import java.io.Serializable;
-import java.util.Locale;
-
-@Deprecated
-public enum NodeType implements Serializable {
- DOCUMENT,
- SECTION,
- SUPER_SECTION,
- HEADLINE,
- PARAGRAPH,
- TABLE,
- TABLE_CELL,
- IMAGE,
- HEADER,
- FOOTER;
-
-
- public String toString() {
-
- return this.name().charAt(0) + this.name().substring(1).toLowerCase(Locale.ROOT);
- }
-}
diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/NodeTypeProto.java b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/NodeTypeProto.java
deleted file mode 100644
index edbd9d1..0000000
--- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/NodeTypeProto.java
+++ /dev/null
@@ -1,261 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-// NO CHECKED-IN PROTOBUF GENCODE
-// source: NodeType.proto
-// Protobuf Java Version: 4.28.3
-
-package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction;
-
-public final class NodeTypeProto {
- private NodeTypeProto() {}
- static {
- com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
- com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
- /* major= */ 4,
- /* minor= */ 28,
- /* patch= */ 3,
- /* suffix= */ "",
- NodeTypeProto.class.getName());
- }
- public static void registerAllExtensions(
- com.google.protobuf.ExtensionRegistryLite registry) {
- }
-
- public static void registerAllExtensions(
- com.google.protobuf.ExtensionRegistry registry) {
- registerAllExtensions(
- (com.google.protobuf.ExtensionRegistryLite) registry);
- }
- /**
- * Protobuf enum {@code NodeType}
- */
- public enum NodeType
- implements com.google.protobuf.ProtocolMessageEnum {
- /**
- * DOCUMENT = 0;
- */
- DOCUMENT(0),
- /**
- * SECTION = 1;
- */
- SECTION(1),
- /**
- * SUPER_SECTION = 2;
- */
- SUPER_SECTION(2),
- /**
- * HEADLINE = 3;
- */
- HEADLINE(3),
- /**
- * PARAGRAPH = 4;
- */
- PARAGRAPH(4),
- /**
- * TABLE = 5;
- */
- TABLE(5),
- /**
- * TABLE_CELL = 6;
- */
- TABLE_CELL(6),
- /**
- * IMAGE = 7;
- */
- IMAGE(7),
- /**
- * HEADER = 8;
- */
- HEADER(8),
- /**
- * FOOTER = 9;
- */
- FOOTER(9),
- /**
- * TABLE_OF_CONTENTS = 10;
- */
- TABLE_OF_CONTENTS(10),
- /**
- * TABLE_OF_CONTENTS_ITEM = 11;
- */
- TABLE_OF_CONTENTS_ITEM(11),
- UNRECOGNIZED(-1),
- ;
-
- static {
- com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
- com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
- /* major= */ 4,
- /* minor= */ 28,
- /* patch= */ 3,
- /* suffix= */ "",
- NodeType.class.getName());
- }
- /**
- * DOCUMENT = 0;
- */
- public static final int DOCUMENT_VALUE = 0;
- /**
- * SECTION = 1;
- */
- public static final int SECTION_VALUE = 1;
- /**
- * SUPER_SECTION = 2;
- */
- public static final int SUPER_SECTION_VALUE = 2;
- /**
- * HEADLINE = 3;
- */
- public static final int HEADLINE_VALUE = 3;
- /**
- * PARAGRAPH = 4;
- */
- public static final int PARAGRAPH_VALUE = 4;
- /**
- * TABLE = 5;
- */
- public static final int TABLE_VALUE = 5;
- /**
- * TABLE_CELL = 6;
- */
- public static final int TABLE_CELL_VALUE = 6;
- /**
- * IMAGE = 7;
- */
- public static final int IMAGE_VALUE = 7;
- /**
- * HEADER = 8;
- */
- public static final int HEADER_VALUE = 8;
- /**
- * FOOTER = 9;
- */
- public static final int FOOTER_VALUE = 9;
- /**
- * TABLE_OF_CONTENTS = 10;
- */
- public static final int TABLE_OF_CONTENTS_VALUE = 10;
- /**
- * TABLE_OF_CONTENTS_ITEM = 11;
- */
- public static final int TABLE_OF_CONTENTS_ITEM_VALUE = 11;
-
-
- public final int getNumber() {
- if (this == UNRECOGNIZED) {
- throw new java.lang.IllegalArgumentException(
- "Can't get the number of an unknown enum value.");
- }
- return value;
- }
-
- /**
- * @param value The numeric wire value of the corresponding enum entry.
- * @return The enum associated with the given numeric wire value.
- * @deprecated Use {@link #forNumber(int)} instead.
- */
- @java.lang.Deprecated
- public static NodeType valueOf(int value) {
- return forNumber(value);
- }
-
- /**
- * @param value The numeric wire value of the corresponding enum entry.
- * @return The enum associated with the given numeric wire value.
- */
- public static NodeType forNumber(int value) {
- switch (value) {
- case 0: return DOCUMENT;
- case 1: return SECTION;
- case 2: return SUPER_SECTION;
- case 3: return HEADLINE;
- case 4: return PARAGRAPH;
- case 5: return TABLE;
- case 6: return TABLE_CELL;
- case 7: return IMAGE;
- case 8: return HEADER;
- case 9: return FOOTER;
- case 10: return TABLE_OF_CONTENTS;
- case 11: return TABLE_OF_CONTENTS_ITEM;
- default: return null;
- }
- }
-
- public static com.google.protobuf.Internal.EnumLiteMap
- internalGetValueMap() {
- return internalValueMap;
- }
- private static final com.google.protobuf.Internal.EnumLiteMap<
- NodeType> internalValueMap =
- new com.google.protobuf.Internal.EnumLiteMap() {
- public NodeType findValueByNumber(int number) {
- return NodeType.forNumber(number);
- }
- };
-
- public final com.google.protobuf.Descriptors.EnumValueDescriptor
- getValueDescriptor() {
- if (this == UNRECOGNIZED) {
- throw new java.lang.IllegalStateException(
- "Can't get the descriptor of an unrecognized enum value.");
- }
- return getDescriptor().getValues().get(ordinal());
- }
- public final com.google.protobuf.Descriptors.EnumDescriptor
- getDescriptorForType() {
- return getDescriptor();
- }
- public static final com.google.protobuf.Descriptors.EnumDescriptor
- getDescriptor() {
- return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.getDescriptor().getEnumTypes().get(0);
- }
-
- private static final NodeType[] VALUES = values();
-
- public static NodeType valueOf(
- com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
- if (desc.getType() != getDescriptor()) {
- throw new java.lang.IllegalArgumentException(
- "EnumValueDescriptor is not for this type.");
- }
- if (desc.getIndex() == -1) {
- return UNRECOGNIZED;
- }
- return VALUES[desc.getIndex()];
- }
-
- private final int value;
-
- private NodeType(int value) {
- this.value = value;
- }
-
- // @@protoc_insertion_point(enum_scope:NodeType)
- }
-
-
- public static com.google.protobuf.Descriptors.FileDescriptor
- getDescriptor() {
- return descriptor;
- }
- private static com.google.protobuf.Descriptors.FileDescriptor
- descriptor;
- static {
- java.lang.String[] descriptorData = {
- "\n\016NodeType.proto*\306\001\n\010NodeType\022\014\n\010DOCUMEN" +
- "T\020\000\022\013\n\007SECTION\020\001\022\021\n\rSUPER_SECTION\020\002\022\014\n\010H" +
- "EADLINE\020\003\022\r\n\tPARAGRAPH\020\004\022\t\n\005TABLE\020\005\022\016\n\nT" +
- "ABLE_CELL\020\006\022\t\n\005IMAGE\020\007\022\n\n\006HEADER\020\010\022\n\n\006FO" +
- "OTER\020\t\022\025\n\021TABLE_OF_CONTENTS\020\n\022\032\n\026TABLE_O" +
- "F_CONTENTS_ITEM\020\013BW\nFcom.knecon.fforesig" +
- "ht.service.layoutparser.internal.api.dat" +
- "a.redactionB\rNodeTypeProtob\006proto3"
- };
- descriptor = com.google.protobuf.Descriptors.FileDescriptor
- .internalBuildGeneratedFileFrom(descriptorData,
- new com.google.protobuf.Descriptors.FileDescriptor[] {
- });
- descriptor.resolveAllFeaturesImmutable();
- }
-
- // @@protoc_insertion_point(outer_class_scope)
-}
diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentPage.proto b/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentPage.proto
deleted file mode 100644
index d7ff489..0000000
--- a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentPage.proto
+++ /dev/null
@@ -1,25 +0,0 @@
-syntax = "proto3";
-
-option java_outer_classname = "DocumentPageProto";
-option java_package = "com.knecon.fforesight.service.layoutparser.internal.api.data.redaction";
-
-
-message AllDocumentPages {
-
- repeated DocumentPage documentPages = 1;
-}
-
-message DocumentPage {
- // The page number, starting with 1.
- int32 number = 1;
-
- // The page height in PDF user units.
- int32 height = 2;
-
- // The page width in PDF user units.
- int32 width = 3;
-
- // The page rotation as specified by the PDF.
- int32 rotation = 4;
-}
-
diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentPositionData.proto b/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentPositionData.proto
deleted file mode 100644
index e597175..0000000
--- a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentPositionData.proto
+++ /dev/null
@@ -1,28 +0,0 @@
-syntax = "proto3";
-
-option java_outer_classname = "DocumentPositionDataProto";
-option java_package = "com.knecon.fforesight.service.layoutparser.internal.api.data.redaction";
-
-message AllDocumentPositionData {
-
- repeated DocumentPositionData documentPositionData = 1;
-}
-
-message DocumentPositionData {
- // Identifier of the text block.
- int64 id = 1;
-
- // For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
- // This is required due to the text and position coordinates not being equal.
- repeated int32 stringIdxToPositionIdx = 2;
-
- // The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
- // The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
- // In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
- repeated Position positions = 3;
-
- // Definition of a BoundingBox that contains x, y, width, and height.
- message Position {
- repeated float value = 1;
- }
-}
diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentStructure.proto b/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentStructure.proto
deleted file mode 100644
index ab1cea1..0000000
--- a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentStructure.proto
+++ /dev/null
@@ -1,12 +0,0 @@
-syntax = "proto3";
-
-option java_outer_classname = "DocumentStructureProto";
-option java_package = "com.knecon.fforesight.service.layoutparser.internal.api.data.redaction";
-
-
-import "EntryData.proto";
-
-message DocumentStructure {
- // The root EntryData represents the Document.
- EntryData root = 1;
-}
diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentTextData.proto b/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentTextData.proto
deleted file mode 100644
index c162279..0000000
--- a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentTextData.proto
+++ /dev/null
@@ -1,32 +0,0 @@
-syntax = "proto3";
-
-option java_outer_classname = "DocumentTextDataProto";
-option java_package = "com.knecon.fforesight.service.layoutparser.internal.api.data.redaction";
-
-message AllDocumentTextData {
-
- repeated DocumentTextData documentTextData = 1;
-}
-
-message DocumentTextData {
- // Identifier of the text block.
- int64 id = 1;
-
- // The page the text block occurs on.
- int64 page = 2;
-
- // The text of the text block.
- string searchText = 3;
-
- // Each text block is assigned a number on a page, starting from 0.
- int32 numberOnPage = 4;
-
- // The text blocks are ordered, this number represents the start of the text block as a string offset.
- int32 start = 5;
-
- // The text blocks are ordered, this number represents the end of the text block as a string offset.
- int32 end = 6;
-
- // The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
- repeated int32 lineBreaks = 7;
-}
diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/EntryData.proto b/layoutparser-service/layoutparser-service-internal-api/src/main/resources/EntryData.proto
deleted file mode 100644
index cc6900c..0000000
--- a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/EntryData.proto
+++ /dev/null
@@ -1,30 +0,0 @@
-syntax = "proto3";
-
-import "LayoutEngine.proto";
-import "NodeType.proto";
-
-option java_outer_classname = "EntryDataProto";
-option java_package = "com.knecon.fforesight.service.layoutparser.internal.api.data.redaction";
-
-message EntryData {
- // Type of the semantic node.
- NodeType type = 1;
-
- // Specifies the position in the parsed tree structure.
- repeated int32 treeId = 2;
-
- // Specifies the text block IDs associated with this semantic node.
- repeated int64 atomicBlockIds = 3;
-
- // Specifies the pages this semantic node appears on.
- repeated int64 pageNumbers = 4;
-
- // Some semantic nodes have additional information, this information is stored in this Map.
- map properties = 5;
-
- // All child Entries of this Entry.
- repeated EntryData children = 6;
-
- // Describes the origin of the semantic node.
- repeated LayoutEngine engines = 7;
-}
diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/LayoutEngine.proto b/layoutparser-service/layoutparser-service-internal-api/src/main/resources/LayoutEngine.proto
deleted file mode 100644
index a668134..0000000
--- a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/LayoutEngine.proto
+++ /dev/null
@@ -1,8 +0,0 @@
-syntax = "proto3";
-option java_outer_classname = "LayoutEngineProto";
-option java_package = "com.knecon.fforesight.service.layoutparser.internal.api.data.redaction";
-enum LayoutEngine {
- ALGORITHM = 0;
- AI = 1;
- OUTLINE = 2;
-}
diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/NodeType.proto b/layoutparser-service/layoutparser-service-internal-api/src/main/resources/NodeType.proto
deleted file mode 100644
index ce58aaa..0000000
--- a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/NodeType.proto
+++ /dev/null
@@ -1,19 +0,0 @@
-syntax = "proto3";
-
-option java_outer_classname = "NodeTypeProto";
-option java_package = "com.knecon.fforesight.service.layoutparser.internal.api.data.redaction";
-
-enum NodeType {
- DOCUMENT = 0;
- SECTION = 1;
- SUPER_SECTION = 2;
- HEADLINE = 3;
- PARAGRAPH = 4;
- TABLE = 5;
- TABLE_CELL = 6;
- IMAGE = 7;
- HEADER = 8;
- FOOTER = 9;
- TABLE_OF_CONTENTS = 10;
- TABLE_OF_CONTENTS_ITEM = 11;
-}
diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/generate_proto_files.sh b/layoutparser-service/layoutparser-service-internal-api/src/main/resources/generate_proto_files.sh
deleted file mode 100644
index 4a929be..0000000
--- a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/generate_proto_files.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash
-
-# Minimum required protoc version
-MIN_VERSION="28.3"
-
-# Get the installed protoc version
-INSTALLED_VERSION=$(protoc --version | awk '{print $2}')
-
-# Function to compare versions
-version_lt() {
- [ "$(printf '%s\n' "$1" "$2" | sort -V | head -n1)" != "$1" ]
-}
-
-# Check if protoc is installed and meets the minimum version
-if ! command -v protoc &> /dev/null; then
- echo "Error: protoc is not installed. Please install version $MIN_VERSION or later."
- exit 1
-fi
-
-if version_lt "$INSTALLED_VERSION" "$MIN_VERSION"; then
- echo "Error: protoc version $INSTALLED_VERSION is too old. Please upgrade to version $MIN_VERSION or later."
- exit 1
-fi
-
-# Generate Java files from proto files
-protoc --java_out=../java ./*.proto
diff --git a/layoutparser-service/layoutparser-service-processor/build.gradle.kts b/layoutparser-service/layoutparser-service-processor/build.gradle.kts
index ea4772c..fc94408 100644
--- a/layoutparser-service/layoutparser-service-processor/build.gradle.kts
+++ b/layoutparser-service/layoutparser-service-processor/build.gradle.kts
@@ -8,10 +8,12 @@ description = "layoutparser-service-processor"
val jacksonVersion = "2.15.2"
val pdfBoxVersion = "3.0.0"
+
dependencies {
implementation(project(":layoutparser-service-internal-api"))
implementation(project(":viewer-doc-processor"))
+ implementation("com.iqser.red.service:document:${rootProject.extra.get("documentVersion")}")
implementation("com.iqser.red.service:persistence-service-shared-api-v1:2.564.0-RED9010.0") {
exclude("org.springframework.boot", "spring-boot-starter-security")
exclude("org.springframework.boot", "spring-boot-starter-validation")
diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/LayoutParsingPipeline.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/LayoutParsingPipeline.java
index 890862d..470fd9c 100644
--- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/LayoutParsingPipeline.java
+++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/LayoutParsingPipeline.java
@@ -22,11 +22,14 @@ import org.apache.pdfbox.pdmodel.common.PDRectangle;
import org.apache.pdfbox.pdmodel.documentinterchange.markedcontent.PDMarkedContent;
import org.springframework.stereotype.Service;
-import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType;
+import com.iqser.red.service.redaction.v1.server.mapper.DocumentDataMapper;
+import com.iqser.red.service.redaction.v1.server.model.document.nodes.ImageType;
+import com.iqser.red.service.redaction.v1.server.model.document.nodes.NodeType;
import com.knecon.fforesight.service.layoutparser.internal.api.queue.LayoutParsingFinishedEvent;
import com.knecon.fforesight.service.layoutparser.internal.api.queue.LayoutParsingRequest;
import com.knecon.fforesight.service.layoutparser.internal.api.queue.LayoutParsingType;
import com.knecon.fforesight.service.layoutparser.processor.docstrum.model.Character;
+import com.knecon.fforesight.service.layoutparser.processor.model.DocumentWithVisualization;
import com.knecon.fforesight.service.layoutparser.processor.model.table.Ruling;
import com.knecon.fforesight.service.layoutparser.processor.model.text.RedTextPosition;
import com.knecon.fforesight.service.layoutparser.processor.model.text.TextDirection;
@@ -35,8 +38,7 @@ import com.knecon.fforesight.service.layoutparser.processor.services.mapper.Mark
import com.knecon.fforesight.service.layoutparser.processor.model.AbstractPageBlock;
import com.knecon.fforesight.service.layoutparser.processor.model.ClassificationDocument;
import com.knecon.fforesight.service.layoutparser.processor.model.ClassificationPage;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Document;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.ImageType;
+
import com.knecon.fforesight.service.layoutparser.processor.model.image.ClassifiedImage;
import com.knecon.fforesight.service.layoutparser.processor.model.outline.OutlineExtractorService;
import com.knecon.fforesight.service.layoutparser.processor.model.outline.SectionTreeBuilderService;
@@ -65,7 +67,6 @@ import com.knecon.fforesight.service.layoutparser.processor.services.blockificat
import com.knecon.fforesight.service.layoutparser.processor.services.factory.DocumentGraphFactory;
import com.knecon.fforesight.service.layoutparser.processor.services.graphics.Box;
import com.knecon.fforesight.service.layoutparser.processor.services.graphics.GraphicExtractorService;
-import com.knecon.fforesight.service.layoutparser.processor.services.mapper.DocumentDataMapper;
import com.knecon.fforesight.service.layoutparser.processor.services.mapper.TaasDocumentDataMapper;
import com.knecon.fforesight.service.layoutparser.processor.services.parsing.PDFLinesTextStripper;
import com.knecon.fforesight.service.layoutparser.processor.services.visualization.LayoutGridService;
@@ -136,25 +137,25 @@ public class LayoutParsingPipeline {
log.info("Building document graph for {}", layoutParsingRequest.identifier());
- Document documentGraph = observeBuildDocumentGraph(settings.getLayoutParsingTypeOverride() == null //
+ DocumentWithVisualization documentWithVisualization = observeBuildDocumentGraph(settings.getLayoutParsingTypeOverride() == null //
? layoutParsingRequest.layoutParsingType() : settings.getLayoutParsingTypeOverride(), classificationDocument);
log.info("Creating viewer document for {}", layoutParsingRequest.identifier());
- layoutGridService.addLayoutGrid(viewerDocumentFile, documentGraph, viewerDocumentFile, false);
+ layoutGridService.addLayoutGrid(viewerDocumentFile, documentWithVisualization, viewerDocumentFile, false);
log.info("Storing resulting files for {}", layoutParsingRequest.identifier());
- layoutParsingStorageService.storeDocumentData(layoutParsingRequest, DocumentDataMapper.toDocumentData(documentGraph));
+ layoutParsingStorageService.storeDocumentData(layoutParsingRequest, DocumentDataMapper.toDocumentData(documentWithVisualization.document()));
if (layoutParsingRequest.documentMarkdownFileStorageId().isPresent()) {
- layoutParsingStorageService.storeMarkdownFile(layoutParsingRequest.documentMarkdownFileStorageId().get(), new MarkdownMapper().toMarkdownContent(documentGraph));
+ layoutParsingStorageService.storeMarkdownFile(layoutParsingRequest.documentMarkdownFileStorageId().get(), new MarkdownMapper().toMarkdownContent(documentWithVisualization.document()));
}
- layoutParsingStorageService.storeSimplifiedText(layoutParsingRequest, simplifiedSectionTextService.toSimplifiedText(documentGraph));
+ layoutParsingStorageService.storeSimplifiedText(layoutParsingRequest, simplifiedSectionTextService.toSimplifiedText(documentWithVisualization.document()));
layoutParsingStorageService.storeViewerDocument(layoutParsingRequest, viewerDocumentFile);
if (layoutParsingRequest.researchDocumentStorageId() != null) {
log.info("Building research document data for {}", layoutParsingRequest.identifier());
- var researchDocumentData = TaasDocumentDataMapper.fromDocument(documentGraph);
+ var researchDocumentData = TaasDocumentDataMapper.fromDocument(documentWithVisualization.document());
layoutParsingStorageService.storeResearchDocumentData(layoutParsingRequest, researchDocumentData);
}
@@ -165,7 +166,7 @@ public class LayoutParsingPipeline {
return LayoutParsingFinishedEvent.builder()
.identifier(layoutParsingRequest.identifier())
- .numberOfPages(documentGraph.getNumberOfPages())
+ .numberOfPages(documentWithVisualization.document().getNumberOfPages())
.duration(System.currentTimeMillis() - start)
.message(format("""
Layout parsing has finished in %.02f s.
@@ -180,7 +181,7 @@ public class LayoutParsingPipeline {
Viewer Doc: %s""",
((float) (System.currentTimeMillis() - start)) / 1000,
layoutParsingRequest.identifier(),
- buildSemanticNodeCountMessage(documentGraph.getNumberOfPages(), documentGraph.buildSemanticNodeCounts()),
+ buildSemanticNodeCountMessage(documentWithVisualization.document().getNumberOfPages(), documentWithVisualization.buildSemanticNodeCounts()),
layoutParsingRequest.structureFileStorageId(),
layoutParsingRequest.textBlockFileStorageId(),
layoutParsingRequest.positionBlockFileStorageId(),
@@ -192,9 +193,9 @@ public class LayoutParsingPipeline {
}
- private Document observeBuildDocumentGraph(LayoutParsingType layoutParsingType, ClassificationDocument classificationDocument) {
+ private DocumentWithVisualization observeBuildDocumentGraph(LayoutParsingType layoutParsingType, ClassificationDocument classificationDocument) {
- AtomicReference documentReference = new AtomicReference<>();
+ AtomicReference documentReference = new AtomicReference<>();
Observation.createNotStarted("LayoutParsingPipeline", observationRegistry)
.contextualName("build-document-graph")
diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/LayoutParsingStorageService.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/LayoutParsingStorageService.java
index a84fccc..857382b 100644
--- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/LayoutParsingStorageService.java
+++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/LayoutParsingStorageService.java
@@ -17,8 +17,8 @@ import org.springframework.core.task.TaskExecutor;
import org.springframework.stereotype.Service;
import com.fasterxml.jackson.databind.ObjectMapper;
+import com.iqser.red.service.redaction.v1.server.data.DocumentData;
import com.iqser.red.storage.commons.service.StorageService;
-import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentData;
import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.SimplifiedText;
import com.knecon.fforesight.service.layoutparser.internal.api.data.taas.ResearchDocumentData;
import com.knecon.fforesight.service.layoutparser.internal.api.queue.LayoutParsingRequest;
@@ -122,7 +122,7 @@ public class LayoutParsingStorageService {
Runnable storeDocumentPositionsRunnable = () -> storageService.storeProtoObject(TenantContext.getTenantId(),
layoutParsingRequest.positionBlockFileStorageId(),
- documentData.getDocumentPositions());
+ documentData.getDocumentPositionData());
CompletableFuture storeDocumentPositionsFuture = CompletableFuture.runAsync(storeDocumentPositionsRunnable, taskExecutor);
diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/AbstractPageBlock.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/AbstractPageBlock.java
index 54a1cb1..9c2cccb 100644
--- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/AbstractPageBlock.java
+++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/AbstractPageBlock.java
@@ -4,7 +4,7 @@ import java.util.HashSet;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine;
+import com.iqser.red.service.redaction.v1.server.data.LayoutEngineProto.LayoutEngine;
import com.knecon.fforesight.service.layoutparser.processor.docstrum.model.BoundingBox;
import com.knecon.fforesight.service.layoutparser.processor.model.text.TextPageBlock;
diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/DocumentWithVisualization.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/DocumentWithVisualization.java
new file mode 100644
index 0000000..1f8825b
--- /dev/null
+++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/DocumentWithVisualization.java
@@ -0,0 +1,19 @@
+package com.knecon.fforesight.service.layoutparser.processor.model;
+
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import com.iqser.red.service.redaction.v1.server.model.document.nodes.Document;
+import com.iqser.red.service.redaction.v1.server.model.document.nodes.NodeType;
+import com.iqser.red.service.redaction.v1.server.model.document.nodes.SemanticNode;
+import com.knecon.fforesight.service.layoutparser.processor.visualization.LayoutDebugLayer;
+
+public record DocumentWithVisualization(Document document, LayoutDebugLayer layoutDebugLayer) {
+
+ public Map buildSemanticNodeCounts() {
+
+ return document.streamAllSubNodes()
+ .collect(Collectors.groupingBy(SemanticNode::getType, Collectors.counting()));
+ }
+
+}
diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/AbstractNodeVisitor.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/AbstractNodeVisitor.java
deleted file mode 100644
index 30f2a95..0000000
--- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/AbstractNodeVisitor.java
+++ /dev/null
@@ -1,108 +0,0 @@
-package com.knecon.fforesight.service.layoutparser.processor.model.graph;
-
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Document;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Footer;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Header;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Headline;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Image;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Paragraph;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Section;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.SemanticNode;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.SuperSection;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Table;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.TableCell;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.TableOfContents;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.TableOfContentsItem;
-
-public abstract class AbstractNodeVisitor implements NodeVisitor {
-
- @Override
- public void visit(Document document) {
-
- visitChildren(document);
- }
-
-
- @Override
- public void visit(SuperSection superSection) {
-
- visitChildren(superSection);
- }
-
-
- @Override
- public void visit(Section section) {
-
- visitChildren(section);
- }
-
-
- @Override
- public void visit(Headline headline) {
-
- visitChildren(headline);
- }
-
-
- @Override
- public void visit(Paragraph paragraph) {
-
- visitChildren(paragraph);
- }
-
-
- @Override
- public void visit(Footer footer) {
-
- visitChildren(footer);
- }
-
-
- @Override
- public void visit(Header header) {
-
- visitChildren(header);
- }
-
-
- @Override
- public void visit(Image image) {
-
- visitChildren(image);
- }
-
-
- @Override
- public void visit(Table table) {
-
- visitChildren(table);
- }
-
-
- @Override
- public void visit(TableCell tableCell) {
-
- visitChildren(tableCell);
- }
-
- @Override
- public void visit(TableOfContents toc) {
-
- visitChildren(toc);
- }
-
- @Override
- public void visit(TableOfContentsItem toci) {
-
- visitChildren(toci);
- }
-
-
- protected void visitChildren(SemanticNode semanticNode) {
-
- semanticNode.streamChildren()
- .forEach(node -> node.accept(this));
-
- }
-
-}
diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/DocumentTree.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/DocumentTree.java
deleted file mode 100644
index 9552b8f..0000000
--- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/DocumentTree.java
+++ /dev/null
@@ -1,230 +0,0 @@
-package com.knecon.fforesight.service.layoutparser.processor.model.graph;
-
-import static java.lang.String.format;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.stream.Stream;
-
-import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Document;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.GenericSemanticNode;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.SemanticNode;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Table;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.TableCell;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.textblock.TextBlock;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.textblock.TextBlockCollector;
-
-import lombok.AccessLevel;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.experimental.FieldDefaults;
-
-@Data
-@EqualsAndHashCode
-public class DocumentTree {
-
- private final Entry root;
-
-
- public DocumentTree(Document document) {
-
- root = Entry.builder().treeId(Collections.emptyList()).children(new LinkedList<>()).node(document).build();
- }
-
-
- public TextBlock buildTextBlock() {
-
- return allEntriesInOrder().map(Entry::getNode)
- .filter(SemanticNode::isLeaf)
- .map(SemanticNode::getLeafTextBlock)
- .collect(new TextBlockCollector());
- }
-
-
- public List createNewMainEntryAndReturnId(GenericSemanticNode node) {
-
- return createNewChildEntryAndReturnIdImpl(Collections.emptyList(), node);
- }
-
-
- public List createNewChildEntryAndReturnId(GenericSemanticNode parentNode, GenericSemanticNode node) {
-
- return createNewChildEntryAndReturnIdImpl(parentNode.getTreeId(), node);
- }
-
-
- public List createNewChildEntryAndReturnId(GenericSemanticNode parentNode, Table node) {
-
- return createNewChildEntryAndReturnIdImpl(parentNode.getTreeId(), node);
- }
-
-
- public List createNewTableChildEntryAndReturnId(Table parentTable, TableCell tableCell) {
-
- return createNewChildEntryAndReturnIdImpl(parentTable.getTreeId(), tableCell);
- }
-
-
- @SuppressWarnings("PMD.UnusedPrivateMethod") // PMD actually flags this wrong
- private List createNewChildEntryAndReturnIdImpl(List parentId, SemanticNode node) {
-
- if (!entryExists(parentId)) {
- throw new IllegalArgumentException(format("parentId %s does not exist!", parentId));
- }
-
- Entry parent = getEntryById(parentId);
- List newId = new LinkedList<>(parentId);
- newId.add(parent.children.size());
- parent.children.add(Entry.builder().treeId(newId).node(node).build());
-
- return newId;
- }
-
-
- private boolean entryExists(List treeId) {
-
- if (treeId.isEmpty()) {
- return root != null;
- }
- Entry entry = root.children.get(treeId.get(0));
- for (int id : treeId.subList(1, treeId.size())) {
- if (id >= entry.children.size() || 0 > id) {
- return false;
- }
- entry = entry.children.get(id);
- }
- return true;
- }
-
-
- public Entry getParentEntryById(List treeId) {
-
- return getEntryById(getParentId(treeId));
- }
-
-
- public boolean hasParentById(List treeId) {
-
- return !treeId.isEmpty();
- }
-
-
- public Stream childNodes(List treeId) {
-
- return getEntryById(treeId).children.stream()
- .map(Entry::getNode);
- }
-
-
- public Stream childNodesOfType(List treeId, NodeType nodeType) {
-
- return getEntryById(treeId).children.stream()
- .filter(entry -> entry.node.getType().equals(nodeType))
- .map(Entry::getNode);
- }
-
-
- private static List getParentId(List treeId) {
-
- if (treeId.isEmpty()) {
- throw new UnsupportedOperationException("Root has no parent!");
- }
- if (treeId.size() < 2) {
- return Collections.emptyList();
- }
- return treeId.subList(0, treeId.size() - 1);
- }
-
-
- public Entry getEntryById(List treeId) {
-
- if (treeId.isEmpty()) {
- return root;
- }
- Entry entry = root;
- for (int id : treeId) {
- entry = entry.children.get(id);
- }
- return entry;
- }
-
-
- public Stream mainEntries() {
-
- return root.children.stream();
- }
-
-
- public Stream allEntriesInOrder() {
-
- return Stream.of(root)
- .flatMap(DocumentTree::flatten);
- }
-
-
- public Stream allSubEntriesInOrder(List parentId) {
-
- return getEntryById(parentId).children.stream()
- .flatMap(DocumentTree::flatten);
- }
-
-
- @Override
- public String toString() {
-
- return String.join("\n",
- allEntriesInOrder().map(Entry::toString)
- .toList());
- }
-
-
- private static Stream flatten(Entry entry) {
-
- return Stream.concat(Stream.of(entry),
- entry.children.stream()
- .flatMap(DocumentTree::flatten));
- }
-
-
- public SemanticNode getHighestParentById(List treeId) {
-
- if (treeId.isEmpty()) {
- return root.node;
- }
- return root.children.get(treeId.get(0)).node;
- }
-
-
- @Builder
- @Getter
- @AllArgsConstructor
- @FieldDefaults(level = AccessLevel.PRIVATE, makeFinal = true)
- public static class Entry {
-
- List treeId;
- SemanticNode node;
- @Builder.Default
- List children = new LinkedList<>();
-
-
- @Override
- public String toString() {
-
- return node.toString();
- }
-
-
- public NodeType getType() {
-
- return node.getType();
- }
-
- }
-
-}
diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/NodeVisitor.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/NodeVisitor.java
deleted file mode 100644
index 61086a9..0000000
--- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/NodeVisitor.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package com.knecon.fforesight.service.layoutparser.processor.model.graph;
-
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Document;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Footer;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Header;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Headline;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Image;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Paragraph;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Section;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.SuperSection;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Table;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.TableCell;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.TableOfContents;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.TableOfContentsItem;
-
-import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
-
-public interface NodeVisitor {
-
- void visit(Document document);
-
-
- void visit(SuperSection superSection);
-
-
- void visit(Section section);
-
-
- void visit(Headline headline);
-
-
- void visit(Paragraph paragraph);
-
-
- void visit(Footer footer);
-
-
- void visit(Header header);
-
-
- void visit(Image image);
-
-
- void visit(Table table);
-
-
- void visit(TableCell tableCell);
-
-
- void visit(TableOfContents tableOfContents);
-
-
- void visit(TableOfContentsItem tableOfContentsItem);
-
-}
diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/TextRange.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/TextRange.java
deleted file mode 100644
index eda21dc..0000000
--- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/TextRange.java
+++ /dev/null
@@ -1,166 +0,0 @@
-package com.knecon.fforesight.service.layoutparser.processor.model.graph;
-
-import static java.lang.String.format;
-
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.stream.IntStream;
-
-import lombok.EqualsAndHashCode;
-import lombok.Setter;
-
-@Setter
-@EqualsAndHashCode
-@SuppressWarnings("PMD.AvoidFieldNameMatchingMethodName")
-public class TextRange implements Comparable {
-
- private int start;
- private int end;
-
-
- public TextRange(int start, int end) {
-
- if (start > end) {
- throw new IllegalArgumentException(format("start: %d > end: %d", start, end));
- }
- this.start = start;
- this.end = end;
- }
-
-
- public int length() {
-
- return end - start;
- }
-
-
- public int start() {
-
- return start;
- }
-
-
- public int end() {
-
- return end;
- }
-
-
- public boolean contains(TextRange textRange) {
-
- return start <= textRange.start() && textRange.end() <= end;
- }
-
-
- public boolean containedBy(TextRange textRange) {
-
- return textRange.contains(this);
- }
-
-
- public boolean contains(int start, int end) {
-
- if (start > end) {
- throw new IllegalArgumentException(format("start: %d > end: %d", start, end));
- }
- return this.start <= start && end <= this.end;
- }
-
-
- public boolean containedBy(int start, int end) {
-
- if (start > end) {
- throw new IllegalArgumentException(format("start: %d > end: %d", start, end));
- }
- return start <= this.start && this.end <= end;
- }
-
-
- public boolean contains(int index) {
-
- return start <= index && index <= end;
- }
-
-
- public boolean containsExclusive(int index) {
-
- return start <= index && index < end;
- }
-
-
- public boolean intersects(TextRange textRange) {
-
- return textRange.start() < this.end && this.start < textRange.end();
- }
-
-
- public List split(List splitIndices) {
-
- if (splitIndices.stream()
- .anyMatch(idx -> !this.contains(idx))) {
- throw new IndexOutOfBoundsException(format("%s splitting indices are out of range for %s",
- splitIndices.stream()
- .filter(idx -> !this.contains(idx))
- .toList(),
- this));
- }
- List splitBoundaries = new LinkedList<>();
- int previousIndex = start;
- for (int splitIndex : splitIndices) {
-
- // skip split if it would produce a boundary of length 0
- if (splitIndex == previousIndex) {
- continue;
- }
- splitBoundaries.add(new TextRange(previousIndex, splitIndex));
- previousIndex = splitIndex;
- }
- if (previousIndex != end) {
- splitBoundaries.add(new TextRange(previousIndex, end));
- }
- return splitBoundaries;
- }
-
-
- public IntStream intStream() {
-
- return IntStream.range(start, end);
- }
-
-
- public static TextRange merge(Collection boundaries) {
-
- int minStart = boundaries.stream()
- .mapToInt(TextRange::start)
- .min()
- .orElseThrow(IllegalArgumentException::new);
- int maxEnd = boundaries.stream()
- .mapToInt(TextRange::end)
- .max()
- .orElseThrow(IllegalArgumentException::new);
- return new TextRange(minStart, maxEnd);
- }
-
-
- @Override
- public String toString() {
-
- return format("Boundary [%d|%d)", start, end);
- }
-
-
- @Override
- public int compareTo(TextRange textRange) {
-
- if (end < textRange.end() && start < textRange.start()) {
- return -1;
- }
- if (start > textRange.start() && end > textRange.end()) {
- return 1;
- }
-
- return 0;
- }
-
-}
diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/entity/EntityType.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/entity/EntityType.java
deleted file mode 100644
index 838996d..0000000
--- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/entity/EntityType.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.knecon.fforesight.service.layoutparser.processor.model.graph.entity;
-
-public enum EntityType {
- ENTITY,
- RECOMMENDATION,
- FALSE_POSITIVE,
- FALSE_RECOMMENDATION
-}
diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/entity/RedactionPosition.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/entity/RedactionPosition.java
deleted file mode 100644
index dbf104c..0000000
--- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/entity/RedactionPosition.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.knecon.fforesight.service.layoutparser.processor.model.graph.entity;
-
-import java.awt.geom.Rectangle2D;
-import java.util.List;
-
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Page;
-
-import lombok.AccessLevel;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.experimental.FieldDefaults;
-
-@Data
-@AllArgsConstructor
-@FieldDefaults(level = AccessLevel.PRIVATE)
-public class RedactionPosition {
-
- final String id;
- Page page;
- // Each entry in this list corresponds to an entry in the redaction log, this means:
- // An entity might be represented by multiple redaction log entries
- List rectanglePerLine;
-
-}
diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/entity/TextEntity.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/entity/TextEntity.java
deleted file mode 100644
index 7d4d6f3..0000000
--- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/entity/TextEntity.java
+++ /dev/null
@@ -1,228 +0,0 @@
-package com.knecon.fforesight.service.layoutparser.processor.model.graph.entity;
-
-import java.awt.geom.Rectangle2D;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.Deque;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import com.iqser.red.service.persistence.service.v1.api.shared.model.redactionlog.Engine;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.TextRange;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Page;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.SemanticNode;
-import com.knecon.fforesight.service.layoutparser.processor.utils.IdBuilder;
-
-import lombok.AccessLevel;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.FieldDefaults;
-
-@Data
-@Builder
-@AllArgsConstructor
-@FieldDefaults(level = AccessLevel.PRIVATE)
-@EqualsAndHashCode(onlyExplicitlyIncluded = true)
-public class TextEntity {
-
- // initial values
- @EqualsAndHashCode.Include
- final TextRange textRange;
- @EqualsAndHashCode.Include
- final String type;
- @EqualsAndHashCode.Include
- final EntityType entityType;
-
- // empty defaults
- boolean redaction;
- boolean removed;
- boolean ignored;
- boolean resized;
- boolean skipRemoveEntitiesContainedInLarger;
- boolean dictionaryEntry;
- boolean dossierDictionaryEntry;
- Set engines;
- Set references;
- @Builder.Default
- Deque matchedRules = new LinkedList<>();
- String redactionReason;
- String legalBasis;
-
- // inferred on graph insertion
- @EqualsAndHashCode.Include
- String value;
- String textBefore;
- String textAfter;
- @Builder.Default
- Set pages = new HashSet<>();
- List redactionPositionsPerPage;
- @Builder.Default
- List intersectingNodes = new LinkedList<>();
- SemanticNode deepestFullyContainingNode;
-
-
- public static TextEntity initialEntityNode(TextRange textRange, String type, EntityType entityType) {
-
- return TextEntity.builder().type(type).entityType(entityType).textRange(textRange).engines(new HashSet<>()).references(new HashSet<>()).build();
- }
-
-
- public boolean occursInNodeOfType(Class extends SemanticNode> clazz) {
-
- return intersectingNodes.stream().anyMatch(clazz::isInstance);
- }
-
-
- public boolean occursInNode(SemanticNode semanticNode) {
-
- return intersectingNodes.stream().anyMatch(node -> node.equals(semanticNode));
- }
-
-
- public boolean isType(String type) {
-
- return this.type.equals(type);
- }
-
-
- public boolean isAnyType(List types) {
-
- return types.contains(type);
- }
-
-
- public void addIntersectingNode(SemanticNode containingNode) {
-
- intersectingNodes.add(containingNode);
- }
-
-
- public void removeFromGraph() {
-
- intersectingNodes.forEach(node -> node.getEntities().remove(this));
- pages.forEach(page -> page.getEntities().remove(this));
- intersectingNodes = new LinkedList<>();
- deepestFullyContainingNode = null;
- pages = new HashSet<>();
- removed = true;
- ignored = true;
- }
-
-
- public void addMatchedRule(int ruleNumber) {
-
- matchedRules.add(ruleNumber);
- }
-
-
- public int getMatchedRule() {
-
- if (matchedRules.isEmpty()) {
- return 0;
- }
- return matchedRules.getLast();
- }
-
-
- public List getRedactionPositionsPerPage() {
-
- if (redactionPositionsPerPage == null || redactionPositionsPerPage.isEmpty()) {
- Map> rectanglesPerLinePerPage = deepestFullyContainingNode.getTextBlock().getPositionsPerPage(textRange);
-
- Page firstPage = rectanglesPerLinePerPage.keySet()
- .stream()
- .min(Comparator.comparingInt(Page::getNumber))
- .orElseThrow(() -> new RuntimeException("No Positions found on any page!"));
- String id = IdBuilder.buildId(pages, rectanglesPerLinePerPage.values().stream().flatMap(Collection::stream).toList());
- redactionPositionsPerPage = rectanglesPerLinePerPage.entrySet().stream().map(entry -> buildRedactionPosition(firstPage, id, entry)).toList();
- }
- return redactionPositionsPerPage;
- }
-
-
- private static RedactionPosition buildRedactionPosition(Page firstPage, String id, Map.Entry> entry) {
-
- if (entry.getKey().equals(firstPage)) {
- return new RedactionPosition(id, entry.getKey(), entry.getValue());
- } else {
- return new RedactionPosition(id + "-" + entry.getKey().getNumber(), entry.getKey(), entry.getValue());
- }
- }
-
-
- public boolean containedBy(TextEntity textEntity) {
-
- return this.textRange.containedBy(textEntity.getTextRange());
- }
-
-
- public boolean contains(TextEntity textEntity) {
-
- return this.textRange.contains(textEntity.getTextRange());
- }
-
-
- public boolean intersects(TextEntity textEntity) {
-
- return this.textRange.intersects(textEntity.getTextRange());
- }
-
-
- public void addEngine(Engine engine) {
-
- engines.add(engine);
- }
-
-
- public void addEngines(Set engines) {
-
- this.engines.addAll(engines);
- }
-
-
- public void addReference(TextEntity reference) {
-
- references.add(reference);
- }
-
-
- public void addReferences(List references) {
-
- this.references.addAll(references);
- }
-
-
- public boolean matchesAnnotationId(String manualRedactionId) {
-
- return getRedactionPositionsPerPage().stream().anyMatch(entityPosition -> entityPosition.getId().equals(manualRedactionId));
- }
-
-
- @Override
- public String toString() {
-
- StringBuilder sb = new StringBuilder();
- sb.append("Entity[\"");
- sb.append(value);
- sb.append("\", ");
- sb.append(textRange);
- sb.append(", pages[");
- pages.forEach(page -> {
- sb.append(page.getNumber());
- sb.append(", ");
- });
- sb.delete(sb.length() - 2, sb.length());
- sb.append("], type = \"");
- sb.append(type);
- sb.append("\", EntityType.");
- sb.append(entityType);
- sb.append("]");
- return sb.toString();
- }
-
-}
diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/nodes/AbstractSemanticNode.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/nodes/AbstractSemanticNode.java
deleted file mode 100644
index 52be80d..0000000
--- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/nodes/AbstractSemanticNode.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes;
-
-import java.awt.geom.Rectangle2D;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.DocumentTree;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.entity.TextEntity;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.textblock.TextBlock;
-
-import lombok.AccessLevel;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.NoArgsConstructor;
-import lombok.experimental.FieldDefaults;
-import lombok.experimental.SuperBuilder;
-import lombok.extern.slf4j.Slf4j;
-
-@Slf4j
-@Data
-@SuperBuilder
-@AllArgsConstructor
-@NoArgsConstructor
-@FieldDefaults(level = AccessLevel.PRIVATE)
-public abstract class AbstractSemanticNode implements GenericSemanticNode {
-
- @Builder.Default
- Set engines = new HashSet<>(Set.of(LayoutEngine.ALGORITHM));
- List treeId;
-
- TextBlock textBlock;
- @EqualsAndHashCode.Exclude
- DocumentTree documentTree;
-
- @Builder.Default
- @EqualsAndHashCode.Exclude
- Set entities = new HashSet<>();
-
- @EqualsAndHashCode.Exclude
- Map bBoxCache;
-
-
- @Override
- public TextBlock getTextBlock() {
-
- if (textBlock == null) {
- textBlock = GenericSemanticNode.super.getTextBlock();
- }
- return textBlock;
- }
-
-
- @Override
- public String toString() {
-
- return treeId.toString() + ": " + getType() + ": " + this.getTextBlock().buildSummary();
- }
-
-
- @Override
- public Map getBBox() {
-
- if (bBoxCache == null) {
- bBoxCache = GenericSemanticNode.super.getBBox();
- }
- return bBoxCache;
- }
-
-}
diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/nodes/Document.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/nodes/Document.java
deleted file mode 100644
index 7d4f86d..0000000
--- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/nodes/Document.java
+++ /dev/null
@@ -1,173 +0,0 @@
-package com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes;
-
-import java.awt.geom.Rectangle2D;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.DocumentTree;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.NodeVisitor;
-import com.knecon.fforesight.service.layoutparser.processor.model.graph.textblock.TextBlock;
-import com.knecon.fforesight.service.layoutparser.processor.visualization.LayoutDebugLayer;
-
-import lombok.AccessLevel;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.NoArgsConstructor;
-import lombok.experimental.FieldDefaults;
-import lombok.experimental.SuperBuilder;
-
-@Data
-@SuperBuilder
-@AllArgsConstructor
-@NoArgsConstructor
-@EqualsAndHashCode(callSuper = true)
-@FieldDefaults(level = AccessLevel.PRIVATE)
-public class Document extends AbstractSemanticNode {
-
- Set pages;
- Integer numberOfPages;
-
- LayoutDebugLayer layoutDebugLayer;
-
-
- @Override
- public NodeType getType() {
-
- return NodeType.DOCUMENT;
- }
-
-
- /**
- * Gets the sections of the document as a list.
- *
- * @return A list of all sections within the document.
- */
- public List getAllSections() {
-
- return streamAllSubNodesOfType(NodeType.SECTION).map(node -> (Section) node)
- .collect(Collectors.toList());
- }
-
-
- /**
- * Gets the main sections of the document as a list.
- *
- * @return A list of main sections within the document
- * @deprecated This method is marked for removal.
- * Use {@link #streamChildrenOfType(NodeType)} instead,
- * or {@link #getChildrenOfTypeSectionOrSuperSection()} which returns children of type SECTION as well as SUPER_SECTION.
- */
- @Deprecated(forRemoval = true)
- public List getMainSections() {
-
- return streamChildrenOfType(NodeType.SECTION).map(node -> (Section) node)
- .collect(Collectors.toList());
- }
-
-
- /**
- * Gets the direct children of type SECTION or SUPER_SECTION of the document as a list of SemanticNode objects.
- *
- * @return A list of all children of type SECTION or SUPER_SECTION.
- */
- public List getChildrenOfTypeSectionOrSuperSection() {
-
- return streamChildren().filter(semanticNode -> semanticNode.getType().equals(NodeType.SECTION) || semanticNode.getType().equals(NodeType.SUPER_SECTION))
- .toList();
- }
-
-
- public List getHeaders() {
-
- return streamChildrenOfType(NodeType.HEADER).map(node -> (Header) node)
- .collect(Collectors.toList());
- }
-
-
- public List