diff options
-rwxr-xr-x | modules/python/usfm2osis.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/python/usfm2osis.py b/modules/python/usfm2osis.py index cd99288..664cfdd 100755 --- a/modules/python/usfm2osis.py +++ b/modules/python/usfm2osis.py @@ -999,11 +999,12 @@ def convertToOSIS(sFile): def processOsisIDs(osis): + # TODO: add support for subverses, including in ranges/series, e.g. Matt.1.1!b-Matt.2.5,Matt.2.7!a # expand verse ranges, series def expandRange(vRange): vRange = re.findall(r'\d+', vRange) osisID = list() - for n in range(int(vRange[0]), int(vRange[1])+1): + for n in range(int(vRange[0]), max(int(vRange[0]), int(vRange[1]))+1): osisID.append('$BOOK$.$CHAP$.'+str(n)) return ' '.join(osisID) osis = re.sub(r'\$BOOK\$\.\$CHAP\$\.(\d+-\d+)"', lambda m: expandRange(m.group(1))+'"', osis) |