Quote:
Originally Posted by BKh
I have an interlinear text with verses where the six lines of text are interspersed, and each line has an index number.
Code:
<p>index1 originalline1 tranlsationline1
index2 originalline2 tranlsationline2
index3 originalline3 tranlsationline3
index4 originalline4 tranlsationline4
index5 originalline5 tranlsationline5
index6 originalline6 tranlsationline6</p>
|
1. Can you show a few actual examples out of your book?
2. Are the index numbers chronological?
3. Are the different languages marked up in any way? (How can you tell which one is language1 + language2?)
Step 1 would be infinitely easier if your stuff is actually marked up with proper lang:
Quote:
100 <span class="english" lang="en" xml:lang="en">This is an example verse</span> <span class="spanish" lang="es" xml:lang="es">Este es un verso de ejemplo</span>
101 <span class="english" lang="en" xml:lang="en">[...]</span> <span class="spanish" lang="es" xml:lang="es">[...]</span>
|
Note: To format your code nicer, you can put your code in between [CODE][/CODE] tags. In MobileRead's "Advanced Editor", it also looks like a # button.
Note #2: What I'm thinking is a multi-pass approach. Something like:
Step 1: Split the original+translated and temporarily tag the index:
Code:
Orig:index1 originalline1
Tran:index1 tranlsationline1
Orig:index2 originalline2
Tran:index2 tranlsationline2
[...]
Orig:index6 originalline6
Tran:index6 tranlsationline6
Step 2: Swap any "Tran:" line if an "Orig:" is below:
Code:
Orig:index1 originalline1
Orig:index2 originalline2
[...]
Orig:index6 originalline6
Tran:index1 tranlsationline1
Tran:index2 tranlsationline2
[...]
Tran:index6 tranlsationline6
Step 3: Remove the "Orig:" + "Tran:".
... But it all depends on your actual text...