我們團隊開始修訂一部已出版的新約翻譯。起初我們很樂觀,希望不會花太長時間,也不需要做太多改動。現在,我們發現超過 90% 的經節都已被修改。
我們在 Paratext 外部完成了所有修訂工作。原因有很多,這裡就不細說了。然而,現在我們即將完成,需要將工作匯回 Paratext。
我們擁有的文本結構非常簡單,你可以把它想像成一個表格,第一列是經節參考(例如:馬可福音 1:1),第二列是經節的純文字內容。沒有標題、沒有段落標記、沒有腳註,也沒有其他類似內容。我想使用現有的 USFM,並用新文本進行更新。我開發了一些代碼來完成這件事,主要使用 usfm-grammar。我將現有的 USFM 轉換為 JSON,修改 JSON 以更新翻譯,然後使用同一工具將翻譯轉換回 USFM。
然而,我注意到保留標題、段落和交叉引用是很棘手的。我花了一兩天時間處理這個問題(包括決定採用這種方法),如果這不是我時間的良好用途,我真的不想花太多時間編寫程式。當我將結果匯回 Paratext 時,它會抱怨 USFM 無效。看來 usfm-grammar 可以產生無效的 USFM。
我尋找了用於編寫 USFM 的函式庫。我找到了許多解析 USFM 和將 USFM 轉換為其他格式的選項,但 usfm-grammar 是我找到的唯一能編寫 USFM(將 JSON 轉換為 USFM)的函式庫。
我現在正在考慮兩個選項:
- 繼續開發一個工具,可以將純文字修訂版與現有的 USFM 合併。
- 或者……基本上在 Paratext 中啟動一個新專案,將純文字作為 USFM 匯入,而不嘗試將其與現有翻譯中的標題和其他資訊合併。
我已經嘗試過選項 2。正如你可以想像的,產生像這樣的輸出相當容易:
\id MRK
\c 1
\p
\v 1 the first verse
\v 2 the second verse
\v 3 the third verse
\v 4 etc
你會給我什麼建議?我目前傾向於選項 2,並手動完成添加標題和交叉引用的工作。標題本來就需要手動修訂。
In our team, we embarked on revising a published translation of the New Testament. In the beginning we were optimistic, hoping that we wouldn’t take long, and that not many changes need to be made. Now, we have found over 90% of the verses have been modified.
We did all our work on the revision externally from Paratext. This is for many reasons, that I won’t get in to here. However, now that we are nearing the finish line, we need to work on importing the work back into Paratext.
The text we have is structured very simply, you can think of it as a table, where the first column is the verse reference (eg: Mark 1:1), and the second column is the contents of the verse in plain text. There are no headings, no paragraph markers, no footnotes, nothing like that. I wanted to take the existing USFM, and update it with the new text. I developed some code that did this, mainly using usfm-grammar. I took the existing USFM, converted it to JSON, modified the JSON to update the translation, and then converted the translation back to USFM using the same tool.
However, I’m noticing that keeping the headers, paragraphs and cross-references preserved is tricky. I spent a day or two working on this (including the process of deciding upon this approach), and I don’t really want to spend a lot of time programming something if it is not a good use of my time. When I imported the result back to Paratext, it would complain about invalid USFM. So it looks like usfm-grammar can produce invalid USFM.
I had a look for libraries to write USFM. I found quite a few options for parsing USFM and for converting USFM to other formats, but usfm-grammar was the only library that I found that could write USFM, converting JSON to USFM.
I’m now looking at two options:
- Continue to develop a tool that can merge plain text revisions with the existing USFM.
- or… effectively start a new project in Paratext, importing the plain text as USFM, without attempting to merge it with the existing headers and other information in the existing translation.
I’ve already tried option 2. As you can imagine, it was quite easy to generate output like this:
\id MRK
\c 1
\p
\v 1 the first verse
\v 2 the second verse
\v 3 the third verse
\v 4 etc
What advice would you give me? I’m currently leaning towards option 2, and just doing the work of adding back the headers and cross-references manually. The headers need a manual revision any way.