<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body><div><div style="font-family: Calibri,sans-serif; font-size: 11pt;">Does it supported nested tags?<br><br>On a related note, if people want a usx converter to osis, please let me know.<br><br>Cheers<br>Chris</div></div><div dir="ltr"><hr><span style="font-family: Calibri,sans-serif; font-size: 11pt; font-weight: bold;">From: </span><span style="font-family: Calibri,sans-serif; font-size: 11pt;"><a href="mailto:dfhmch@googlemail.com">David Haslam</a></span><br><span style="font-family: Calibri,sans-serif; font-size: 11pt; font-weight: bold;">Sent: </span><span style="font-family: Calibri,sans-serif; font-size: 11pt;">30/07/2015 20:07</span><br><span style="font-family: Calibri,sans-serif; font-size: 11pt; font-weight: bold;">To: </span><span style="font-family: Calibri,sans-serif; font-size: 11pt;"><a href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a></span><br><span style="font-family: Calibri,sans-serif; font-size: 11pt; font-weight: bold;">Subject: </span><span style="font-family: Calibri,sans-serif; font-size: 11pt;">Re: [sword-devel] usfm to osis converter...</span><br><br></div>Thanks, Ryan. This looks very interesting. I expect that John Austin and<br>others would also find it useful.<br><br>Your description (qv) of the project should grab our attention.<br><br>I wrote my own USFM to OSIS converter in python. There are several reasons<br>for this:<br><br> The usfm2osis.py converter mentioned above runs way too slow on my<br>computer. (It takes more than 2 minutes to process the World English Bible).<br>I thought I could make one that ran faster.<br> The usfm2osis.py converter source is difficult for me to read, so I'm<br>unable to work on improving it. Obviously it would be better to submit<br>improvements to that script, but my limitations prevent that. I think the<br>biggest difficulty I have with reading the code is the huge amount of<br>complicated regular expressions it uses... about 200! Which reminds me of a<br>Jamie Zawinski quote.... “Some people, when confronted with a problem, think<br>‘I know, I'll use regular expressions.’ Now they have two problems.”<br>(Sometimes they make sense, though. The script I wrote has 9 of them.)<br> I wanted a converter that targeted python3. (usfm2osis.py targeted only<br>python2 when I began working on my converter.)<br> I wanted a converter that would be easy to update when changes are made<br>to the USFM standard.<br> I thought it would be a fun project. (it was!)<br><br>I've tested it with CPython 2.7.6 and CPython3 3.4.0 and it works fine in<br>both of those versions of python. (This script works with pypy, pypy3, and<br>jython 2.7.0 as well, but they are signfiicantly slower at running this<br>script than CPython. I haven't tested it with IronPython as I don't have<br>that implementation of the python language.) It is public domain. You may do<br>whatever you wish with the code.<br><br>It's quite fast. For example, it only takes about 10 seconds to process the<br>World English Bible on my computer. That's about a 90% reduction in<br>processing time compared with usfm2osis.py in my testing. The output<br>validates against the OSIS 2.1.1 schema. No markup errors are reported by<br>osis2mod when generating modules for any of the bibles that I have access to<br>at this time.<br><br>----<br><br>Best regards,<br><br>David<br><br><br><br>--<br>View this message in context: http://sword-dev.350566.n4.nabble.com/usfm-to-osis-converter-tp4654838p4654840.html<br>Sent from the SWORD Dev mailing list archive at Nabble.com.<br><br>_______________________________________________<br>sword-devel mailing list: sword-devel@crosswire.org<br>http://www.crosswire.org/mailman/listinfo/sword-devel<br>Instructions to unsubscribe/change your settings at above page</body></html>