changeset 32:cfecd039506e

Make word attribute separator string configurable.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 25 May 2021 12:54:41 +0300
parents 4cbefe4c6f53
children 3dcf8ac43bda
files lxmldump.py
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lxmldump.py	Tue May 25 12:40:35 2021 +0300
+++ b/lxmldump.py	Tue May 25 12:54:41 2021 +0300
@@ -227,7 +227,7 @@
         pkk_output_subs_fmt(indent, wnode, "./Headword", "", "\"{ntext}\"")
 
         if len(tmpl) > 0:
-            pkk_print(" ({nlist})".format(nlist=" ; ".join(tmpl)))
+            pkk_print(" ({nlist})".format(nlist=pkk_cfg.word_attr_sep.join(tmpl)))
 
         pkk_print("\n")
 
@@ -280,6 +280,12 @@
     metavar="str",
     help='Ptr URL format string (see below)')
 
+optparser.add_argument("--attr-sep",
+    dest="word_attr_sep",
+    type=str, default=" ; ",
+    metavar="str",
+    help='word attribute separator (default: \"%(default)s\")')
+
 optparser.add_argument("-n", "--normalize",
     dest="normalize",
     action="store_true",