-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adopted documents: support "stitch" command for "alongside wrap" of two languages #742
Comments
So, stitch:[] is a minimally thought out request to embed two documents simultaneously, where the second document is a translation of the first, and the alignment between the two is to be realised by magic. It will not be realised by magic. Of the features specified in #420, the multilingual-rendering attributes will still need to be inserted into the two stitched documents, as will :align-cross-elements: : these documents will be marked up for bilingual alignment. At most, the stitching will assume that the clause structure of the two documents is identical, and where it is, it will insert tag in the two corresponding clauses to line them up explicitly. |
"Magic" is defined here for creating a element correspondence. The element correspondence between two languages is either manually encoded (e.g. anchors "id1@en" matches "id2@jp") or automatically matched according to sequence. There are cases of exceptions such as:
|
I will get some bioinformatics algorithm or other to do best-case match between the two sequences |
This is going to have to be processed as a collection:
What we actually want here is a preprocessing mode in collection processing, which
|
It appears multilingual-rendering to date has been implemented for rendering only for JCGM. |
I am not very enthusiastic about this, but I'm going to implement this in metanorma gem as a postprocessing of Presentation XML. There is code from @Intelligent2013 in JCGM XSLT to handle these tags, but I need to generalise this to HTML and DOC anyway. I will be following his code to arrange elements, including his use of the cross-align element. In fact, I'm going to try and use his XSLT in preprocessing. |
In collections processing, we really need to do without generating PDF of the individual documents; they will not be reused, and are just dead time for document compilation. |
The JCGM XSLT has a model of iterating through the first document in the collection, as a master, and all other documents in the collection, as (slaves) ahem, dependents. We cannot do that, because the first document is likeliest to be a preface: we will need markup in the manifest on the status of each document with bilingual alignment. Elements to be aligned are rendered inside |
@opoudjis the only true JCGM bilingual document is JCGM 200: JCGM 100 is in both English and French but they are published separately. There is ISO 2533 ADD 2 that is Trilingual and presented in three columns: But it is not yet encoded: |
I am making up a bilingual out of JCGM 100 at the moment, to see how far I can get in reusing Alex's XSLT, and I will be tinkering with that document. The JCGM 200 document alternating between one and two columns is irritating, but sadly realistic. |
The excerpted XSLT works (though it is generating an XSL:FO table, and not the |
Performance is better but not great: 47 sec for JCGM 100 (12 MB) to move text in place in parallel columns. Parking code in PR, not yet rendered. Both I and @Intelligent2013 will need to render Presentation XML |
For |
The proof of concept collection is JGCM 100 EN + FR. Am getting bi-column output, but it needs a lot of care, and parsing now needs to be a lot more dumb in just spitting out what it receives in Presentation XML, rather than being opinionated. |
This issue has been on hold too long. I will update the PRs to reflect current code, and merge them. Will document as experimental functionality. |
Got metanorma working, but it's based on wrapping clauses inside /cross-align/align-cell. Since we uniformly expect clauses to be children of preface and sections, and we render based on displayorder attributes of clauses, it is more sensible to nest cross-align within clauses. I won't do that for now, but I will copy displayorder to cross-align from the clause it contains, as it is otherwise preventing rendering at all. But nesting clauses within align-cell is counterproductive, I would rather the alignment be based on attributes, as it is in preliminary processing. The code is currently specific to JCGM, and I think it will need to be rethought. But walking away from this, now that the PRs are being resolved. |
cross-align/align-cell is resulting in titles being stranded away from their clause parents; that's why the HTML rendering does not understand any titles at the moment, because isodoc expects to find titles only as children of clauses:
Will make processing titles more flexible. |
This issue is to support "alongside wrap" detailed at /~https://github.com/metanorma/metanorma-bsi/issues/2#issuecomment-852269964
Alongside wrap. A wraps B. B is unmodified. A provides additional content C where C corresponds to a transformation of B (e.g. a translation of B). A provides additional content outside of B and C.
The aligning/stitching command is called
stitch
below.This is all speculative so the actual commands can differ in real usage.
Alongside wrap
en-iso-44001-english.adoc
en-iso-44001-estonian.adoc
evs-en-iso-44001.adoc
Images
Cover:

National foreword with side by side translation:

European cover:

TOC side by side:

European foreword side by side:

Content side by side:

Annex with Estonian table first:

Table continue in Estonian:

English table:

Bibliography with heading in 2 languages, content only English:
Index in Estonian:
Index in English:

Back cover:

Originally posted by @ronaldtse in /~https://github.com/metanorma/metanorma-bsi/issues/2#issuecomment-852269964
The text was updated successfully, but these errors were encountered: