Mercurial > hg > lxmldump
comparison lxmldump.py @ 56:71e66eca1e23
Merge.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 27 May 2021 16:55:22 +0300 |
parents | 301452a71cc7 884770576e74 |
children | 4410e2d1bff3 |
comparison
equal
deleted
inserted
replaced
55:301452a71cc7 | 56:71e66eca1e23 |
---|---|
41 | 41 |
42 | 42 |
43 pkk_mode_defaults = { | 43 pkk_mode_defaults = { |
44 # Default Ptr URL format strings | 44 # Default Ptr URL format strings |
45 "ptr_fmt": { | 45 "ptr_fmt": { |
46 PKK_MODE_NORMAL: u"<PTR:{href}>{text}</PTR>", | 46 PKK_MODE_NORMAL: "<PTR:{href}>{text}</PTR>", |
47 PKK_MODE_ANKI: u"<a href='https://kaino.kotus.fi/cgi-bin/kks/karjala.cgi?a={href}'>{text}</a>", | 47 PKK_MODE_ANKI: "<a href='https://kaino.kotus.fi/cgi-bin/kks/karjala.cgi?a={href}'>{text}</a>", |
48 }, | 48 }, |
49 | 49 |
50 "word_item": { | 50 "word_item": { |
51 PKK_MODE_NORMAL: "\"{word}\"{search}{attr}\n{hyphenation}{main_sense}{other_senses}\n", | 51 PKK_MODE_NORMAL: "\"{word}\"{search}{attr}\n{hyphenation}{main_sense}{other_senses}\n", |
52 PKK_MODE_ANKI: "\"{word}\"{search}{attr}{hyphenation};{main_sense};{other_senses}\n", | 52 PKK_MODE_ANKI: "\"{word}\"{search}{attr}{hyphenation};{main_sense};{other_senses}\n", |
73 "search_list_empty": { | 73 "search_list_empty": { |
74 PKK_MODE_NORMAL: "", | 74 PKK_MODE_NORMAL: "", |
75 }, | 75 }, |
76 "search_list_item": { | 76 "search_list_item": { |
77 PKK_MODE_NORMAL: "\"{text}\"", | 77 PKK_MODE_NORMAL: "\"{text}\"", |
78 PKK_MODE_ANKI: "{text}", | |
79 }, | 78 }, |
80 "search_list_sep": { | 79 "search_list_sep": { |
81 PKK_MODE_NORMAL: ", ", | 80 PKK_MODE_NORMAL: ", ", |
82 }, | 81 }, |
83 | 82 |
108 PKK_MODE_NORMAL: "{indent}defn \"{text}\"\n", | 107 PKK_MODE_NORMAL: "{indent}defn \"{text}\"\n", |
109 PKK_MODE_ANKI: " * \"{text}\"", | 108 PKK_MODE_ANKI: " * \"{text}\"", |
110 }, | 109 }, |
111 | 110 |
112 "example_item": { | 111 "example_item": { |
113 PKK_MODE_NORMAL: "{indent}exmp \"{text}\"{geostr}\n", | 112 PKK_MODE_NORMAL: "{indent}exmp \"{text}\"{geo_list}\n", |
114 PKK_MODE_ANKI: " ⚫ \"{text}\"{geostr}", | 113 PKK_MODE_ANKI: " ⚫ \"{text}\"{geo_list}", |
115 }, | 114 }, |
116 "example_geo_list": { | 115 "example_geo_list": { |
117 PKK_MODE_NORMAL: " ({alist})", | 116 PKK_MODE_NORMAL: " ({alist})", |
118 }, | 117 }, |
119 "example_geo_list_empty": { | 118 "example_geo_list_empty": { |
357 text=pkk_node_to_text(qnode), | 356 text=pkk_node_to_text(qnode), |
358 tclass=qnode.attrib["class"])) | 357 tclass=qnode.attrib["class"])) |
359 | 358 |
360 ostr += pkk_get_fmt("example_item").format( | 359 ostr += pkk_get_fmt("example_item").format( |
361 text=pkk_node_to_text(wnode.find("./Example")), | 360 text=pkk_node_to_text(wnode.find("./Example")), |
362 geostr=pkk_get_list_str(geolist, "example_geo", False), | 361 geo_list=pkk_get_list_str(geolist, "example_geo", False), |
363 indent=pkk_geti(indent + 1)) | 362 indent=pkk_geti(indent + 1)) |
364 | 363 |
365 return ostr | 364 return ostr |
366 | 365 |
367 | 366 |