From 66d09daccf5fac0caa4bd5b143135a1355543312 Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Sat, 6 Jun 2026 21:42:13 -0400 Subject: handle wh --- usfm2gmi.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/usfm2gmi.py b/usfm2gmi.py index 32c5644..b7e993d 100755 --- a/usfm2gmi.py +++ b/usfm2gmi.py @@ -35,7 +35,7 @@ def superscript(word): def convert(line, printStrongs=False): """Convert a string to a list of tuples, each a token""" # TODO: preserve the lack of whitespace before a backslash. - split = line.replace('\\', ' \\').replace('\\nd*','\\nd* ').replace('\\+nd*','\\+nd* ').replace('\\f*','\\f* ').replace('\\wj*','\\wj* ').replace('\\w*',' \\w* ').replace('\\+w*', '\\+w* ').replace('\\ref*', '\\ref* ').split() + split = line.replace('\\', ' \\').replace('\\nd*','\\nd* ').replace('\\+nd*','\\+nd* ').replace('\\f*','\\f* ').replace('\\wj*','\\wj* ').replace('\\w*',' \\w* ').replace('\\+w*', '\\+w* ').replace('\\ref*', '\\ref* ').replace('\\+w', ' \\+w').replace('\\+wa*', '\\+wa* ').replace('\\+wg*', '\\+wg* ').replace('\\+wh*', '\\+wh* ').split() out = '' nd = False superS = False @@ -80,6 +80,12 @@ def convert(line, printStrongs=False): continue elif word in ['\\r']: out += '\n> ' + elif word in ['\\+wa', '\\+wa*', '\\wa', '\\wa*']: # https://docs.usfm.bible/usfm/3.1/char/features/wa.html + continue + elif word in ['\\+wg', '\\+wg*', '\\wg', '\\wg*']: # https://docs.usfm.bible/usfm/3.1/char/features/wg.html + continue + elif word in ['\\+wh', '\\+wh*', '\\wh', '\\wh*']: # https://docs.usfm.bible/usfm/3.1/char/features/wh.html + continue elif word in ['\\wj','\\wj*']: continue elif word in ['\\em','\\it']: -- cgit 1.4.1