Skip to content

Commit

Permalink
New ParatextVPL format
Browse files Browse the repository at this point in the history
  • Loading branch information
schierlm committed May 3, 2024
1 parent db6a1e9 commit f242bd1
Show file tree
Hide file tree
Showing 6 changed files with 379 additions and 5 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ SQLite based formats or for importing MyBible.Zone bibles.
The **ParatextConverter** tool can be used to convert between USFM/USFX/USX formats
without converting to BibleMultiConverter's internal format first, or to remove
tagged OT/NT/Deuterocanonical content from such a file. It can also be used to convert
to **ParatextDump** format (which is a diffable plain text dump of the internal Paratext
structure and useful for comparing different Paratext formats).
from/to **ParatextDump** (which is a diffable plain text dump of the internal Paratext
structure and useful for comparing different Paratext formats) and **ParatextVPL** (which is
a different diffable format that looks more like VPL, but uses Paratext tags) formats.

The **MyBibleZoneListDownloader** tool (part of SQLite edition) can be used to download
the list of available MyBible.Zone modules from the module registry (that is also queried
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public Collection<Module<RoundtripFormat>> getRoundtripFormats() {
result.add(new Module<RoundtripFormat>("USX", "XML Bible format used by Paratext and the Digital Bible Library (version 2)", USX.HELP_TEXT, USX.class));
result.add(new Module<RoundtripFormat>("USX3", "XML Bible format used by Paratext and the Digital Bible Library (version 3)", USX3.HELP_TEXT, USX3.class));
result.add(new Module<RoundtripFormat>("ParatextDump", "Dump a Paratext bible to diffable plain text", ParatextDump.HELP_TEXT, ParatextDump.class));
result.add(new Module<RoundtripFormat>("ParatextVPL", "VPL inspired format using Paratext tags", ParatextVPL.HELP_TEXT, ParatextVPL.class));
result.add(new Module<RoundtripFormat>("RoundtripODT", "ODT export and re-import", RoundtripODT.HELP_TEXT, RoundtripODT.class));
result.add(new Module<RoundtripFormat>("BibleWorks", "Plain text import and export format for BibleWorks", BibleWorks.HELP_TEXT, BibleWorks.class));
result.add(new Module<RoundtripFormat>("BibleWorksRTF", "RTF import and export format for BibleWorks", BibleWorksRTF.HELP_TEXT, BibleWorksRTF.class));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.util.Set;

import biblemulticonverter.data.BookID;
import biblemulticonverter.data.Utils;
import biblemulticonverter.data.FormattedText.FormattingInstructionKind;
import biblemulticonverter.format.paratext.ParatextCharacterContent.AutoClosingFormatting;
import biblemulticonverter.format.paratext.ParatextCharacterContent.ParatextCharacterContentPart;
Expand Down Expand Up @@ -524,10 +525,13 @@ public static Set<ParagraphKind> allForVersion(Version version) {
}

public static class TableCellStart implements ParatextBookContentPart {

public static final String TABLE_CELL_TAG_REGEX = "t[hc](c|r?[0-9]+(-[0-9]+)?)?";

private final String tag;

public TableCellStart(String tag) {
this.tag = tag;
this.tag = Utils.validateString("tag", tag, TABLE_CELL_TAG_REGEX);
}

public String getTag() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ protected void doExportBook(ParatextBook book, File outFile) throws IOException
}
}

private void writeBook(BufferedWriter bw, ParatextBook book) throws IOException {
protected void writeBook(BufferedWriter bw, ParatextBook book) throws IOException {
bw.write("BOOK\t" + book.getId().getIdentifier() + "\t" + book.getBibleName() + "\n");
for (Map.Entry<String, String> bookattr : book.getAttributes().entrySet()) {
bw.write("BOOKATTR\t" + bookattr.getKey() + "\t" + bookattr.getValue() + "\n");
Expand Down

0 comments on commit f242bd1

Please sign in to comment.