I have written a Python script which might solve @anon023887’s problem. It uses a text file with the references of all of the paragraph markers from a reference project (the references for GNTD NT are supplied) and applies those paragraph markers in the project you specify.
To use the script, put the four files from this zip file into the C:\My Paratext 8 Projects\cms
folder:
ApplyParagraphMarkers.zip (8.4 KB)
(If you use a different Paratext project folder, you will need to edit the .py file with the path to the GNTD_NT_para.txt
file. @anon291708 Is there a way to start the script in the cms folder rather than the program folder? That would be nicer…)
Restart Paratext (so that it will see the new .cms file). Then in the project menu of the project where you want to apply the paragraph markers, (expand to full menus) select Tools > Custom Tools > Unsupported > Apply Paragraph Markers [CAN CHANGE TEXT]. The Input Project should already be the current project. Leave the Output Project as the same project if you want to make the changes directly in the project. (N.B. you should send Output to a test project for initial tests, or at least mark a point in the history of your project.) Select the books to process. Then click OK to apply the paragraph markers to the selected books.
References that cannot be processed will be noted in the closing dialog, so that you can consider placing them manually:
The script can’t place a \p before verse 6b, because it is in the middle of a verse. So you will need to consider that \p placement manually in your text. I don’t know why the script is seeing MATMAT 1:21 (it’s not in the text file), but in this case you will need to consider inserting a \p manually before MAT 1:22 as well.
Speaking of placing \p markers manually, there is a separate file included: GNTD_NT_para_within_verses.txt
, which is a list of 262 references of \p markers in the GNTD NT that are in the middle of verses, i.e. the \p is followed by a space instead of a line break. Each of those cases will need to be considered manually in your text, as the script can’t place those \p markers automatically.
I include below the description of the script that appears when you run it (from the cms file), which might provide some additional help.
Let me know if you have questions or comments.
Description: (Is there a way to get \n in the description without a new line?)
Apply paragraph markers from a reference list to the selected books of a project. If the Output Project is the same as the Input Project, the changes will be made “in place”.
The reference list contains one reference per line, indicating the places that paragraph markers were found in the reference text, e.g. “MAT 5:0”, “MAT 5:10”. The markers will be placed before the following verse, for this example “MAT 5:1” and “5:11”. Paragraph markers in the text before verses NOT in the reference list will be removed, but generally a paragraph marker in the middle of the verse will not be removed.
The reference list is hard coded in the ApplyParagraphMarkers.py script, as “C:\My Paratext 8 Projects\cms\GNTD_NT_para.txt”. You must edit the script if you want to change the list used, or if you have a non-standard Paratext project directory. There is also a file “GNTD_NT_para_within_verses.txt” which gives references for paragraph marks found in the middle of verses. The script can’t place these automatically, so you will need to manually consider placement of \p markers near each of these references.
To produce a new reference list, use RegEx Pal to Extract (with Include References) this term (no quotes, and remove the space before the ‘n’): “\p\r?\ n” Select the output, copy and paste in a text editor, remove “:\t \p” from each line to leave just the reference, then save it as a text file. You will likely want to also Extract this term: "\p " (with space). This will provide a list of paragraph markers that are in the middle of verses. They cannot be placed automatically by the script, so they should be considered manually.