Add a text anchor table
This table represents a position or a range in a text:
Columns:
- text: reference to the text
- anchor_start: word start idx in text
- anchor_end: word end idx in text
- validity:
valid
/pruned
if anchor_start + 1== anchor_end : one word position
Function:
migrate_text(old_text, old_anchor_start, old_anchor_end, new_text) -> (new_anchor_start, new_anchor_end)
This function is called each time the text is updated.
If the function cannot compute the new anchors from the olds, it set the row with the flag pruned
A pruned
text_anchor has invalid words position, and should be corrected by an user.