Refactor Context Groups & Area Detection #4

Merged
yehoshuasandler merged 2 commits from refact-context-group into main 2023-09-02 10:58:39 -05:00
yehoshuasandler commented 2023-09-02 10:45:41 -05:00 (Migrated from github.com)

Refactor Context Groups

Made the linked list of ContextGroups groups simpler in structure and add more functionality to them.

UX has been added for a user to draw lines between Areas to create/add/remove Areas into a ContextGroup.

The ContextGroup is a doubly linked list in the Go backend that will be able to be used to trace, store, and query the relationship between Areas.

Area Detection

Discovered more settings for Tessreact that allows for column and paragraph detection.

Decided to change the UX of the DrawingArea from creating a single area of that Rect, into, the bounds of that Rect are used to detect the Paragraphs of the Document.

These Paragraphs are then used to make Areas to be stored and Processed


Vulnerable Areas

  1. The doubly linked list of ContextGroups is working but needs to cleanup, mainly in naming to make it more human readable.

  2. A TODO is marked in processImageArea.ts for this:

After either RequestUpdateProcessedArea() or RequestAddProcessedArea() is called, the boolean didSuccessfullyProcess was updated with its value GO, which use to be a boolean.

RequestAddProcessedArea() now returns the actual Area that was added, which means that RequestAddProcessedArea would now instead return an empty Area instance on failure instead of a false.

So for speed and lazyness, processImageArea() now just defaults to true unless there was a catch(err)

## Refactor Context Groups Made the linked list of `ContextGroups` groups simpler in structure and add more functionality to them. UX has been added for a user to draw lines between `Area`s to create/add/remove `Area`s into a `ContextGroup`. The `ContextGroup` is a doubly linked list in the Go backend that will be able to be used to trace, store, and query the relationship between `Area`s. ## Area Detection Discovered more settings for Tessreact that allows for `column` and `paragraph` detection. Decided to change the UX of the `DrawingArea` from creating a single area of that Rect, into, the bounds of that Rect are used to detect the `Paragraphs` of the `Document`. These `Paragraphs` are then used to make `Area`s to be stored and Processed <hr /> **Vulnerable Areas** 1. The doubly linked list of `ContextGroups` is working but needs to cleanup, mainly in naming to make it more human readable. 2. A TODO is marked in `processImageArea.ts` for this: > After either `RequestUpdateProcessedArea()` or `RequestAddProcessedArea()` is called, the boolean `didSuccessfullyProcess` was updated with its value GO, which use to be a boolean. > > `RequestAddProcessedArea()` now returns the actual `Area` that was added, which means that `RequestAddProcessedArea` would now instead return an empty `Area` instance on failure instead of a `false`. > > So for speed and lazyness, `processImageArea()` now just defaults to `true` unless there was a `catch(err)`
Sign in to join this conversation.
No description provided.