From 4b03a402048dd02b8da1a0d811c126904d11f0bf Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Thu, 8 Jul 2021 21:28:34 -0400 Subject: Wordlist Entry: handle more tags --- usfm2gmi.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'usfm2gmi.py') diff --git a/usfm2gmi.py b/usfm2gmi.py index ffdf65e..7bfef3b 100755 --- a/usfm2gmi.py +++ b/usfm2gmi.py @@ -35,7 +35,7 @@ def superscript(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('\\+nd*','\\+nd* ').replace('\\f*','\\f* ').replace('\\wj*','\\wj* ').replace('\\w*','\\w* ').split() + split = line.replace('\\', ' \\').replace('\\nd*','\\nd* ').replace('\\+nd*','\\+nd* ').replace('\\f*','\\f* ').replace('\\wj*','\\wj* ').replace('\\w*','\\w* ').replace('\\+w*', '\\+w* ').split() out = '' nd = False if len(split) == 0: @@ -94,7 +94,8 @@ def convert(line): # TODO: support Endnotes (\fe and \fe*) elif word in ['\\ft']: continue # TODO: fancy formatting of more types - elif word in ['\\w','\\w*']: + # Words which appear in the glossary. + elif word in ['\\w','\\w*', '\\+w', '\\+w*']: continue elif '|strong="' in word: spl = word.split('|') -- cgit 1.4.1