From 64a89bf77bd118a6e5a676e3a32e8061c2256ac1 Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Wed, 24 Mar 2021 00:29:17 -0400 Subject: Strongs definitions: ignore them --- usfm2gmi.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'usfm2gmi.py') diff --git a/usfm2gmi.py b/usfm2gmi.py index fe188e7..fb25131 100755 --- a/usfm2gmi.py +++ b/usfm2gmi.py @@ -24,7 +24,7 @@ def smallcaps(word): def convert(line): """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('\\f*','\\f* ').replace('\\wj*','\\wj* ').split() + split = line.replace('\\', ' \\').replace('\\nd*','\\nd* ').replace('\\f*','\\f* ').replace('\\wj*','\\wj* ').replace('|strong',' |strong').split() out = '' nd = False if len(split) == 0: @@ -83,6 +83,10 @@ def convert(line): # TODO: support Endnotes (\fe and \fe*) elif word in ['\\ft']: continue # TODO: fancy formatting of more types + elif word == '\\w': + continue + elif '|strong' in word: + continue else: if nd: out += smallcaps(word) + ' ' -- cgit 1.4.1