suttacentral / bilara

Our Computer Aided Translation software
10 stars 8 forks source link

make spreadsheet-like ability to split and merge rows #149

Open sujato opened 1 year ago

sujato commented 1 year ago

The main purpose of this is for expert speakers of root languages, so that they can adjust the segmentation of the text via the web app. This is especially important when adding new root texts.

Superusers will be able to split, edit, and merge the rows of the text, a bit like the "add new row" and "merge row" functions of a spreadsheet. Currently to do this we use Bilara i/o, which exports the data as tsv, then edit in a spreadsheet, then import again. This is powerful, but clumsy and error-prone, and not something a regular user would do.

The basic idea would be:

Split:

Merge:

The important thing is that all associated Bilara-data is updated properly. Thus all following rows must have their segment numbers incremented/decremented appropriately.

In more detail.

split

When splitting, we cannot automate how the text is split. So we leave the text on the original row and add a new blank row. The superuser manually cuts and pastes the root text and their translation if any.

Normally references will simply stay with the initial row, nothing to be done here.

split HTML

HTML can normally be split automatically. The basic cases:

merge

Normally we can automate merging, but superusers and translators should visually check.

segment number incrementation

After splitting/merging, we must increment the subsequent Bilara segments.

Now, in Bilara we typically have major and minor segment numbers. The incrementation applies to the minor number, and only until the next major number.

Take the following sequence.

mn123:5.5: abcd
mn123:5.6: efg
mn123:5.7: hij
mn123:6.1: klm
mn123:6.2: nop

Split the first segment:

mn123:5.5: abc
mn123:5.6: d
mn123:5.7: efg
mn123:5.8: hij
mn123:6.1: klm
mn123:6.2: nop

merge the first two segments of the original

mn123:5.5: abcdefg
mn123:5.6: hij
mn123:6.1: klm
mn123:6.2: nop

In some cases there are more the two levels of segment number (mn123:3.4.5) but in every case the incrementation happens only on the last number.