Mercurial > hg > lxmldump
comparison lxmldump.py @ 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 |
comparison
equal
deleted
inserted
replaced
31:4cbefe4c6f53 | 32:cfecd039506e |
---|---|
225 | 225 |
226 # Print the headword and attributes if any | 226 # Print the headword and attributes if any |
227 pkk_output_subs_fmt(indent, wnode, "./Headword", "", "\"{ntext}\"") | 227 pkk_output_subs_fmt(indent, wnode, "./Headword", "", "\"{ntext}\"") |
228 | 228 |
229 if len(tmpl) > 0: | 229 if len(tmpl) > 0: |
230 pkk_print(" ({nlist})".format(nlist=" ; ".join(tmpl))) | 230 pkk_print(" ({nlist})".format(nlist=pkk_cfg.word_attr_sep.join(tmpl))) |
231 | 231 |
232 pkk_print("\n") | 232 pkk_print("\n") |
233 | 233 |
234 # Print main "sense" | 234 # Print main "sense" |
235 pkk_output_sense(indent + 1, wnode) | 235 pkk_output_sense(indent + 1, wnode) |
277 dest="ptr_url_fmt", | 277 dest="ptr_url_fmt", |
278 type=str, | 278 type=str, |
279 default=None, | 279 default=None, |
280 metavar="str", | 280 metavar="str", |
281 help='Ptr URL format string (see below)') | 281 help='Ptr URL format string (see below)') |
282 | |
283 optparser.add_argument("--attr-sep", | |
284 dest="word_attr_sep", | |
285 type=str, default=" ; ", | |
286 metavar="str", | |
287 help='word attribute separator (default: \"%(default)s\")') | |
282 | 288 |
283 optparser.add_argument("-n", "--normalize", | 289 optparser.add_argument("-n", "--normalize", |
284 dest="normalize", | 290 dest="normalize", |
285 action="store_true", | 291 action="store_true", |
286 help="output NFC normalized Unicode") | 292 help="output NFC normalized Unicode") |