我们团队着手修订一部已出版的新约译本。起初我们很乐观,希望不会花太长时间,也不需要做太多改动。但现在我们发现,超过 90% 的经文都被修改了。
我们在 Paratext 外部完成了所有修订工作。原因有很多,这里就不赘述了。然而,现在临近收尾阶段,我们需要将修订后的内容重新导入 Paratext。
我们拥有的文本结构非常简单,可以将其视为一个表格,其中第一列是经文引用(例如:马可福音 1:1),第二列是经文的纯文本内容。没有标题,没有段落标记,没有脚注,也没有类似的东西。我想获取现有的 USFM 文件,并用新文本对其进行更新。我开发了一些代码来实现这一点,主要使用了 usfm-grammar。我获取现有的 USFM,将其转换为 JSON,修改 JSON 以更新翻译,然后使用同一工具将翻译转换回 USFM。
然而,我注意到保留标题、段落和交叉引用是一件棘手的事情。我花了一两天时间处理这个问题(包括决定采用这种方法的过程),如果这不是对我时间的良好利用,我真的不想花大量时间去编程。当我将结果重新导入 Paratext 时,它会抱怨 USFM 无效。因此,看起来 usfm-grammar 可能会生成无效的 USFM。
我查找了一些用于编写 USFM 的库。我找到了许多用于解析 USFM 和将 USFM 转换为其他格式的选项,但 usfm-grammar 是我找到的唯一能够将 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.